@le-space/core 0.1.32 → 0.1.33
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 +11 -2
- package/index.js +22 -0
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _le_space_shared_types from '@le-space/shared-types';
|
|
2
|
-
import { RootfsResolution, RootfsManifest, RootfsManifestState, CrnRecord, RootfsRequiredPortForward, PortForwardAggregate, PortForwardFlags, PortForwardAggregateEntry, MessageReference, InstanceExecution, MessageStatus, DeploymentInspectionResult, MessageInspectionResult, AlephBroadcastMessage, AlephBroadcastResponse, MessageSigner, MessageHasher, AlephAggregateContent, AlephInstanceContent, DeploymentResult, InstanceAllocation, InstanceRuntimeDetails, InstanceWebAccess, RuntimeDiagnostics, PortMapping } from '@le-space/shared-types';
|
|
2
|
+
import { RootfsResolution, RootfsManifest, RootfsManifestState, CrnRecord, RootfsRequiredPortForward, PortForwardAggregate, PortForwardFlags, PortForwardAggregateEntry, MessageReference, InstanceExecution, MessageStatus, DeploymentInspectionResult, MessageInspectionResult, AlephBroadcastMessage, AlephBroadcastResponse, MessageSigner, MessageHasher, AlephAggregateContent, AlephInstanceContent, DeploymentIntentEnvelope, DeploymentResult, InstanceAllocation, InstanceRuntimeDetails, InstanceWebAccess, RuntimeDiagnostics, PortMapping } from '@le-space/shared-types';
|
|
3
3
|
|
|
4
4
|
declare const DEFAULT_ALEPH_CHANNEL = "TEST";
|
|
5
5
|
|
|
@@ -409,6 +409,15 @@ declare function createUnsignedInstanceMessage(args: {
|
|
|
409
409
|
channel?: string;
|
|
410
410
|
now?: number;
|
|
411
411
|
}): Promise<Omit<AlephBroadcastMessage, 'signature'>>;
|
|
412
|
+
declare function createDeploymentIntent(args: {
|
|
413
|
+
sender: string;
|
|
414
|
+
unsignedMessage: Omit<AlephBroadcastMessage, 'signature'>;
|
|
415
|
+
content: AlephInstanceContent;
|
|
416
|
+
computeUnits: number;
|
|
417
|
+
expiresAt: number;
|
|
418
|
+
maxCost: string;
|
|
419
|
+
hasher: MessageHasher;
|
|
420
|
+
}): Promise<DeploymentIntentEnvelope>;
|
|
412
421
|
declare function deployInstance(args: {
|
|
413
422
|
sender: string;
|
|
414
423
|
content: AlephInstanceContent;
|
|
@@ -544,4 +553,4 @@ declare function verifyUcGoPeerReachability(args: {
|
|
|
544
553
|
checks: Record<string, Record<string, unknown>>;
|
|
545
554
|
}>;
|
|
546
555
|
|
|
547
|
-
export { 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, type JsonFetchLikeResponse, type RetentionRecord, SSH_PUBLIC_KEY_PATTERN, SUCCESSFUL_DEPLOYMENTS_AGGREGATE_KEY, type TcpProbeResult, broadcastAlephMessage, cleanupFailedDeployment, configureUcGoPeer, createInstanceContent, createPortForwardAggregateContent, createReleaseMetadata, createUnsignedAggregateMessage, createUnsignedForgetMessage, createUnsignedInstanceMessage, deployInstance, describeRejectedDeployment, describeRuntimeAvailability, enrichCrnsWithGeo, ensureInstancePortForwards, extractProxyUrl, extractReferenceHashes, fetch2n6WebAccessUrl, fetchAggregateKey, fetchCrnExecutionMap, fetchCrns, fetchMessageEnvelope, fetchPortForwardAggregate, fetchSchedulerAllocation, fetchUcGoPeerMetadata, fetchVmRuntime, findCrnByHash, forgetAlephMessages, inspectDeploymentResult, inspectMessageResult, isInvalidMessageFormatResponse, isRetryableBroadcastFailure, isValidSshPublicKey, listGeocodedCrns, mergePortFlagMaps, mergeRequiredPortForwards, messageTypeFromEnvelope, normalizeBroadcastStatus, normalizeExecution, normalizeExistingPortForwardEntry, normalizeMessageStatus, normalizeProxyUrl, normalizeSshPublicKey, notifyCrnAllocation, portForwardLabel, postBroadcastPayload, probeRootfsGateway, publishAggregateKey, rankCandidateCrns, requestedPortFlags, requiredInstancePortForwards, resolveRootfsReference, retainSuccessfulDeployments, selectPreferredCrn, signAlephMessage, signaturePayload, validateRootfsManifest, verifyRootfsExists, verifyUcGoPeerReachability, waitForDeploymentResult, waitForSetupEndpoint, waitForVmRuntime };
|
|
556
|
+
export { 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, type JsonFetchLikeResponse, type RetentionRecord, SSH_PUBLIC_KEY_PATTERN, SUCCESSFUL_DEPLOYMENTS_AGGREGATE_KEY, type TcpProbeResult, broadcastAlephMessage, cleanupFailedDeployment, configureUcGoPeer, createDeploymentIntent, createInstanceContent, createPortForwardAggregateContent, createReleaseMetadata, createUnsignedAggregateMessage, createUnsignedForgetMessage, createUnsignedInstanceMessage, deployInstance, describeRejectedDeployment, describeRuntimeAvailability, enrichCrnsWithGeo, ensureInstancePortForwards, extractProxyUrl, extractReferenceHashes, fetch2n6WebAccessUrl, fetchAggregateKey, fetchCrnExecutionMap, fetchCrns, fetchMessageEnvelope, fetchPortForwardAggregate, fetchSchedulerAllocation, fetchUcGoPeerMetadata, fetchVmRuntime, findCrnByHash, forgetAlephMessages, inspectDeploymentResult, inspectMessageResult, isInvalidMessageFormatResponse, isRetryableBroadcastFailure, isValidSshPublicKey, listGeocodedCrns, mergePortFlagMaps, mergeRequiredPortForwards, messageTypeFromEnvelope, normalizeBroadcastStatus, normalizeExecution, normalizeExistingPortForwardEntry, normalizeMessageStatus, normalizeProxyUrl, normalizeSshPublicKey, notifyCrnAllocation, portForwardLabel, postBroadcastPayload, probeRootfsGateway, publishAggregateKey, rankCandidateCrns, requestedPortFlags, requiredInstancePortForwards, resolveRootfsReference, retainSuccessfulDeployments, selectPreferredCrn, signAlephMessage, signaturePayload, validateRootfsManifest, verifyRootfsExists, verifyUcGoPeerReachability, waitForDeploymentResult, waitForSetupEndpoint, waitForVmRuntime };
|
package/index.js
CHANGED
|
@@ -1285,6 +1285,27 @@ async function createUnsignedInstanceMessage(args) {
|
|
|
1285
1285
|
channel: args.channel ?? DEFAULT_ALEPH_CHANNEL
|
|
1286
1286
|
};
|
|
1287
1287
|
}
|
|
1288
|
+
async function createDeploymentIntent(args) {
|
|
1289
|
+
const intent = {
|
|
1290
|
+
ownerAddress: args.sender,
|
|
1291
|
+
messageTime: args.unsignedMessage.time,
|
|
1292
|
+
itemHash: args.unsignedMessage.item_hash,
|
|
1293
|
+
paymentType: args.content.payment.type,
|
|
1294
|
+
rootfsRef: args.content.rootfs.parent.ref,
|
|
1295
|
+
rootfsSizeMiB: args.content.rootfs.size_mib,
|
|
1296
|
+
computeUnits: args.computeUnits,
|
|
1297
|
+
vcpus: args.content.resources.vcpus,
|
|
1298
|
+
memoryMiB: args.content.resources.memory,
|
|
1299
|
+
crnHash: args.content.requirements?.node?.node_hash ?? null,
|
|
1300
|
+
channel: args.unsignedMessage.channel,
|
|
1301
|
+
expiresAt: args.expiresAt,
|
|
1302
|
+
maxCost: args.maxCost
|
|
1303
|
+
};
|
|
1304
|
+
return {
|
|
1305
|
+
intent,
|
|
1306
|
+
intentHash: await args.hasher(JSON.stringify(intent))
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1288
1309
|
async function deployInstance(args) {
|
|
1289
1310
|
const unsignedMessage = await createUnsignedInstanceMessage({
|
|
1290
1311
|
sender: args.sender,
|
|
@@ -1766,6 +1787,7 @@ export {
|
|
|
1766
1787
|
broadcastAlephMessage,
|
|
1767
1788
|
cleanupFailedDeployment,
|
|
1768
1789
|
configureUcGoPeer,
|
|
1790
|
+
createDeploymentIntent,
|
|
1769
1791
|
createInstanceContent,
|
|
1770
1792
|
createPortForwardAggregateContent,
|
|
1771
1793
|
createReleaseMetadata,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@le-space/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.33",
|
|
4
4
|
"description": "Reusable Aleph deployment, runtime, and guest lifecycle logic.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@le-space/shared-types": "0.1.
|
|
19
|
+
"@le-space/shared-types": "0.1.33"
|
|
20
20
|
}
|
|
21
21
|
}
|