@le-space/shared-types 0.1.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/README.md +5 -0
- package/index.d.ts +252 -0
- package/index.js +0 -0
- package/package.json +18 -0
package/README.md
ADDED
package/index.d.ts
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
interface RootfsRequiredPortForward {
|
|
2
|
+
port: number;
|
|
3
|
+
tcp?: boolean;
|
|
4
|
+
udp?: boolean;
|
|
5
|
+
purpose?: string;
|
|
6
|
+
}
|
|
7
|
+
type MessageStatus = 'processed' | 'pending' | 'rejected' | 'unknown';
|
|
8
|
+
type GatewayProbeStatus = 'reachable' | 'timeout' | 'error' | 'unavailable' | 'unknown';
|
|
9
|
+
type RootfsInstallStrategy = 'thin' | 'prebaked';
|
|
10
|
+
interface RootfsManifest {
|
|
11
|
+
profile?: string;
|
|
12
|
+
version: string;
|
|
13
|
+
rootfsInstallStrategy?: RootfsInstallStrategy;
|
|
14
|
+
requiresBootstrapNetwork?: boolean;
|
|
15
|
+
bootstrapSummary?: string;
|
|
16
|
+
rootfsItemHash?: string;
|
|
17
|
+
rootfsCid?: string;
|
|
18
|
+
rootfsSizeMiB: number;
|
|
19
|
+
rootfsSourceSizeBytes?: number;
|
|
20
|
+
requiredPortForwards?: RootfsRequiredPortForward[];
|
|
21
|
+
createdAt: string;
|
|
22
|
+
notes?: string;
|
|
23
|
+
}
|
|
24
|
+
interface RootfsManifestState {
|
|
25
|
+
manifest: RootfsManifest | null;
|
|
26
|
+
valid: boolean;
|
|
27
|
+
errors: string[];
|
|
28
|
+
}
|
|
29
|
+
interface PortForwardFlags {
|
|
30
|
+
tcp: boolean;
|
|
31
|
+
udp: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface PortForwardAggregateEntry {
|
|
34
|
+
ports?: Record<string, PortForwardFlags>;
|
|
35
|
+
}
|
|
36
|
+
type PortForwardAggregate = Record<string, PortForwardAggregateEntry>;
|
|
37
|
+
interface RootfsResolution {
|
|
38
|
+
itemHash: string;
|
|
39
|
+
messageStatus: MessageStatus;
|
|
40
|
+
messageType: string | null;
|
|
41
|
+
cid: string | null;
|
|
42
|
+
receptionTime?: string | null;
|
|
43
|
+
rejectionErrorCode?: number | null;
|
|
44
|
+
rejectionReason?: string | null;
|
|
45
|
+
gatewayUrl: string | null;
|
|
46
|
+
gatewayStatus: GatewayProbeStatus;
|
|
47
|
+
gatewayError?: string | null;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
interface PortMapping {
|
|
51
|
+
host?: number;
|
|
52
|
+
tcp?: boolean;
|
|
53
|
+
udp?: boolean;
|
|
54
|
+
}
|
|
55
|
+
interface CrnSystemUsage {
|
|
56
|
+
active?: boolean;
|
|
57
|
+
}
|
|
58
|
+
interface CrnRecord {
|
|
59
|
+
hash: string;
|
|
60
|
+
name?: string;
|
|
61
|
+
address?: string;
|
|
62
|
+
score?: number | string;
|
|
63
|
+
qemu_support?: boolean;
|
|
64
|
+
city?: string | null;
|
|
65
|
+
region?: string | null;
|
|
66
|
+
country?: string | null;
|
|
67
|
+
country_code?: string | null;
|
|
68
|
+
resolved_ip?: string | null;
|
|
69
|
+
geo_source?: string | null;
|
|
70
|
+
system_usage?: CrnSystemUsage | null;
|
|
71
|
+
[key: string]: unknown;
|
|
72
|
+
}
|
|
73
|
+
type ReferenceStatus = 'processed' | 'pending' | 'rejected' | 'unknown' | 'missing';
|
|
74
|
+
interface RuntimeMetadata {
|
|
75
|
+
hostIpv4?: string | null;
|
|
76
|
+
ipv6?: string | null;
|
|
77
|
+
proxyUrl?: string | null;
|
|
78
|
+
mappedPorts?: Record<string, PortMapping>;
|
|
79
|
+
}
|
|
80
|
+
interface MessageReference {
|
|
81
|
+
itemHash: string;
|
|
82
|
+
status: ReferenceStatus;
|
|
83
|
+
type: string | null;
|
|
84
|
+
}
|
|
85
|
+
interface InstanceAllocationNode {
|
|
86
|
+
node_id?: string;
|
|
87
|
+
url?: string;
|
|
88
|
+
ipv6?: string | null;
|
|
89
|
+
supports_ipv6?: boolean;
|
|
90
|
+
}
|
|
91
|
+
interface InstanceAllocationPeriod {
|
|
92
|
+
start_timestamp?: string;
|
|
93
|
+
duration_seconds?: number;
|
|
94
|
+
}
|
|
95
|
+
interface InstanceAllocation {
|
|
96
|
+
source: 'scheduler' | 'manual';
|
|
97
|
+
crnHash?: string | null;
|
|
98
|
+
crnUrl?: string | null;
|
|
99
|
+
node?: InstanceAllocationNode | null;
|
|
100
|
+
vmIpv6?: string | null;
|
|
101
|
+
period?: InstanceAllocationPeriod | null;
|
|
102
|
+
}
|
|
103
|
+
interface InstanceExecutionStatus {
|
|
104
|
+
defined_at?: string | null;
|
|
105
|
+
preparing_at?: string | null;
|
|
106
|
+
prepared_at?: string | null;
|
|
107
|
+
starting_at?: string | null;
|
|
108
|
+
started_at?: string | null;
|
|
109
|
+
stopping_at?: string | null;
|
|
110
|
+
stopped_at?: string | null;
|
|
111
|
+
}
|
|
112
|
+
interface InstanceExecutionNetworking {
|
|
113
|
+
ipv4?: string | null;
|
|
114
|
+
ipv6?: string | null;
|
|
115
|
+
ipv4_network?: string | null;
|
|
116
|
+
host_ipv4?: string | null;
|
|
117
|
+
ipv6_network?: string | null;
|
|
118
|
+
ipv6_ip?: string | null;
|
|
119
|
+
ipv4_ip?: string | null;
|
|
120
|
+
proxy_url?: string | null;
|
|
121
|
+
mapped_ports?: Record<string, PortMapping>;
|
|
122
|
+
}
|
|
123
|
+
interface InstanceExecution {
|
|
124
|
+
crnUrl: string;
|
|
125
|
+
version: 'v1' | 'v2';
|
|
126
|
+
running?: boolean;
|
|
127
|
+
networking: InstanceExecutionNetworking;
|
|
128
|
+
status?: InstanceExecutionStatus | null;
|
|
129
|
+
}
|
|
130
|
+
interface InstanceWebAccess {
|
|
131
|
+
url?: string | null;
|
|
132
|
+
active?: boolean | null;
|
|
133
|
+
subdomain?: string | null;
|
|
134
|
+
}
|
|
135
|
+
interface RuntimeDiagnostics {
|
|
136
|
+
state: string;
|
|
137
|
+
reason: string | null;
|
|
138
|
+
timedOut?: boolean;
|
|
139
|
+
schedulerSource?: string | null;
|
|
140
|
+
executionSeen?: boolean;
|
|
141
|
+
webAccessActive?: boolean | null;
|
|
142
|
+
mappedPortCount?: number;
|
|
143
|
+
proxyUrl?: string | null;
|
|
144
|
+
}
|
|
145
|
+
interface InstanceRuntimeDetails {
|
|
146
|
+
messageStatus: 'processed' | 'pending' | 'rejected' | 'unknown';
|
|
147
|
+
allocation: InstanceAllocation | null;
|
|
148
|
+
execution: InstanceExecution | null;
|
|
149
|
+
webAccess?: InstanceWebAccess | null;
|
|
150
|
+
webAccessUrl?: string | null;
|
|
151
|
+
hostIpv4?: string | null;
|
|
152
|
+
ipv6?: string | null;
|
|
153
|
+
proxyUrl?: string | null;
|
|
154
|
+
mappedPorts?: Record<string, PortMapping>;
|
|
155
|
+
diagnostics?: RuntimeDiagnostics | null;
|
|
156
|
+
sshCommand?: string | null;
|
|
157
|
+
selectedCrn?: CrnRecord | null;
|
|
158
|
+
executionLookupBlocked?: boolean;
|
|
159
|
+
error?: string | null;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
interface DeploymentResult {
|
|
163
|
+
itemHash: string;
|
|
164
|
+
httpStatus?: number;
|
|
165
|
+
status: 'processed' | 'pending' | 'rejected' | 'unknown';
|
|
166
|
+
message?: AlephBroadcastMessage;
|
|
167
|
+
response?: AlephBroadcastResponse;
|
|
168
|
+
rejectionReason?: string | null;
|
|
169
|
+
}
|
|
170
|
+
type AlephSenderChain = 'ETH';
|
|
171
|
+
type AlephMessageType = 'INSTANCE' | 'FORGET' | 'AGGREGATE';
|
|
172
|
+
interface AlephBroadcastMessage {
|
|
173
|
+
sender: string;
|
|
174
|
+
chain: AlephSenderChain;
|
|
175
|
+
signature: string;
|
|
176
|
+
type: AlephMessageType;
|
|
177
|
+
item_hash: string;
|
|
178
|
+
item_type: 'inline';
|
|
179
|
+
item_content: string;
|
|
180
|
+
time: number;
|
|
181
|
+
channel: string;
|
|
182
|
+
}
|
|
183
|
+
interface AlephBroadcastResponse {
|
|
184
|
+
publication_status?: {
|
|
185
|
+
status: string;
|
|
186
|
+
failed?: unknown[];
|
|
187
|
+
};
|
|
188
|
+
message_status?: 'processed' | 'pending' | 'rejected' | 'unknown';
|
|
189
|
+
details?: unknown;
|
|
190
|
+
[key: string]: unknown;
|
|
191
|
+
}
|
|
192
|
+
interface AlephAggregateContent<T = Record<string, unknown>> {
|
|
193
|
+
address: string;
|
|
194
|
+
key: string;
|
|
195
|
+
content: T;
|
|
196
|
+
time: number;
|
|
197
|
+
}
|
|
198
|
+
interface AlephInstanceContent {
|
|
199
|
+
address: string;
|
|
200
|
+
time: number;
|
|
201
|
+
allow_amend: boolean;
|
|
202
|
+
metadata?: {
|
|
203
|
+
name: string;
|
|
204
|
+
[key: string]: string | number | boolean;
|
|
205
|
+
};
|
|
206
|
+
authorized_keys?: string[];
|
|
207
|
+
environment: {
|
|
208
|
+
internet: boolean;
|
|
209
|
+
aleph_api: boolean;
|
|
210
|
+
reproducible?: boolean;
|
|
211
|
+
shared_cache?: boolean;
|
|
212
|
+
hypervisor: 'qemu';
|
|
213
|
+
trusted_execution?: Record<string, unknown>;
|
|
214
|
+
};
|
|
215
|
+
resources: {
|
|
216
|
+
vcpus: number;
|
|
217
|
+
memory: number;
|
|
218
|
+
seconds: number;
|
|
219
|
+
};
|
|
220
|
+
payment: {
|
|
221
|
+
chain?: string;
|
|
222
|
+
receiver?: string;
|
|
223
|
+
type: string;
|
|
224
|
+
};
|
|
225
|
+
requirements?: {
|
|
226
|
+
node?: {
|
|
227
|
+
node_hash: string;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
volumes: unknown[];
|
|
231
|
+
rootfs: {
|
|
232
|
+
parent: {
|
|
233
|
+
ref: string;
|
|
234
|
+
use_latest?: boolean;
|
|
235
|
+
};
|
|
236
|
+
persistence: 'host' | 'store';
|
|
237
|
+
size_mib: number;
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
interface MessageInspectionResult {
|
|
241
|
+
status: 'processed' | 'pending' | 'rejected' | 'unknown';
|
|
242
|
+
errorCode: number | null;
|
|
243
|
+
details: Record<string, unknown> | null;
|
|
244
|
+
rejectionReason: string | null;
|
|
245
|
+
}
|
|
246
|
+
interface DeploymentInspectionResult extends MessageInspectionResult {
|
|
247
|
+
references: MessageReference[];
|
|
248
|
+
}
|
|
249
|
+
type MessageSigner = (sender: string, payload: string) => Promise<string>;
|
|
250
|
+
type MessageHasher = (payload: string) => Promise<string> | string;
|
|
251
|
+
|
|
252
|
+
export type { AlephAggregateContent, AlephBroadcastMessage, AlephBroadcastResponse, AlephInstanceContent, AlephMessageType, AlephSenderChain, CrnRecord, CrnSystemUsage, DeploymentInspectionResult, DeploymentResult, GatewayProbeStatus, InstanceAllocation, InstanceAllocationNode, InstanceAllocationPeriod, InstanceExecution, InstanceExecutionNetworking, InstanceExecutionStatus, InstanceRuntimeDetails, InstanceWebAccess, MessageHasher, MessageInspectionResult, MessageReference, MessageSigner, MessageStatus, PortForwardAggregate, PortForwardAggregateEntry, PortForwardFlags, PortMapping, ReferenceStatus, RootfsInstallStrategy, RootfsManifest, RootfsManifestState, RootfsRequiredPortForward, RootfsResolution, RuntimeDiagnostics, RuntimeMetadata };
|
package/index.js
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@le-space/shared-types",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared type contracts for the shared Aleph tooling monorepo.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./index.js",
|
|
8
|
+
"types": "./index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./index.d.ts",
|
|
12
|
+
"import": "./index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
}
|
|
18
|
+
}
|