@spotpatch/runtime 1.15.3 → 1.15.4
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.
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
EXTERNAL_AGENT_CONTROL_LIMITS as EXTERNAL_AGENT_CONTROL_LIMITS2,
|
|
18
18
|
EXTERNAL_AGENT_MANAGED_PROFILE,
|
|
19
19
|
EXTERNAL_HANDOFF_BROKER_PROTOCOL_VERSION,
|
|
20
|
+
EXTERNAL_HANDOFF_FRAMEWORKS,
|
|
20
21
|
EXTERNAL_HANDOFF_LIMITS,
|
|
21
22
|
EXTERNAL_HANDOFF_SNAPSHOT_SCHEMA_VERSION,
|
|
22
23
|
SPOTPATCH_ENDPOINTS as SPOTPATCH_ENDPOINTS2,
|
|
@@ -498,6 +499,9 @@ function parseStatusResult(value) {
|
|
|
498
499
|
dispatch
|
|
499
500
|
});
|
|
500
501
|
}
|
|
502
|
+
function isExternalHandoffFramework(value) {
|
|
503
|
+
return EXTERNAL_HANDOFF_FRAMEWORKS.some((framework) => framework === value);
|
|
504
|
+
}
|
|
501
505
|
function parseSummary(value) {
|
|
502
506
|
if (!record(value)) throw new ExternalHandoffApiError();
|
|
503
507
|
const expectedKeys = [
|
|
@@ -513,7 +517,7 @@ function parseSummary(value) {
|
|
|
513
517
|
"targetCount",
|
|
514
518
|
...value.pickedUpAt === void 0 ? [] : ["pickedUpAt"]
|
|
515
519
|
];
|
|
516
|
-
if (!exactKeys(value, expectedKeys) || typeof value.sessionId !== "string" || !OPAQUE_ID_PATTERN.test(value.sessionId) || value.framework
|
|
520
|
+
if (!exactKeys(value, expectedKeys) || typeof value.sessionId !== "string" || !OPAQUE_ID_PATTERN.test(value.sessionId) || !isExternalHandoffFramework(value.framework) || !Number.isSafeInteger(value.revision) || value.revision <= 0 || typeof value.cursor !== "string" || !OPAQUE_ID_PATTERN.test(value.cursor) || !Number.isSafeInteger(value.targetCount) || value.targetCount <= 0 || !record(value.page) || !exactKeys(value.page, ["origin", "pathname"]) || typeof value.page.origin !== "string" || typeof value.page.pathname !== "string" || !validTimestamp(value.publishedAt) || !validTimestamp(value.expiresAt) || value.state !== "available" && value.state !== "expired" && value.state !== "superseded" || !Number.isSafeInteger(value.pickupCount) || value.pickupCount < 0 || value.pickupCount > EXTERNAL_HANDOFF_LIMITS.maximumConnectorReceipts || value.pickedUpAt !== void 0 && !validTimestamp(value.pickedUpAt)) {
|
|
517
521
|
throw new ExternalHandoffApiError();
|
|
518
522
|
}
|
|
519
523
|
return Object.freeze({
|