@le-space/core 0.6.2 → 0.6.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.
Files changed (3) hide show
  1. package/index.d.ts +1 -1
  2. package/index.js +24 -7
  3. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _le_space_shared_types from '@le-space/shared-types';
2
2
  import { RootfsResolution, RootfsManifest, RootfsManifestState, CrnRecord, RootfsRequiredPortForward, PortForwardAggregate, PortForwardFlags, PortForwardAggregateEntry, MessageReference, InstanceExecution, MessageStatus, DeploymentInspectionResult, MessageInspectionResult, AlephBroadcastMessage, AlephBroadcastResponse, MessageSigner, MessageHasher, DeploymentProgressListener, AlephAggregateContent, AlephInstanceContent, DeploymentIntentEnvelope, DeploymentResult, InstanceAllocation, InstanceRuntimeDetails, InstanceWebAccess, RuntimeDiagnostics, UcanStoreBootstrapPackage, PortMapping, VmBootstrapConfigRecord, VmBootstrapConfigAggregate, VmBootstrapConfigSignalRecord, VmBootstrapConfigSignalType } from '@le-space/shared-types';
3
3
 
4
- declare const DEFAULT_ALEPH_CHANNEL = "TEST";
4
+ declare const DEFAULT_ALEPH_CHANNEL = "ALEPH-CLOUDSOLUTIONS";
5
5
 
6
6
  declare const ITEM_HASH_RE: RegExp;
7
7
  declare const DEFAULT_ALEPH_API_HOST = "https://api.aleph.im";
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "./chunk-4VNS5WPM.js";
2
2
 
3
3
  // src/constants.ts
4
- var DEFAULT_ALEPH_CHANNEL = "TEST";
4
+ var DEFAULT_ALEPH_CHANNEL = "ALEPH-CLOUDSOLUTIONS";
5
5
 
6
6
  // src/manifests.ts
7
7
  var ITEM_HASH_RE = /^[a-fA-F0-9]{64}$/;
@@ -687,15 +687,32 @@ async function waitForDeploymentResult(itemHash, options) {
687
687
  const attempts = Math.max(1, Number(options.attempts ?? 15));
688
688
  const delayMs = Math.max(0, Number(options.delayMs ?? 2e3));
689
689
  const sleep2 = options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
690
- let lastResult = await inspectDeploymentResult(itemHash, options);
691
- options.onAttempt?.(lastResult, 1, attempts);
692
- for (let attempt = 1; attempt < attempts; attempt += 1) {
690
+ let lastResult = {
691
+ status: "unknown",
692
+ errorCode: null,
693
+ details: null,
694
+ rejectionReason: null,
695
+ references: []
696
+ };
697
+ for (let attempt = 1; attempt <= attempts; attempt += 1) {
698
+ try {
699
+ lastResult = await inspectDeploymentResult(itemHash, options);
700
+ } catch (error) {
701
+ if (!isTransientMessageLookupError(error)) {
702
+ throw error;
703
+ }
704
+ lastResult = {
705
+ ...lastResult,
706
+ rejectionReason: error instanceof Error ? error.message : String(error)
707
+ };
708
+ }
709
+ options.onAttempt?.(lastResult, attempt, attempts);
693
710
  if (lastResult.status === "processed" || lastResult.status === "rejected") {
694
711
  return lastResult;
695
712
  }
696
- await sleep2(delayMs);
697
- lastResult = await inspectDeploymentResult(itemHash, options);
698
- options.onAttempt?.(lastResult, attempt + 1, attempts);
713
+ if (attempt < attempts) {
714
+ await sleep2(delayMs);
715
+ }
699
716
  }
700
717
  return lastResult;
701
718
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@le-space/core",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Reusable Aleph deployment, runtime, and guest lifecycle logic.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,7 +24,7 @@
24
24
  "url": "https://github.com/NiKrause/relay-button/issues"
25
25
  },
26
26
  "dependencies": {
27
- "@le-space/aleph-bootstrap": "0.6.2",
28
- "@le-space/shared-types": "0.6.2"
27
+ "@le-space/aleph-bootstrap": "0.6.3",
28
+ "@le-space/shared-types": "0.6.3"
29
29
  }
30
30
  }