@absolutejs/absolute 0.20.0-beta.15 → 0.20.0-beta.16

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.
@@ -189,6 +189,8 @@ var RUNTIME_TRANSPORT, host, isRegistry = (value) => typeof value === "object" &
189
189
  }
190
190
  for (const [index, rule] of (policy.mutations ?? []).entries()) {
191
191
  validatePolicyMatch(rule.match, `${label}.mutations[${index}]`);
192
+ if (rule.persistence === "memory-only" && rule.protection === "required")
193
+ throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}] cannot require at-rest protection when it is memory-only.`);
192
194
  if (rule.sensitivity !== undefined && rule.sensitivity !== "public" && rule.protection !== "required" && rule.persistence !== "memory-only")
193
195
  throw new SyncLocalDataPolicyError("INVALID_POLICY", `${label}.mutations[${index}] declares ${rule.sensitivity} arguments without required protection.`);
194
196
  }
@@ -441,6 +443,7 @@ var object = (value) => typeof value === "object" && value !== null && !Array.is
441
443
  const rule = requireObject(entry, id, `localData.mutations[${index}] must be an object.`);
442
444
  const allowedRuleKeys = new Set([
443
445
  "match",
446
+ "onProtectionUnavailable",
444
447
  "persistence",
445
448
  "protection",
446
449
  "sensitivity"
@@ -451,15 +454,19 @@ var object = (value) => typeof value === "object" && value !== null && !Array.is
451
454
  const protection = unknownField(rule, "protection");
452
455
  const sensitivity = unknownField(rule, "sensitivity");
453
456
  const persistence = unknownField(rule, "persistence");
457
+ const onProtectionUnavailable = unknownField(rule, "onProtectionUnavailable");
454
458
  if (protection !== undefined && protection !== "none" && protection !== "required")
455
459
  throw metadataError(id, `localData.mutations[${index}].protection is invalid.`);
456
460
  if (sensitivity !== undefined && sensitivity !== "public" && sensitivity !== "private" && sensitivity !== "secret")
457
461
  throw metadataError(id, `localData.mutations[${index}].sensitivity is invalid.`);
462
+ if (onProtectionUnavailable !== undefined && onProtectionUnavailable !== "error" && onProtectionUnavailable !== "memory-only")
463
+ throw metadataError(id, `localData.mutations[${index}].onProtectionUnavailable is invalid.`);
458
464
  if (persistence !== undefined && persistence !== "durable" && persistence !== "memory-only")
459
465
  throw metadataError(id, `localData.mutations[${index}].persistence is invalid.`);
460
466
  return {
461
467
  match: nonEmpty(Reflect.get(rule, "match"), id, `localData.mutations[${index}].match`),
462
468
  ...sensitivity ? { sensitivity } : {},
469
+ ...onProtectionUnavailable ? { onProtectionUnavailable } : {},
463
470
  ...persistence ? {
464
471
  persistence
465
472
  } : {},
@@ -6116,5 +6123,5 @@ export {
6116
6123
  ABSOLUTE_ANDROID_RELEASE_FORMAT
6117
6124
  };
6118
6125
 
6119
- //# debugId=924628517A2DD9D064756E2164756E21
6126
+ //# debugId=8A696911288E3CC364756E2164756E21
6120
6127
  //# sourceMappingURL=index.js.map