@ariestools/datalake-cli 0.0.0-stage → 0.3.1
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/LICENSE +4 -0
- package/README.md +40 -2
- package/dist/node/actions/datalake/login.d.ts +30 -0
- package/dist/node/actions/datalake/login.d.ts.map +1 -0
- package/dist/node/bin/daemons/datalake-dev.mjs +141540 -0
- package/dist/node/bin/datalake.d.ts +3 -0
- package/dist/node/bin/datalake.d.ts.map +1 -0
- package/dist/node/bin/datalake.mjs +232306 -0
- package/dist/node/commands/datalakeAuditCommand.d.ts +3 -0
- package/dist/node/commands/datalakeAuditCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeBlobCheckCommand.d.ts +3 -0
- package/dist/node/commands/datalakeBlobCheckCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeBlobClearCommand.d.ts +3 -0
- package/dist/node/commands/datalakeBlobClearCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeBlobCommand.d.ts +7 -0
- package/dist/node/commands/datalakeBlobCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeBlobCreateCommand.d.ts +3 -0
- package/dist/node/commands/datalakeBlobCreateCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeBlobFetchCommand.d.ts +3 -0
- package/dist/node/commands/datalakeBlobFetchCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeBlobListCommand.d.ts +3 -0
- package/dist/node/commands/datalakeBlobListCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeBlobOptions.d.ts +23 -0
- package/dist/node/commands/datalakeBlobOptions.d.ts.map +1 -0
- package/dist/node/commands/datalakeBlobPushCommand.d.ts +3 -0
- package/dist/node/commands/datalakeBlobPushCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeBlobRmCommand.d.ts +3 -0
- package/dist/node/commands/datalakeBlobRmCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeBlobStatCommand.d.ts +3 -0
- package/dist/node/commands/datalakeBlobStatCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeBlobTokenCommand.d.ts +3 -0
- package/dist/node/commands/datalakeBlobTokenCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeBlobUsageCommand.d.ts +3 -0
- package/dist/node/commands/datalakeBlobUsageCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeCommand.d.ts +15 -0
- package/dist/node/commands/datalakeCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeCreateCommand.d.ts +3 -0
- package/dist/node/commands/datalakeCreateCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeDescribeCommand.d.ts +3 -0
- package/dist/node/commands/datalakeDescribeCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeDestroyCommand.d.ts +3 -0
- package/dist/node/commands/datalakeDestroyCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeDevBootstrapCommand.d.ts +3 -0
- package/dist/node/commands/datalakeDevBootstrapCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeDevCommand.d.ts +8 -0
- package/dist/node/commands/datalakeDevCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeDevDownCommand.d.ts +3 -0
- package/dist/node/commands/datalakeDevDownCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeDevLogsCommand.d.ts +3 -0
- package/dist/node/commands/datalakeDevLogsCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeDevResetCommand.d.ts +3 -0
- package/dist/node/commands/datalakeDevResetCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeDevStatusCommand.d.ts +3 -0
- package/dist/node/commands/datalakeDevStatusCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeDevUpBlobsCommand.d.ts +7 -0
- package/dist/node/commands/datalakeDevUpBlobsCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeDevUpCommand.d.ts +19 -0
- package/dist/node/commands/datalakeDevUpCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeFetchCommand.d.ts +3 -0
- package/dist/node/commands/datalakeFetchCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeGrantCommand.d.ts +3 -0
- package/dist/node/commands/datalakeGrantCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeListCommand.d.ts +3 -0
- package/dist/node/commands/datalakeListCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeLoginCommand.d.ts +23 -0
- package/dist/node/commands/datalakeLoginCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeLoginInternalCommand.d.ts +28 -0
- package/dist/node/commands/datalakeLoginInternalCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeLogoutCommand.d.ts +3 -0
- package/dist/node/commands/datalakeLogoutCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakePushCommand.d.ts +3 -0
- package/dist/node/commands/datalakePushCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeRevokeCommand.d.ts +3 -0
- package/dist/node/commands/datalakeRevokeCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeTailCommand.d.ts +3 -0
- package/dist/node/commands/datalakeTailCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeTokenCommand.d.ts +3 -0
- package/dist/node/commands/datalakeTokenCommand.d.ts.map +1 -0
- package/dist/node/commands/datalakeUseCommand.d.ts +3 -0
- package/dist/node/commands/datalakeUseCommand.d.ts.map +1 -0
- package/dist/node/index.d.ts +346 -0
- package/dist/node/index.mjs +202 -0
- package/dist/node/index.mjs.map +7 -0
- package/dist/node/internal.d.ts +10 -0
- package/dist/node/internal.d.ts.map +1 -0
- package/dist/node/retainedDatalake.d.ts +17 -0
- package/dist/node/retainedDatalake.d.ts.map +1 -0
- package/dist/node/retainedDatalakeChild.d.ts +13 -0
- package/dist/node/retainedDatalakeChild.d.ts.map +1 -0
- package/dist/node/retainedDatalakeWorker.d.ts +2 -0
- package/dist/node/retainedDatalakeWorker.d.ts.map +1 -0
- package/dist/node/retainedDatalakeWorker.mjs +174819 -0
- package/dist/node/runDatalakeProcess.d.ts +4 -0
- package/dist/node/runDatalakeProcess.d.ts.map +1 -0
- package/package.json +88 -3
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
/** Programmatic datalake client API of @ariestools/datalake-cli, self-contained: it names no other package's types. */
|
|
2
|
+
|
|
3
|
+
export interface AuthTokenRequest {
|
|
4
|
+
audience: string
|
|
5
|
+
}
|
|
6
|
+
export type AuthTokenSupplier = (request: AuthTokenRequest) => Promise<string>
|
|
7
|
+
export type AuthTokenSource = string | AuthTokenSupplier
|
|
8
|
+
export type PayloadsAuthTokenSource = AuthTokenSource
|
|
9
|
+
|
|
10
|
+
export type DatalakeRole = 'viewer' | 'runner'
|
|
11
|
+
export type DatalakePrincipal = string
|
|
12
|
+
export type DatalakeTier = 'small' | 'medium' | 'large' | 'archive'
|
|
13
|
+
export type DatalakeRegion = 'us-west-2' | 'us-east-1' | 'eu-west-1'
|
|
14
|
+
export type DatalakeStatus =
|
|
15
|
+
| 'pending'
|
|
16
|
+
| 'provisioning'
|
|
17
|
+
| 'ready'
|
|
18
|
+
| 'resizing'
|
|
19
|
+
| 'deprovisioning'
|
|
20
|
+
| 'deleted'
|
|
21
|
+
| 'error'
|
|
22
|
+
|
|
23
|
+
export interface RateLimitOverrides {
|
|
24
|
+
anonymousPerMinute?: number
|
|
25
|
+
authenticatedPerMinute?: number
|
|
26
|
+
burstFactor?: number
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface DatalakeConfig {
|
|
30
|
+
allowedSchemas?: string[]
|
|
31
|
+
disallowedSchemas?: string[]
|
|
32
|
+
iops?: number
|
|
33
|
+
rateLimits?: RateLimitOverrides
|
|
34
|
+
region?: DatalakeRegion
|
|
35
|
+
retentionDays?: number | null
|
|
36
|
+
sizeBytes?: number
|
|
37
|
+
tier: DatalakeTier
|
|
38
|
+
/** @deprecated No-op; archivist recomputes hashes trustlessly. */
|
|
39
|
+
verifyHashes?: boolean
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface AclEntry {
|
|
43
|
+
grantedAt: string
|
|
44
|
+
grantedBy?: string
|
|
45
|
+
principal: DatalakePrincipal
|
|
46
|
+
role: DatalakeRole
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface DatalakeUsage {
|
|
50
|
+
bytesStored: number
|
|
51
|
+
bytesStoredLimit: number
|
|
52
|
+
payloadCount: number
|
|
53
|
+
readsLast24h: number
|
|
54
|
+
writesLast24h: number
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface DatalakeDescriptor {
|
|
58
|
+
acl: AclEntry[]
|
|
59
|
+
config: DatalakeConfig
|
|
60
|
+
createdAt: string
|
|
61
|
+
errorMessage?: string
|
|
62
|
+
id: string
|
|
63
|
+
name: string
|
|
64
|
+
ownerId: string
|
|
65
|
+
status: DatalakeStatus
|
|
66
|
+
updatedAt: string
|
|
67
|
+
url?: string
|
|
68
|
+
usage?: DatalakeUsage
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface DatalakeToken {
|
|
72
|
+
datalakeId: string
|
|
73
|
+
expiresAt: string
|
|
74
|
+
role: DatalakeRole
|
|
75
|
+
token: string
|
|
76
|
+
url: string
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface CreateDatalakeRequest {
|
|
80
|
+
config: DatalakeConfig
|
|
81
|
+
name: string
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface GrantRequest {
|
|
85
|
+
datalakeId: string
|
|
86
|
+
principal: DatalakePrincipal
|
|
87
|
+
role: DatalakeRole
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface RevokeRequest {
|
|
91
|
+
datalakeId: string
|
|
92
|
+
principal: DatalakePrincipal
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface TokenRequest {
|
|
96
|
+
datalakeId: string
|
|
97
|
+
role: DatalakeRole
|
|
98
|
+
ttlSeconds?: number
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface WalletJwtCredentials {
|
|
102
|
+
controlAudience?: string
|
|
103
|
+
offset?: string
|
|
104
|
+
ttlSeconds?: number
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface StoredCredentials {
|
|
108
|
+
authToken?: string
|
|
109
|
+
baseUrl: string
|
|
110
|
+
expiresAt?: string
|
|
111
|
+
refreshToken?: string
|
|
112
|
+
userId?: string
|
|
113
|
+
walletJwt?: WalletJwtCredentials
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface CreateDatalakeClientOptions {
|
|
117
|
+
authToken?: AuthTokenSource
|
|
118
|
+
baseUrl?: string
|
|
119
|
+
driver?: 'local' | 'rest'
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface RestDatalakeClientOptions {
|
|
123
|
+
authToken: AuthTokenSource
|
|
124
|
+
audience?: string
|
|
125
|
+
baseUrl: string
|
|
126
|
+
fetchImpl?: typeof fetch
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface RestPayloadsClientOptions {
|
|
130
|
+
authToken: PayloadsAuthTokenSource
|
|
131
|
+
baseUrl: string
|
|
132
|
+
datalakeId: string
|
|
133
|
+
fetchImpl?: typeof fetch
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface DatalakeInsertSummary {
|
|
137
|
+
duplicates: number
|
|
138
|
+
rejected: string[]
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Result of PayloadsClient.insert — matches RestPayloadsClient runtime. */
|
|
142
|
+
export interface InsertPayloadsResult {
|
|
143
|
+
inserted: unknown[]
|
|
144
|
+
summary: DatalakeInsertSummary
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export interface NextPayloadsResult {
|
|
148
|
+
nextCursor?: string
|
|
149
|
+
payloads: unknown[]
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface DatalakeUsageReport {
|
|
153
|
+
datalakeId: string
|
|
154
|
+
payloadCount: number
|
|
155
|
+
rateLimits?: {
|
|
156
|
+
anonymous?: { limit: number; remaining: number }
|
|
157
|
+
authenticated?: { limit: number; remaining: number }
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export type DatalakeDevServerStatus =
|
|
162
|
+
| 'healthy'
|
|
163
|
+
| 'degraded'
|
|
164
|
+
| 'unresponsive'
|
|
165
|
+
| 'stale'
|
|
166
|
+
| 'stopped'
|
|
167
|
+
|
|
168
|
+
export type DatalakeDevServerExitCode = 0 | 2 | 3
|
|
169
|
+
|
|
170
|
+
export interface DatalakeDevServerEndpointReport {
|
|
171
|
+
healthy: boolean
|
|
172
|
+
url: string
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export interface DatalakeDevServerReport {
|
|
176
|
+
schemaVersion: 1
|
|
177
|
+
status: DatalakeDevServerStatus
|
|
178
|
+
exitCode: DatalakeDevServerExitCode
|
|
179
|
+
process: {
|
|
180
|
+
running: boolean
|
|
181
|
+
pid: number | null
|
|
182
|
+
startedAt: string | null
|
|
183
|
+
}
|
|
184
|
+
endpoints: {
|
|
185
|
+
control: DatalakeDevServerEndpointReport | null
|
|
186
|
+
plane: DatalakeDevServerEndpointReport | null
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export interface InspectDatalakeDevServerOptions {
|
|
191
|
+
timeoutMs?: number
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface PayloadsClient {
|
|
195
|
+
clear(): Promise<{ removed: number }>
|
|
196
|
+
delete(hash: string): Promise<void>
|
|
197
|
+
get(hash: string): Promise<unknown>
|
|
198
|
+
getMany(hashes: string[]): Promise<unknown[]>
|
|
199
|
+
insert(payloads: unknown[]): Promise<InsertPayloadsResult>
|
|
200
|
+
next(options?: {
|
|
201
|
+
cursor?: string
|
|
202
|
+
limit?: number
|
|
203
|
+
order?: 'asc' | 'desc'
|
|
204
|
+
schemas?: string[]
|
|
205
|
+
}): Promise<NextPayloadsResult>
|
|
206
|
+
usage(): Promise<DatalakeUsageReport>
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export interface DatalakeClient {
|
|
210
|
+
create(request: CreateDatalakeRequest): Promise<DatalakeDescriptor>
|
|
211
|
+
describe(idOrName: string): Promise<DatalakeDescriptor>
|
|
212
|
+
destroy(idOrName: string): Promise<void>
|
|
213
|
+
grant(request: GrantRequest): Promise<DatalakeDescriptor>
|
|
214
|
+
list(): Promise<DatalakeDescriptor[]>
|
|
215
|
+
mintToken(request: TokenRequest): Promise<DatalakeToken>
|
|
216
|
+
revoke(request: RevokeRequest): Promise<DatalakeDescriptor>
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export declare function createDatalakeClient(options?: CreateDatalakeClientOptions): DatalakeClient
|
|
220
|
+
export declare function inspectDatalakeDevServer(
|
|
221
|
+
options?: InspectDatalakeDevServerOptions,
|
|
222
|
+
): Promise<DatalakeDevServerReport>
|
|
223
|
+
export declare class LocalDatalakeClient implements DatalakeClient {
|
|
224
|
+
create(request: CreateDatalakeRequest): Promise<DatalakeDescriptor>
|
|
225
|
+
describe(idOrName: string): Promise<DatalakeDescriptor>
|
|
226
|
+
destroy(idOrName: string): Promise<void>
|
|
227
|
+
grant(request: GrantRequest): Promise<DatalakeDescriptor>
|
|
228
|
+
list(): Promise<DatalakeDescriptor[]>
|
|
229
|
+
mintToken(request: TokenRequest): Promise<DatalakeToken>
|
|
230
|
+
revoke(request: RevokeRequest): Promise<DatalakeDescriptor>
|
|
231
|
+
}
|
|
232
|
+
export declare class RestDatalakeClient implements DatalakeClient {
|
|
233
|
+
constructor(options: RestDatalakeClientOptions)
|
|
234
|
+
create(request: CreateDatalakeRequest): Promise<DatalakeDescriptor>
|
|
235
|
+
describe(idOrName: string): Promise<DatalakeDescriptor>
|
|
236
|
+
destroy(idOrName: string): Promise<void>
|
|
237
|
+
grant(request: GrantRequest): Promise<DatalakeDescriptor>
|
|
238
|
+
list(): Promise<DatalakeDescriptor[]>
|
|
239
|
+
mintToken(request: TokenRequest): Promise<DatalakeToken>
|
|
240
|
+
revoke(request: RevokeRequest): Promise<DatalakeDescriptor>
|
|
241
|
+
}
|
|
242
|
+
export declare class RestPayloadsClient implements PayloadsClient {
|
|
243
|
+
constructor(options: RestPayloadsClientOptions)
|
|
244
|
+
clear(): Promise<{ removed: number }>
|
|
245
|
+
delete(hash: string): Promise<void>
|
|
246
|
+
get(hash: string): Promise<unknown>
|
|
247
|
+
getMany(hashes: string[]): Promise<unknown[]>
|
|
248
|
+
insert(payloads: unknown[]): Promise<InsertPayloadsResult>
|
|
249
|
+
next(options?: {
|
|
250
|
+
cursor?: string
|
|
251
|
+
limit?: number
|
|
252
|
+
order?: 'asc' | 'desc'
|
|
253
|
+
schemas?: string[]
|
|
254
|
+
}): Promise<NextPayloadsResult>
|
|
255
|
+
usage(): Promise<DatalakeUsageReport>
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export declare function loadCredentials(): StoredCredentials | undefined
|
|
259
|
+
export declare function saveCredentials(credentials: StoredCredentials): void
|
|
260
|
+
export declare function clearCredentials(): void
|
|
261
|
+
export declare function getCredentialsLocation(): string
|
|
262
|
+
export declare function getDefaultDatalake(): string | undefined
|
|
263
|
+
export declare function setDefaultDatalake(name: string, id?: string): void
|
|
264
|
+
export declare function clearDefaultDatalake(): void
|
|
265
|
+
export type JsonPrimitive = boolean | null | number | string
|
|
266
|
+
export type JsonValue = JsonPrimitive | JsonObject | JsonValue[]
|
|
267
|
+
export interface JsonObject { [key: string]: JsonValue }
|
|
268
|
+
export interface Payload { schema: string; $sources?: string[]; [key: string]: JsonValue | undefined }
|
|
269
|
+
|
|
270
|
+
export interface ExactRootArchiveLimits {
|
|
271
|
+
readonly maxConcurrentOperations: number
|
|
272
|
+
readonly maxOperationMilliseconds: number
|
|
273
|
+
readonly maxRequestBytes: number
|
|
274
|
+
readonly maxResponseBytes: number
|
|
275
|
+
readonly maxRoots: number
|
|
276
|
+
readonly maxTokenBytes: number
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export interface ExactRootArchiveTokenRequest {
|
|
280
|
+
readonly audience: string
|
|
281
|
+
readonly scope: 'payload:append'
|
|
282
|
+
readonly signal: AbortSignal
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
export interface ExactRootArchiveOptions {
|
|
286
|
+
/** Absolute, credential-free configured plane URL. */
|
|
287
|
+
readonly baseUrl: string
|
|
288
|
+
readonly datalakeId: string
|
|
289
|
+
/** Trusted transport preserving signal, no redirects and credential policy. */
|
|
290
|
+
readonly fetchImpl?: typeof fetch
|
|
291
|
+
/** Explicit domain of the native SDK identity callback, not a JSON digest. */
|
|
292
|
+
readonly hashDomain: string
|
|
293
|
+
/** Trusted owning SDK algorithm; preserve client metadata and ignore only SDK storage metadata. */
|
|
294
|
+
readonly identify: (this: void, payload: Payload) => Promise<string>
|
|
295
|
+
readonly limits: ExactRootArchiveLimits
|
|
296
|
+
/** Trusted private issuer adapter, invoked only for append on this lake. */
|
|
297
|
+
readonly tokenSupplier: (this: void, request: ExactRootArchiveTokenRequest) => Promise<string>
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface ExactRootArchiveBody {
|
|
301
|
+
readonly hashDomain: string
|
|
302
|
+
readonly payload: Payload
|
|
303
|
+
readonly root: string
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export interface ExactRootArchiveRoot {
|
|
307
|
+
readonly hashDomain: string
|
|
308
|
+
readonly root: string
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export interface ExactRootArchiveCallOptions {
|
|
312
|
+
readonly signal?: AbortSignal
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export type ExactRootArchiveErrorCode = 'invalid-request' | 'unsupported-domain' | 'capacity' | 'cancelled'
|
|
316
|
+
| 'deadline' | 'token' | 'transport' | 'resource' | 'private' | 'missing' | 'altered' | 'invalid-response'
|
|
317
|
+
export type ExactRootArchiveWriteState = 'not-started' | 'uncertain' | 'acknowledged'
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
export declare class ExactRootArchiveError extends Error {
|
|
321
|
+
readonly code: ExactRootArchiveErrorCode
|
|
322
|
+
readonly writeState: ExactRootArchiveWriteState
|
|
323
|
+
constructor(code: ExactRootArchiveErrorCode, writeState?: ExactRootArchiveWriteState)
|
|
324
|
+
}
|
|
325
|
+
export declare class ExactRootArchive {
|
|
326
|
+
readonly hashDomain: string
|
|
327
|
+
readonly limits: ExactRootArchiveLimits
|
|
328
|
+
constructor(options: ExactRootArchiveOptions)
|
|
329
|
+
get outstandingOperations(): number
|
|
330
|
+
read(roots: readonly ExactRootArchiveRoot[], options?: ExactRootArchiveCallOptions): Promise<ExactRootArchiveBody[]>
|
|
331
|
+
write(bodies: readonly ExactRootArchiveBody[], options?: ExactRootArchiveCallOptions): Promise<ExactRootArchiveBody[]>
|
|
332
|
+
}
|
|
333
|
+
export interface RetainedDatalakeOptions {
|
|
334
|
+
readonly descriptor?: DatalakeDescriptor
|
|
335
|
+
readonly directory: string
|
|
336
|
+
readonly initialPayloads?: readonly Payload[]
|
|
337
|
+
readonly readinessTimeoutMilliseconds?: number
|
|
338
|
+
readonly stopTimeoutMilliseconds?: number
|
|
339
|
+
}
|
|
340
|
+
export interface RetainedDatalake {
|
|
341
|
+
readonly url: string
|
|
342
|
+
restart(): Promise<void>
|
|
343
|
+
stop(): Promise<void>
|
|
344
|
+
}
|
|
345
|
+
export declare function startRetainedDatalake(options: RetainedDatalakeOptions): Promise<RetainedDatalake>
|
|
346
|
+
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// src/retainedDatalake.ts
|
|
2
|
+
import { fork } from "node:child_process";
|
|
3
|
+
import PATH from "node:path";
|
|
4
|
+
|
|
5
|
+
// src/retainedDatalakeChild.ts
|
|
6
|
+
function fixtureDeadline(value, fallback) {
|
|
7
|
+
const milliseconds = value ?? fallback;
|
|
8
|
+
if (!Number.isSafeInteger(milliseconds) || milliseconds < 1 || milliseconds > 6e4) {
|
|
9
|
+
throw new Error("Local fixture deadline must be a positive integer at most 60000 milliseconds");
|
|
10
|
+
}
|
|
11
|
+
return milliseconds;
|
|
12
|
+
}
|
|
13
|
+
function fixtureEnvironment() {
|
|
14
|
+
const environment = {};
|
|
15
|
+
for (const name of ["PATH", "TMPDIR", "TMP", "TEMP", "NODE_OPTIONS", "NODE_ENV", "NO_COLOR", "FORCE_COLOR", "TZ"]) {
|
|
16
|
+
const value = process.env[name];
|
|
17
|
+
if (value !== void 0) environment[name] = value;
|
|
18
|
+
}
|
|
19
|
+
return environment;
|
|
20
|
+
}
|
|
21
|
+
function ownChild(child) {
|
|
22
|
+
let ended = false;
|
|
23
|
+
const closed = new Promise((resolve) => {
|
|
24
|
+
child.once("close", () => {
|
|
25
|
+
ended = true;
|
|
26
|
+
resolve();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
child.stderr?.on("data", () => {
|
|
30
|
+
});
|
|
31
|
+
child.on("error", () => {
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
child,
|
|
35
|
+
closed,
|
|
36
|
+
hasClosed: () => ended
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async function waitClosed(owned, milliseconds) {
|
|
40
|
+
if (owned.hasClosed()) return true;
|
|
41
|
+
let timer;
|
|
42
|
+
try {
|
|
43
|
+
return await Promise.race([
|
|
44
|
+
(async () => {
|
|
45
|
+
await owned.closed;
|
|
46
|
+
return true;
|
|
47
|
+
})(),
|
|
48
|
+
new Promise((resolve) => {
|
|
49
|
+
timer = setTimeout(() => resolve(false), milliseconds);
|
|
50
|
+
})
|
|
51
|
+
]);
|
|
52
|
+
} finally {
|
|
53
|
+
clearTimeout(timer);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async function stopChild(owned, milliseconds) {
|
|
57
|
+
if (owned.hasClosed()) return;
|
|
58
|
+
owned.child.kill("SIGTERM");
|
|
59
|
+
if (await waitClosed(owned, milliseconds)) return;
|
|
60
|
+
owned.child.kill("SIGKILL");
|
|
61
|
+
if (!await waitClosed(owned, milliseconds)) throw new Error("Local fixture child settlement remains unknown");
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// src/retainedDatalake.ts
|
|
65
|
+
function readyOrigin(input) {
|
|
66
|
+
if (input === null || typeof input !== "object") throw new Error("Invalid retained datalake response");
|
|
67
|
+
const response = input;
|
|
68
|
+
if (response.kind !== "ready" || typeof response.url !== "string" || response.node !== process.version) {
|
|
69
|
+
throw new Error("Retained datalake failed before readiness");
|
|
70
|
+
}
|
|
71
|
+
const url = new URL(response.url);
|
|
72
|
+
if (url.hostname !== "127.0.0.1" || url.protocol !== "http:" || url.username !== "" || url.password !== "") {
|
|
73
|
+
throw new Error("Retained datalake returned a nonlocal endpoint");
|
|
74
|
+
}
|
|
75
|
+
return url.origin;
|
|
76
|
+
}
|
|
77
|
+
function readiness(owned, timeout) {
|
|
78
|
+
return new Promise((resolve, reject) => {
|
|
79
|
+
const timer = setTimeout(() => {
|
|
80
|
+
clean();
|
|
81
|
+
reject(new Error("Retained datalake readiness deadline exceeded"));
|
|
82
|
+
}, timeout);
|
|
83
|
+
const clean = () => {
|
|
84
|
+
clearTimeout(timer);
|
|
85
|
+
owned.child.off("message", message);
|
|
86
|
+
};
|
|
87
|
+
const message = (input) => {
|
|
88
|
+
clean();
|
|
89
|
+
try {
|
|
90
|
+
resolve(readyOrigin(input));
|
|
91
|
+
} catch (error) {
|
|
92
|
+
reject(error instanceof Error ? error : new Error("Invalid retained datalake response"));
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
owned.child.once("message", message);
|
|
96
|
+
void (async () => {
|
|
97
|
+
await owned.closed;
|
|
98
|
+
clean();
|
|
99
|
+
reject(new Error("Retained datalake child exited before readiness"));
|
|
100
|
+
})();
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
async function start(options, port, initialize) {
|
|
104
|
+
if (!PATH.isAbsolute(options.directory)) throw new Error("Retained archive directory must be absolute");
|
|
105
|
+
const worker = new URL(import.meta.url.endsWith(".ts") ? "./retainedDatalakeWorker.ts" : "./retainedDatalakeWorker.mjs", import.meta.url);
|
|
106
|
+
const owned = ownChild(fork(worker, [], {
|
|
107
|
+
env: fixtureEnvironment(),
|
|
108
|
+
execPath: process.execPath,
|
|
109
|
+
stdio: ["ignore", "ignore", "pipe", "ipc"]
|
|
110
|
+
}));
|
|
111
|
+
try {
|
|
112
|
+
const ready = readiness(owned, options.readinessTimeoutMilliseconds ?? 3e4);
|
|
113
|
+
owned.child.send({
|
|
114
|
+
kind: "start",
|
|
115
|
+
directory: options.directory,
|
|
116
|
+
port,
|
|
117
|
+
descriptor: options.descriptor,
|
|
118
|
+
initialize,
|
|
119
|
+
initialPayloads: initialize ? options.initialPayloads : void 0
|
|
120
|
+
});
|
|
121
|
+
return { owned, url: await ready };
|
|
122
|
+
} catch (error) {
|
|
123
|
+
await stopChild(owned, options.stopTimeoutMilliseconds ?? 1e4);
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
async function startRetainedDatalake(options) {
|
|
128
|
+
const fixed = Object.freeze({
|
|
129
|
+
initialPayloads: options.initialPayloads === void 0 ? void 0 : structuredClone(options.initialPayloads),
|
|
130
|
+
directory: options.directory,
|
|
131
|
+
descriptor: options.descriptor === void 0 ? void 0 : structuredClone(options.descriptor),
|
|
132
|
+
readinessTimeoutMilliseconds: fixtureDeadline(options.readinessTimeoutMilliseconds, 3e4),
|
|
133
|
+
stopTimeoutMilliseconds: fixtureDeadline(options.stopTimeoutMilliseconds, 1e4)
|
|
134
|
+
});
|
|
135
|
+
let current = await start(fixed, 0, true);
|
|
136
|
+
const url = current.url;
|
|
137
|
+
const endpoint = new URL(url);
|
|
138
|
+
const port = Number(endpoint.port);
|
|
139
|
+
let operation = Promise.resolve();
|
|
140
|
+
const serialize = (action) => {
|
|
141
|
+
const previous = operation;
|
|
142
|
+
const next = (async () => {
|
|
143
|
+
await previous;
|
|
144
|
+
await action();
|
|
145
|
+
})();
|
|
146
|
+
operation = (async () => {
|
|
147
|
+
try {
|
|
148
|
+
await next;
|
|
149
|
+
} catch {
|
|
150
|
+
}
|
|
151
|
+
})();
|
|
152
|
+
return next;
|
|
153
|
+
};
|
|
154
|
+
const stopCurrent = async () => {
|
|
155
|
+
if (current !== void 0) await stopChild(current.owned, fixed.stopTimeoutMilliseconds ?? 1e4);
|
|
156
|
+
current = void 0;
|
|
157
|
+
};
|
|
158
|
+
return {
|
|
159
|
+
url,
|
|
160
|
+
stop: () => serialize(stopCurrent),
|
|
161
|
+
restart: () => serialize(async () => {
|
|
162
|
+
await stopCurrent();
|
|
163
|
+
current = await start(fixed, port, false);
|
|
164
|
+
if (current.url !== url) throw new Error("Retained datalake restart changed its explicit endpoint");
|
|
165
|
+
})
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// src/index.ts
|
|
170
|
+
import {
|
|
171
|
+
clearCredentials,
|
|
172
|
+
clearDefaultDatalake,
|
|
173
|
+
createDatalakeClient,
|
|
174
|
+
getCredentialsLocation,
|
|
175
|
+
getDefaultDatalake,
|
|
176
|
+
loadCredentials,
|
|
177
|
+
LocalDatalakeClient,
|
|
178
|
+
RestDatalakeClient,
|
|
179
|
+
RestPayloadsClient,
|
|
180
|
+
saveCredentials,
|
|
181
|
+
setDefaultDatalake
|
|
182
|
+
} from "@ariestools/aries-datalake-client";
|
|
183
|
+
import { ExactRootArchive, ExactRootArchiveError } from "@ariestools/aries-datalake-client";
|
|
184
|
+
import { inspectDatalakeDevServer } from "@ariestools/aries-datalake-client/dev";
|
|
185
|
+
export {
|
|
186
|
+
ExactRootArchive,
|
|
187
|
+
ExactRootArchiveError,
|
|
188
|
+
LocalDatalakeClient,
|
|
189
|
+
RestDatalakeClient,
|
|
190
|
+
RestPayloadsClient,
|
|
191
|
+
clearCredentials,
|
|
192
|
+
clearDefaultDatalake,
|
|
193
|
+
createDatalakeClient,
|
|
194
|
+
getCredentialsLocation,
|
|
195
|
+
getDefaultDatalake,
|
|
196
|
+
inspectDatalakeDevServer,
|
|
197
|
+
loadCredentials,
|
|
198
|
+
saveCredentials,
|
|
199
|
+
setDefaultDatalake,
|
|
200
|
+
startRetainedDatalake
|
|
201
|
+
};
|
|
202
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/retainedDatalake.ts", "../../src/retainedDatalakeChild.ts", "../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { fork } from 'node:child_process'\nimport PATH from 'node:path'\n\nimport type { DatalakeDescriptor, Payload } from '@ariestools/aries-datalake-core'\n\nimport type { OwnedChild } from './retainedDatalakeChild.ts'\nimport {\n fixtureDeadline, fixtureEnvironment, ownChild, stopChild,\n} from './retainedDatalakeChild.ts'\n\nexport interface RetainedDatalakeOptions {\n readonly descriptor?: DatalakeDescriptor\n readonly directory: string\n /** Public fixture bodies, inserted only into a newly created descriptor. */\n readonly initialPayloads?: readonly Payload[]\n readonly readinessTimeoutMilliseconds?: number\n readonly stopTimeoutMilliseconds?: number\n}\n\nexport interface RetainedDatalake {\n readonly url: string\n restart(): Promise<void>\n stop(): Promise<void>\n}\n\ninterface RunningArchive {\n readonly owned: OwnedChild\n readonly url: string\n}\n\nfunction readyOrigin(input: unknown): string {\n if (input === null || typeof input !== 'object') throw new Error('Invalid retained datalake response')\n const response = input as { kind?: unknown; node?: unknown; url?: unknown }\n if (response.kind !== 'ready' || typeof response.url !== 'string' || response.node !== process.version) {\n throw new Error('Retained datalake failed before readiness')\n }\n const url = new URL(response.url)\n if (url.hostname !== '127.0.0.1' || url.protocol !== 'http:' || url.username !== '' || url.password !== '') {\n throw new Error('Retained datalake returned a nonlocal endpoint')\n }\n return url.origin\n}\n\nfunction readiness(owned: OwnedChild, timeout: number): Promise<string> {\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n clean()\n reject(new Error('Retained datalake readiness deadline exceeded'))\n }, timeout)\n const clean = (): void => {\n clearTimeout(timer)\n owned.child.off('message', message)\n }\n const message = (input: unknown): void => {\n clean()\n try {\n resolve(readyOrigin(input))\n } catch (error) {\n reject(error instanceof Error ? error : new Error('Invalid retained datalake response'))\n }\n }\n owned.child.once('message', message)\n void (async () => {\n await owned.closed\n clean()\n reject(new Error('Retained datalake child exited before readiness'))\n })()\n })\n}\n\nasync function start(options: RetainedDatalakeOptions, port: number, initialize: boolean): Promise<RunningArchive> {\n if (!PATH.isAbsolute(options.directory)) throw new Error('Retained archive directory must be absolute')\n const worker = new URL(import.meta.url.endsWith('.ts') ? './retainedDatalakeWorker.ts' : './retainedDatalakeWorker.mjs', import.meta.url)\n const owned = ownChild(fork(worker, [], {\n env: fixtureEnvironment(), execPath: process.execPath, stdio: ['ignore', 'ignore', 'pipe', 'ipc'],\n }))\n try {\n const ready = readiness(owned, options.readinessTimeoutMilliseconds ?? 30_000)\n owned.child.send({\n kind: 'start',\n directory: options.directory,\n port,\n descriptor: options.descriptor,\n initialize,\n initialPayloads: initialize ? options.initialPayloads : undefined,\n })\n return { owned, url: await ready }\n } catch (error) {\n await stopChild(owned, options.stopTimeoutMilliseconds ?? 10_000)\n throw error\n }\n}\n\n/** Public LMDB/descriptor corpus only; no account keys or recovery journal. */\nexport async function startRetainedDatalake(options: RetainedDatalakeOptions): Promise<RetainedDatalake> {\n const fixed: RetainedDatalakeOptions = Object.freeze({\n initialPayloads: options.initialPayloads === undefined ? undefined : structuredClone(options.initialPayloads),\n directory: options.directory,\n descriptor: options.descriptor === undefined ? undefined : structuredClone(options.descriptor),\n readinessTimeoutMilliseconds: fixtureDeadline(options.readinessTimeoutMilliseconds, 30_000),\n stopTimeoutMilliseconds: fixtureDeadline(options.stopTimeoutMilliseconds, 10_000),\n })\n let current: RunningArchive | undefined = await start(fixed, 0, true)\n const url = current.url\n const endpoint = new URL(url)\n const port = Number(endpoint.port)\n let operation = Promise.resolve()\n const serialize = (action: () => Promise<void>): Promise<void> => {\n const previous = operation\n const next = (async () => {\n await previous\n await action()\n })()\n operation = (async () => {\n try {\n await next\n } catch {\n // Caller retains failure; later cleanup may retry.\n }\n })()\n return next\n }\n const stopCurrent = async (): Promise<void> => {\n if (current !== undefined) await stopChild(current.owned, fixed.stopTimeoutMilliseconds ?? 10_000)\n current = undefined\n }\n return {\n url,\n stop: () => serialize(stopCurrent),\n restart: () => serialize(async () => {\n await stopCurrent()\n current = await start(fixed, port, false)\n if (current.url !== url) throw new Error('Retained datalake restart changed its explicit endpoint')\n }),\n }\n}\n", "import type { ChildProcess } from 'node:child_process'\n\nexport interface OwnedChild {\n readonly child: ChildProcess\n readonly closed: Promise<void>\n hasClosed(): boolean\n}\n\nexport function fixtureDeadline(value: number | undefined, fallback: number): number {\n const milliseconds = value ?? fallback\n if (!Number.isSafeInteger(milliseconds) || milliseconds < 1 || milliseconds > 60_000) {\n throw new Error('Local fixture deadline must be a positive integer at most 60000 milliseconds')\n }\n return milliseconds\n}\n\n/** Closed executable environment; operating credentials and XL1 overrides are not inherited. */\nexport function fixtureEnvironment(): NodeJS.ProcessEnv {\n const environment: NodeJS.ProcessEnv = {}\n for (const name of ['PATH', 'TMPDIR', 'TMP', 'TEMP', 'NODE_OPTIONS', 'NODE_ENV', 'NO_COLOR', 'FORCE_COLOR', 'TZ']) {\n const value = process.env[name]\n if (value !== undefined) environment[name] = value\n }\n return environment\n}\n\nexport function ownChild(child: ChildProcess): OwnedChild {\n let ended = false\n const closed = new Promise<void>((resolve) => {\n child.once('close', () => {\n ended = true\n resolve()\n })\n })\n // Drain diagnostics without publishing child environment or ephemeral keys.\n child.stderr?.on('data', () => { /* Diagnostics are deliberately discarded. */ })\n child.on('error', () => { /* The close event remains the settlement authority. */ })\n return {\n child, closed, hasClosed: () => ended,\n }\n}\n\nasync function waitClosed(owned: OwnedChild, milliseconds: number): Promise<boolean> {\n if (owned.hasClosed()) return true\n let timer: ReturnType<typeof setTimeout> | undefined\n try {\n return await Promise.race([\n (async () => {\n await owned.closed\n return true\n })(),\n new Promise<boolean>((resolve) => { timer = setTimeout(() => resolve(false), milliseconds) }),\n ])\n } finally {\n clearTimeout(timer)\n }\n}\n\n/** A successful return means the real child and its pipes closed. */\nexport async function stopChild(owned: OwnedChild, milliseconds: number): Promise<void> {\n if (owned.hasClosed()) return\n owned.child.kill('SIGTERM')\n if (await waitClosed(owned, milliseconds)) return\n owned.child.kill('SIGKILL')\n if (!await waitClosed(owned, milliseconds)) throw new Error('Local fixture child settlement remains unknown')\n}\n", "/**\n * The programmatic datalake surface of `@ariestools/datalake-cli`, which\n * replaces `@ariestools/cli/datalake`: the public client and core APIs, the\n * local dev-server inspection, and a retained local datalake for fixtures.\n * The client and core are public dependencies; the retained datalake's worker\n * bundles the private control and plane, so consumers install no private\n * package.\n */\n\nexport type { RetainedDatalake, RetainedDatalakeOptions } from './retainedDatalake.ts'\nexport { startRetainedDatalake } from './retainedDatalake.ts'\nexport type { CreateDatalakeClientOptions } from '@ariestools/aries-datalake-client'\nexport type {\n AuthTokenSource,\n DatalakeClient,\n PayloadsAuthTokenSource,\n PayloadsClient,\n RestDatalakeClientOptions,\n RestPayloadsClientOptions,\n StoredCredentials,\n WalletJwtCredentials,\n} from '@ariestools/aries-datalake-client'\nexport type {\n ExactRootArchiveBody, ExactRootArchiveCallOptions, ExactRootArchiveErrorCode,\n ExactRootArchiveLimits, ExactRootArchiveOptions, ExactRootArchiveRoot,\n ExactRootArchiveTokenRequest, ExactRootArchiveWriteState,\n} from '@ariestools/aries-datalake-client'\nexport {\n clearCredentials,\n clearDefaultDatalake,\n createDatalakeClient,\n getCredentialsLocation,\n getDefaultDatalake,\n loadCredentials,\n LocalDatalakeClient,\n RestDatalakeClient,\n RestPayloadsClient,\n saveCredentials,\n setDefaultDatalake,\n} from '@ariestools/aries-datalake-client'\nexport { ExactRootArchive, ExactRootArchiveError } from '@ariestools/aries-datalake-client'\nexport type {\n DatalakeDevServerEndpointReport,\n DatalakeDevServerExitCode,\n DatalakeDevServerReport,\n DatalakeDevServerStatus,\n InspectDatalakeDevServerOptions,\n} from '@ariestools/aries-datalake-client/dev'\nexport { inspectDatalakeDevServer } from '@ariestools/aries-datalake-client/dev'\nexport type { DatalakeDescriptor, Payload } from '@ariestools/aries-datalake-core'\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CommandModule } from 'yargs';
|
|
2
|
+
export { applyLoginInsecureHttpChoice } from './commands/datalakeLoginInternalCommand.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The internal datalake tree: the public tree plus the blob group, the
|
|
5
|
+
* `dev up --blobs` variant, and `login --allow-insecure-http`. Only the
|
|
6
|
+
* internal CLI entry imports this module, so none of it reaches the public
|
|
7
|
+
* `aries` bundle.
|
|
8
|
+
*/
|
|
9
|
+
export declare const internalDatalakeCommand: CommandModule;
|
|
10
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAO1C,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAA;AAEzF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,aAIpC,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { DatalakeDescriptor, Payload } from '@ariestools/aries-datalake-core';
|
|
2
|
+
export interface RetainedDatalakeOptions {
|
|
3
|
+
readonly descriptor?: DatalakeDescriptor;
|
|
4
|
+
readonly directory: string;
|
|
5
|
+
/** Public fixture bodies, inserted only into a newly created descriptor. */
|
|
6
|
+
readonly initialPayloads?: readonly Payload[];
|
|
7
|
+
readonly readinessTimeoutMilliseconds?: number;
|
|
8
|
+
readonly stopTimeoutMilliseconds?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface RetainedDatalake {
|
|
11
|
+
readonly url: string;
|
|
12
|
+
restart(): Promise<void>;
|
|
13
|
+
stop(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
/** Public LMDB/descriptor corpus only; no account keys or recovery journal. */
|
|
16
|
+
export declare function startRetainedDatalake(options: RetainedDatalakeOptions): Promise<RetainedDatalake>;
|
|
17
|
+
//# sourceMappingURL=retainedDatalake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retainedDatalake.d.ts","sourceRoot":"","sources":["../../src/retainedDatalake.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAOlF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,UAAU,CAAC,EAAE,kBAAkB,CAAA;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;IAC7C,QAAQ,CAAC,4BAA4B,CAAC,EAAE,MAAM,CAAA;IAC9C,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAA;CAC1C;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB;AAsED,+EAA+E;AAC/E,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAyCvG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ChildProcess } from 'node:child_process';
|
|
2
|
+
export interface OwnedChild {
|
|
3
|
+
readonly child: ChildProcess;
|
|
4
|
+
readonly closed: Promise<void>;
|
|
5
|
+
hasClosed(): boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function fixtureDeadline(value: number | undefined, fallback: number): number;
|
|
8
|
+
/** Closed executable environment; operating credentials and XL1 overrides are not inherited. */
|
|
9
|
+
export declare function fixtureEnvironment(): NodeJS.ProcessEnv;
|
|
10
|
+
export declare function ownChild(child: ChildProcess): OwnedChild;
|
|
11
|
+
/** A successful return means the real child and its pipes closed. */
|
|
12
|
+
export declare function stopChild(owned: OwnedChild, milliseconds: number): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=retainedDatalakeChild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retainedDatalakeChild.d.ts","sourceRoot":"","sources":["../../src/retainedDatalakeChild.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9B,SAAS,IAAI,OAAO,CAAA;CACrB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMnF;AAED,gGAAgG;AAChG,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,UAAU,CAOtD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,UAAU,CAcxD;AAkBD,qEAAqE;AACrE,wBAAsB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMtF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retainedDatalakeWorker.d.ts","sourceRoot":"","sources":["../../src/retainedDatalakeWorker.ts"],"names":[],"mappings":""}
|