webloom-framework 0.4.2 → 0.4.3

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.
@@ -680,7 +680,7 @@ function validServiceIdentity(message2) {
680
680
  return boundedText(message2.callId, MAX_CALL_ID_LENGTH) && boundedText(message2.serviceInstanceId, MAX_ID_LENGTH);
681
681
  }
682
682
  function validateSnapshot(value) {
683
- if (value.type !== RUNTIME_SNAPSHOT_TYPE || !validIdentity(value) || !validBinding(value.binding) || !boundedText(value.runtimeId, MAX_ID_LENGTH) || !boundedText(value.runtimeInstanceId, MAX_ID_LENGTH) || value.runtimeKind !== "window-main" && value.runtimeKind !== "shared-worker" || !Number.isSafeInteger(value.revision) || value.revision < 0 || !["starting", "ready", "stopping", "failed", "disposed"].includes(String(value.state)) || !Array.isArray(value.units) || !Array.isArray(value.services) || value.units.length > MAX_SNAPSHOT_UNITS || value.services.length > MAX_SNAPSHOT_SERVICES) return false;
683
+ if (value.type !== RUNTIME_SNAPSHOT_TYPE || !validIdentity(value) || value.binding !== void 0 && !validBinding(value.binding) || !boundedText(value.runtimeId, MAX_ID_LENGTH) || !boundedText(value.runtimeInstanceId, MAX_ID_LENGTH) || value.runtimeKind !== "window-main" && value.runtimeKind !== "shared-worker" || !Number.isSafeInteger(value.revision) || value.revision < 0 || !["starting", "ready", "stopping", "failed", "disposed"].includes(String(value.state)) || !Array.isArray(value.units) || !Array.isArray(value.services) || value.units.length > MAX_SNAPSHOT_UNITS || value.services.length > MAX_SNAPSHOT_SERVICES) return false;
684
684
  if (value.state !== "ready" && value.services.length !== 0) return false;
685
685
  const unitKeys = /* @__PURE__ */ new Set();
686
686
  for (const unit of value.units) {
@@ -710,7 +710,7 @@ function validateSnapshot(value) {
710
710
  function validateMessage(value) {
711
711
  if (!record(value) || !text(value.type) || !validIdentity(value)) return false;
712
712
  if (value.type === RUNTIME_SNAPSHOT_TYPE) return validateSnapshot(value);
713
- if (!validBinding(value.binding) && value.type !== RUNTIME_SNAPSHOT_TYPE) return false;
713
+ if (value.binding !== void 0 && !validBinding(value.binding)) return false;
714
714
  if (value.type === RUNTIME_ERROR_TYPE) return boundedText(value.code, MAX_ID_LENGTH) && boundedText(value.message, MAX_ERROR_MESSAGE_LENGTH) && phase(value.phase) && (value.pluginId === void 0 || boundedText(value.pluginId, MAX_ID_LENGTH)) && (value.unitId === void 0 || boundedText(value.unitId, MAX_ID_LENGTH));
715
715
  if (value.type === RUNTIME_CALL_TYPE) return validServiceIdentity(value) && boundedText(value.capabilityId, MAX_ID_LENGTH) && boundedText(value.contractVersion, MAX_VERSION_LENGTH) && Object.hasOwn(value, "request") && validPayload(value.request) && (value.mode === "unary" || value.mode === "stream") && typeof value.timeoutMs === "number" && Number.isFinite(value.timeoutMs) && value.timeoutMs > 0 && value.timeoutMs <= 3e5 && (value.operationId === void 0 || boundedText(value.operationId, MAX_ID_LENGTH)) && (value.grantId === void 0 || boundedText(value.grantId, MAX_ID_LENGTH)) && (value.mode !== "stream" ? !Object.hasOwn(value, "initialCredit") : Number.isSafeInteger(value.initialCredit) && value.initialCredit >= 1 && value.initialCredit <= 256);
716
716
  if (value.type === RUNTIME_RESULT_TYPE) return validServiceIdentity(value) && ((!Object.hasOwn(value, "result") || validPayload(value.result)) && (value.streamReady === true && !Object.hasOwn(value, "result") && !Object.hasOwn(value, "done") || value.done === true && !Object.hasOwn(value, "result") && !Object.hasOwn(value, "streamReady") || Object.hasOwn(value, "result") && !Object.hasOwn(value, "done") && !Object.hasOwn(value, "streamReady")));
@@ -4035,5 +4035,5 @@ function hostForWindowApp(app) {
4035
4035
  }
4036
4036
 
4037
4037
  export { DEFAULT_RUNTIME_LIMITS, LIFECYCLE_ERROR_TEXT, LifecycleScopeRevokedError, PermissionDeniedError, PermissionLeaseRevokedError, RESOURCE_OWNER, RESOURCE_REGISTRY, RUNTIME_CALL_TYPE, RUNTIME_CANCEL_TYPE, RUNTIME_CLOSE_ACK_TYPE, RUNTIME_CLOSE_TYPE, RUNTIME_CREDIT_TYPE, RUNTIME_ERROR_MESSAGE_TYPE, RUNTIME_ERROR_TYPE, RUNTIME_NEXT_TYPE, RUNTIME_PROTOCOL_VERSION, RUNTIME_RESULT_TYPE, RUNTIME_SNAPSHOT_TYPE, RuntimeInitializationError, RuntimeUnavailableError, SCOPED_TASK_SCHEDULER_CAPABILITY, StartupCapabilityError, StartupPluginError, UpgradeGateRejectedError, WebLoomError, assertCapability, assertReceivedPortSet, buildPluginGraph, capabilityDescriptor, capabilityKey, cloneFrozenAttributes, createCapabilityRegistry, createInMemoryPluginConfigStore, createLifecycleScope, createMessageBus, createPermissionLease, createPluginHost, createReceivePortLedger, createResourceRegistry, createResourceScope, createResourceStore, createRuntimeBudget, createRuntimeMessageCodec, createRuntimeUnitImplementationRegistry, createScopedTaskScheduler, createWindowApp, createWindowAppFromHost, defineCapability, dependenciesOfManifest, hostForWindowApp, invokeCapabilityHandler, isCapability, isCapabilityDescriptor, isRuntimeSnapshot, lifecycleErrorText, materializePluginDefinitions, normalizeRuntimeLimits, providesOfManifest, registerOwnedResource, reverseDependentsOf, selectRuntimeUnit, validateDto, validatePluginGraph, validateRawDto, validateTransferList, validateTransferListWithStats };
4038
- //# sourceMappingURL=chunk-CKML74MG.js.map
4039
- //# sourceMappingURL=chunk-CKML74MG.js.map
4038
+ //# sourceMappingURL=chunk-ZP5QYTXX.js.map
4039
+ //# sourceMappingURL=chunk-ZP5QYTXX.js.map