@le-space/core 0.4.5 → 0.6.0
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/index.d.ts +2 -1
- package/index.js +9 -1
- package/package.json +6 -6
package/index.d.ts
CHANGED
|
@@ -168,6 +168,7 @@ type MessageEnvelope = {
|
|
|
168
168
|
type?: unknown;
|
|
169
169
|
}> | null;
|
|
170
170
|
};
|
|
171
|
+
declare function isTransientMessageLookupError(error: unknown): boolean;
|
|
171
172
|
declare function fetchMessageEnvelope(itemHash: string, options: {
|
|
172
173
|
apiHost?: string;
|
|
173
174
|
fetch: FetchLike;
|
|
@@ -942,4 +943,4 @@ declare function reconcileOwnerRelayBootstrapRegistrations(args: {
|
|
|
942
943
|
} | null;
|
|
943
944
|
}): Promise<OwnerRelayBootstrapReconcileResult>;
|
|
944
945
|
|
|
945
|
-
export { type CrnCapacitySpec, type CrnEraseResult, type CrnResolutionResult, DEFAULT_ALEPH_API_HOST, DEFAULT_ALEPH_CHANNEL, DEFAULT_COUNTRY_LOOKUP_BASE_URL, DEFAULT_CRN_LIST_URL, DEFAULT_DNS_RESOLVE_URL, DEFAULT_INSTANCE_PORT_FORWARDS, DEFAULT_IPFS_GATEWAY_BASE_URL, DEFAULT_SCHEDULER_ALLOCATION_URL, DEFAULT_TWO_N_SIX_HASH_URL, type FetchLike, type FetchLikeResponse, type HttpProbeResult, ITEM_HASH_RE, type JsonFetchLike$1 as JsonFetchLike, type JsonFetchLikeResponse, type OwnerRelayBootstrapReconcileResult, type PaymentQuote, type RelayBootstrapPublicationResult, type RelayBootstrapVisibilityResult, type RelayMetadataShape, type RetentionRecord, SSH_PUBLIC_KEY_PATTERN, SUCCESSFUL_DEPLOYMENTS_AGGREGATE_KEY, type TcpProbeResult, type TierSpec, VM_BOOTSTRAP_CONFIG_AGGREGATE_KEY, VM_BOOTSTRAP_CONFIG_HISTORY_RETENTION_MS, VM_BOOTSTRAP_CONFIG_SIGNAL_POST_TYPE, VM_BOOTSTRAP_CONFIG_SIGNAL_REF, appendDeploymentTokenToSshPublicKey, broadcastAlephMessage, buildPaymentQuote, cleanupFailedDeployment, configureOrbitdbRelaySetup, configureUcGoPeer, createDeploymentIntent, createDeploymentToken, createInstanceContent, createPortForwardAggregateContent, createRelayBootstrapRegistrationId, createReleaseMetadata, createUnsignedAggregateMessage, createUnsignedForgetMessage, createUnsignedInstanceMessage, createVmBootstrapConfigAggregateContent, deleteVmBootstrapConfig, deployInstance, describeRejectedDeployment, describeRuntimeAvailability, enrichCrnsWithGeo, ensureInstancePortForwards, eraseInstanceOnCrn, extractInsufficientBalanceMessage, extractProxyUrl, extractReferenceHashes, fetch2n6WebAccessUrl, fetchAggregateKey, fetchCrnExecutionMap, fetchCrns, fetchMessageEnvelope, fetchPortForwardAggregate, fetchRelayMetadataForRuntime, fetchSchedulerAllocation, fetchUcGoPeerMetadata, fetchVmBootstrapConfigAggregate, fetchVmBootstrapConfigSignals, fetchVmRuntime, filterDeployableCrns, findCrnByHash, forgetAlephMessages, inspectDeploymentResult, inspectMessageResult, isInvalidMessageFormatResponse, isRetryableBroadcastFailure, isValidSshPublicKey, listGeocodedCrns, listStaleVmBootstrapConfigAggregateMessageHashes, mergePortFlagMaps, mergeRequiredPortForwards, messageTypeFromEnvelope, normalizeBroadcastStatus, normalizeExecution, normalizeExistingPortForwardEntry, normalizeMessageStatus, normalizeProxyUrl, normalizeSshPublicKey, notifyCrnAllocation, notifyCrnAllocationWithRetry, portForwardLabel, postBroadcastPayload, probeRootfsGateway, publishAggregateKey, publishRelayBootstrapRegistration, publishVmBootstrapConfig, quoteRequiredBudgetUnits, rankCandidateCrns, reconcileOwnerRelayBootstrapRegistrations, requestedPortFlags, requiredInstancePortForwards, resolveInstanceCrn, resolveRootfsReference, retainSuccessfulDeployments, selectPreferredCrn, selectedTier, signAlephMessage, signaturePayload, tierSpec, validateRootfsManifest, verifyRootfsExists, verifyUcGoPeerReachability, waitForDeploymentResult, waitForRelayBootstrapRegistration, waitForSetupEndpoint, waitForVmBootstrapConfigSignal, waitForVmRuntime };
|
|
946
|
+
export { type CrnCapacitySpec, type CrnEraseResult, type CrnResolutionResult, DEFAULT_ALEPH_API_HOST, DEFAULT_ALEPH_CHANNEL, DEFAULT_COUNTRY_LOOKUP_BASE_URL, DEFAULT_CRN_LIST_URL, DEFAULT_DNS_RESOLVE_URL, DEFAULT_INSTANCE_PORT_FORWARDS, DEFAULT_IPFS_GATEWAY_BASE_URL, DEFAULT_SCHEDULER_ALLOCATION_URL, DEFAULT_TWO_N_SIX_HASH_URL, type FetchLike, type FetchLikeResponse, type HttpProbeResult, ITEM_HASH_RE, type JsonFetchLike$1 as JsonFetchLike, type JsonFetchLikeResponse, type OwnerRelayBootstrapReconcileResult, type PaymentQuote, type RelayBootstrapPublicationResult, type RelayBootstrapVisibilityResult, type RelayMetadataShape, type RetentionRecord, SSH_PUBLIC_KEY_PATTERN, SUCCESSFUL_DEPLOYMENTS_AGGREGATE_KEY, type TcpProbeResult, type TierSpec, VM_BOOTSTRAP_CONFIG_AGGREGATE_KEY, VM_BOOTSTRAP_CONFIG_HISTORY_RETENTION_MS, VM_BOOTSTRAP_CONFIG_SIGNAL_POST_TYPE, VM_BOOTSTRAP_CONFIG_SIGNAL_REF, appendDeploymentTokenToSshPublicKey, broadcastAlephMessage, buildPaymentQuote, cleanupFailedDeployment, configureOrbitdbRelaySetup, configureUcGoPeer, createDeploymentIntent, createDeploymentToken, createInstanceContent, createPortForwardAggregateContent, createRelayBootstrapRegistrationId, createReleaseMetadata, createUnsignedAggregateMessage, createUnsignedForgetMessage, createUnsignedInstanceMessage, createVmBootstrapConfigAggregateContent, deleteVmBootstrapConfig, deployInstance, describeRejectedDeployment, describeRuntimeAvailability, enrichCrnsWithGeo, ensureInstancePortForwards, eraseInstanceOnCrn, extractInsufficientBalanceMessage, extractProxyUrl, extractReferenceHashes, fetch2n6WebAccessUrl, fetchAggregateKey, fetchCrnExecutionMap, fetchCrns, fetchMessageEnvelope, fetchPortForwardAggregate, fetchRelayMetadataForRuntime, fetchSchedulerAllocation, fetchUcGoPeerMetadata, fetchVmBootstrapConfigAggregate, fetchVmBootstrapConfigSignals, fetchVmRuntime, filterDeployableCrns, findCrnByHash, forgetAlephMessages, inspectDeploymentResult, inspectMessageResult, isInvalidMessageFormatResponse, isRetryableBroadcastFailure, isTransientMessageLookupError, isValidSshPublicKey, listGeocodedCrns, listStaleVmBootstrapConfigAggregateMessageHashes, mergePortFlagMaps, mergeRequiredPortForwards, messageTypeFromEnvelope, normalizeBroadcastStatus, normalizeExecution, normalizeExistingPortForwardEntry, normalizeMessageStatus, normalizeProxyUrl, normalizeSshPublicKey, notifyCrnAllocation, notifyCrnAllocationWithRetry, portForwardLabel, postBroadcastPayload, probeRootfsGateway, publishAggregateKey, publishRelayBootstrapRegistration, publishVmBootstrapConfig, quoteRequiredBudgetUnits, rankCandidateCrns, reconcileOwnerRelayBootstrapRegistrations, requestedPortFlags, requiredInstancePortForwards, resolveInstanceCrn, resolveRootfsReference, retainSuccessfulDeployments, selectPreferredCrn, selectedTier, signAlephMessage, signaturePayload, tierSpec, validateRootfsManifest, verifyRootfsExists, verifyUcGoPeerReachability, waitForDeploymentResult, waitForRelayBootstrapRegistration, waitForSetupEndpoint, waitForVmBootstrapConfigSignal, waitForVmRuntime };
|
package/index.js
CHANGED
|
@@ -598,6 +598,13 @@ function normalizeExecution(item, crnUrl) {
|
|
|
598
598
|
}
|
|
599
599
|
|
|
600
600
|
// src/deployment-inspection.ts
|
|
601
|
+
var TRANSIENT_MESSAGE_LOOKUP_STATUSES = /* @__PURE__ */ new Set([408, 425, 429, 500, 502, 503, 504]);
|
|
602
|
+
function isTransientMessageLookupError(error) {
|
|
603
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
604
|
+
const match = message.match(/Message lookup failed: (\d{3})/);
|
|
605
|
+
if (!match) return false;
|
|
606
|
+
return TRANSIENT_MESSAGE_LOOKUP_STATUSES.has(Number(match[1]));
|
|
607
|
+
}
|
|
601
608
|
async function fetchMessageEnvelope(itemHash, options) {
|
|
602
609
|
const response = await options.fetch(`${options.apiHost ?? DEFAULT_ALEPH_API_HOST}/api/v0/messages/${itemHash}`, {
|
|
603
610
|
cache: "no-cache"
|
|
@@ -1789,7 +1796,7 @@ function appendDeploymentTokenToSshPublicKey(sshPublicKey, ownerAddress, deploym
|
|
|
1789
1796
|
}
|
|
1790
1797
|
return `${algorithm} ${key} aleph-bootstrap-config:${owner}:${token}`;
|
|
1791
1798
|
}
|
|
1792
|
-
function createReleaseMetadata(name, rootfsVersion, deployer = "
|
|
1799
|
+
function createReleaseMetadata(name, rootfsVersion, deployer = "relay-button") {
|
|
1793
1800
|
return {
|
|
1794
1801
|
name,
|
|
1795
1802
|
rootfs_version: rootfsVersion,
|
|
@@ -3435,6 +3442,7 @@ export {
|
|
|
3435
3442
|
inspectMessageResult,
|
|
3436
3443
|
isInvalidMessageFormatResponse,
|
|
3437
3444
|
isRetryableBroadcastFailure,
|
|
3445
|
+
isTransientMessageLookupError,
|
|
3438
3446
|
isValidSshPublicKey,
|
|
3439
3447
|
listGeocodedCrns,
|
|
3440
3448
|
listStaleVmBootstrapConfigAggregateMessageHashes,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@le-space/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Reusable Aleph deployment, runtime, and guest lifecycle logic.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
},
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
|
-
"url": "https://github.com/NiKrause/
|
|
20
|
+
"url": "https://github.com/NiKrause/relay-button"
|
|
21
21
|
},
|
|
22
|
-
"homepage": "https://github.com/NiKrause/
|
|
22
|
+
"homepage": "https://github.com/NiKrause/relay-button",
|
|
23
23
|
"bugs": {
|
|
24
|
-
"url": "https://github.com/NiKrause/
|
|
24
|
+
"url": "https://github.com/NiKrause/relay-button/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@le-space/aleph-bootstrap": "0.
|
|
28
|
-
"@le-space/shared-types": "0.
|
|
27
|
+
"@le-space/aleph-bootstrap": "0.6.0",
|
|
28
|
+
"@le-space/shared-types": "0.6.0"
|
|
29
29
|
}
|
|
30
30
|
}
|