runtime-resolver 0.2.0 → 0.3.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/{701.js → 711.js} +45 -41
- package/bin/runtime-resolver.js +4 -5
- package/index.d.ts +321 -552
- package/index.js +8 -9
- package/{235.js → json-schema.js} +8 -2
- package/package.json +10 -8
- package/rslib-runtime.js +37 -0
- package/tsdoc-metadata.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Context } from 'effect';
|
|
|
2
2
|
import { DateTime } from 'effect';
|
|
3
3
|
import { Effect } from 'effect';
|
|
4
4
|
import type { EmptyCacheError } from 'semver-effect';
|
|
5
|
-
import { Equals } from 'effect/Types';
|
|
6
5
|
import type { InvalidRangeError } from 'semver-effect';
|
|
7
6
|
import type { InvalidVersionError } from 'semver-effect';
|
|
8
7
|
import { Layer } from 'effect';
|
|
@@ -12,6 +11,7 @@ import { Schema } from 'effect';
|
|
|
12
11
|
import { SemVer } from 'semver-effect';
|
|
13
12
|
import type { UnsatisfiedRangeError } from 'semver-effect';
|
|
14
13
|
import { VersionCache } from 'semver-effect';
|
|
14
|
+
import { VoidIfEmpty } from 'effect/Types';
|
|
15
15
|
import { YieldableError } from 'effect/Cause';
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -42,27 +42,13 @@ import { YieldableError } from 'effect/Cause';
|
|
|
42
42
|
*
|
|
43
43
|
* @public
|
|
44
44
|
*/
|
|
45
|
-
export declare class AuthenticationError extends
|
|
45
|
+
export declare class AuthenticationError extends AuthenticationError_base<{
|
|
46
46
|
readonly method: "token" | "app";
|
|
47
47
|
readonly message: string;
|
|
48
48
|
}> {
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
* @internal
|
|
53
|
-
* Exported for declaration bundling (api-extractor). When `export *` re-exports
|
|
54
|
-
* a class whose `extends` expression is an inline call like
|
|
55
|
-
* `Data.TaggedError(...)`, TypeScript emits an un-nameable `_base` symbol in
|
|
56
|
-
* the declaration file. Splitting the base into a named export gives the
|
|
57
|
-
* bundler a stable reference.
|
|
58
|
-
*
|
|
59
|
-
* @privateRemarks
|
|
60
|
-
* This base constant must remain a named export so that api-extractor can
|
|
61
|
-
* resolve the extends clause of {@link AuthenticationError} to a stable
|
|
62
|
-
* declaration. Without it the bundled `.d.ts` would contain an anonymous
|
|
63
|
-
* `_base` symbol that cannot be referenced by downstream consumers.
|
|
64
|
-
*/
|
|
65
|
-
export declare const AuthenticationErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
51
|
+
declare const AuthenticationError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
66
52
|
readonly _tag: "AuthenticationError";
|
|
67
53
|
} & Readonly<A>;
|
|
68
54
|
|
|
@@ -137,14 +123,14 @@ export declare const AutoDenoCacheLive: Layer.Layer<DenoReleaseCache, never, Den
|
|
|
137
123
|
export declare const AutoNodeCacheLive: Layer.Layer<NodeReleaseCache, never, NodeVersionFetcher | NodeScheduleFetcher>;
|
|
138
124
|
|
|
139
125
|
/**
|
|
140
|
-
* A Bun release entry with a parsed {@link SemVer
|
|
126
|
+
* A Bun release entry with a parsed {@link SemVer} version and an
|
|
141
127
|
* Effect {@link DateTime.DateTime} publication date.
|
|
142
128
|
*
|
|
143
129
|
* `BunRelease` extends `Data.TaggedClass` so instances support structural
|
|
144
130
|
* equality comparison and can be used safely inside Effect data structures.
|
|
145
131
|
* Construct instances via the {@link BunRelease.fromInput} factory rather than
|
|
146
132
|
* calling `new BunRelease(...)` directly, as the factory validates the version
|
|
147
|
-
* string through `SemVer.
|
|
133
|
+
* string through `SemVer.parse`.
|
|
148
134
|
*
|
|
149
135
|
* @see {@link BunReleaseCache}
|
|
150
136
|
* @see {@link BunResolver}
|
|
@@ -169,14 +155,14 @@ export declare const AutoNodeCacheLive: Layer.Layer<NodeReleaseCache, never, Nod
|
|
|
169
155
|
*
|
|
170
156
|
* @public
|
|
171
157
|
*/
|
|
172
|
-
export declare class BunRelease extends
|
|
173
|
-
readonly version: SemVer
|
|
158
|
+
export declare class BunRelease extends BunRelease_base<{
|
|
159
|
+
readonly version: SemVer;
|
|
174
160
|
readonly date: DateTime.DateTime;
|
|
175
161
|
}> {
|
|
176
162
|
/**
|
|
177
163
|
* Create a {@link BunRelease} from lean string inputs.
|
|
178
164
|
*
|
|
179
|
-
* Parses `input.version` via `SemVer.
|
|
165
|
+
* Parses `input.version` via `SemVer.parse` and constructs the
|
|
180
166
|
* publication date with `DateTime.unsafeMake`. Falls back to the current
|
|
181
167
|
* timestamp when `input.date` is an empty string (rare in production data).
|
|
182
168
|
*
|
|
@@ -187,46 +173,13 @@ export declare class BunRelease extends BunReleaseBase<{
|
|
|
187
173
|
static fromInput(input: RuntimeReleaseInput): Effect.Effect<BunRelease, InvalidVersionError>;
|
|
188
174
|
}
|
|
189
175
|
|
|
190
|
-
|
|
191
|
-
* @internal
|
|
192
|
-
*
|
|
193
|
-
* Exported for declaration bundling (api-extractor). When `export *`
|
|
194
|
-
* re-exports a class whose `extends` expression is an inline call like
|
|
195
|
-
* `Data.TaggedClass(...)`, TypeScript emits an un-nameable `_base` symbol in
|
|
196
|
-
* the declaration file. Splitting the base into a named export gives the
|
|
197
|
-
* bundler a stable reference.
|
|
198
|
-
*
|
|
199
|
-
* @privateRemarks
|
|
200
|
-
* This base constant must remain a named export so that api-extractor can
|
|
201
|
-
* resolve the extends clause of {@link BunRelease} to a stable declaration.
|
|
202
|
-
* Without it the bundled `.d.ts` would contain an anonymous `_base` symbol
|
|
203
|
-
* that cannot be referenced by downstream consumers.
|
|
204
|
-
*/
|
|
205
|
-
export declare const BunReleaseBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => Readonly<A> & {
|
|
176
|
+
declare const BunRelease_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Readonly<A> & {
|
|
206
177
|
readonly _tag: "BunRelease";
|
|
207
178
|
};
|
|
208
179
|
|
|
209
180
|
/**
|
|
210
181
|
* Specialisation of {@link RuntimeCache} for Bun release objects.
|
|
211
182
|
*
|
|
212
|
-
* @see {@link BunRelease}
|
|
213
|
-
* @see {@link RuntimeCache}
|
|
214
|
-
* @see {@link AutoBunCacheLive}
|
|
215
|
-
* @see {@link FreshBunCacheLive}
|
|
216
|
-
* @see {@link OfflineBunCacheLive}
|
|
217
|
-
*
|
|
218
|
-
* @public
|
|
219
|
-
*/
|
|
220
|
-
export declare type BunReleaseCache = RuntimeCache<BunRelease>;
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Service tag and companion object for {@link BunReleaseCache}.
|
|
224
|
-
*
|
|
225
|
-
* Acts as both the TypeScript service interface (via the type alias above) and
|
|
226
|
-
* the Effect dependency tag used for dependency injection. Yield this tag
|
|
227
|
-
* inside `Effect.gen` to access the cache implementation provided by one of
|
|
228
|
-
* the cache layers.
|
|
229
|
-
*
|
|
230
183
|
* @example
|
|
231
184
|
* ```typescript
|
|
232
185
|
* import type { BunRelease } from "runtime-resolver";
|
|
@@ -242,13 +195,18 @@ export declare type BunReleaseCache = RuntimeCache<BunRelease>;
|
|
|
242
195
|
* Effect.runPromise(program.pipe(Effect.provide(OfflineBunCacheLive)));
|
|
243
196
|
* ```
|
|
244
197
|
*
|
|
198
|
+
* @see {@link BunRelease}
|
|
199
|
+
* @see {@link RuntimeCache}
|
|
245
200
|
* @see {@link AutoBunCacheLive}
|
|
246
201
|
* @see {@link FreshBunCacheLive}
|
|
247
202
|
* @see {@link OfflineBunCacheLive}
|
|
248
203
|
*
|
|
249
204
|
* @public
|
|
250
205
|
*/
|
|
251
|
-
export declare
|
|
206
|
+
export declare class BunReleaseCache extends BunReleaseCache_base {
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
declare const BunReleaseCache_base: Context.TagClass<BunReleaseCache, "runtime-resolver/BunReleaseCache", RuntimeCache<BunRelease>>;
|
|
252
210
|
|
|
253
211
|
/**
|
|
254
212
|
* Low-level layer that constructs the {@link BunReleaseCache} service backed by
|
|
@@ -269,40 +227,9 @@ export declare const BunReleaseCache: Context.Tag<BunReleaseCache, BunReleaseCac
|
|
|
269
227
|
export declare const BunReleaseCacheLive: Layer.Layer<BunReleaseCache, never, VersionCache>;
|
|
270
228
|
|
|
271
229
|
/**
|
|
272
|
-
* Service
|
|
230
|
+
* Service for resolving Bun runtime versions against the cached
|
|
273
231
|
* release index.
|
|
274
232
|
*
|
|
275
|
-
* @see {@link BunResolverLive}
|
|
276
|
-
* @see {@link resolveBun}
|
|
277
|
-
* @see {@link BunResolverOptions}
|
|
278
|
-
* @see {@link ResolvedVersions}
|
|
279
|
-
*
|
|
280
|
-
* @public
|
|
281
|
-
*/
|
|
282
|
-
export declare interface BunResolver {
|
|
283
|
-
/**
|
|
284
|
-
* Resolves Bun versions according to `options` and returns a
|
|
285
|
-
* {@link ResolvedVersions} object containing the matching version list,
|
|
286
|
-
* the latest version string, and the data source indicator.
|
|
287
|
-
*
|
|
288
|
-
* Fails with {@link BunResolverError} when no version can be resolved and
|
|
289
|
-
* no `defaultVersion` was provided.
|
|
290
|
-
*
|
|
291
|
-
* @param options - Optional resolution constraints.
|
|
292
|
-
*
|
|
293
|
-
* @see {@link BunResolverOptions}
|
|
294
|
-
*/
|
|
295
|
-
readonly resolve: (options?: BunResolverOptions) => Effect.Effect<ResolvedVersions, BunResolverError>;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Service tag and companion object for {@link BunResolver}.
|
|
300
|
-
*
|
|
301
|
-
* Acts as both the TypeScript service interface and the Effect dependency tag
|
|
302
|
-
* used for dependency injection (companion object pattern). Yield this tag
|
|
303
|
-
* inside `Effect.gen` to obtain the resolver implementation provided by
|
|
304
|
-
* {@link BunResolverLive}.
|
|
305
|
-
*
|
|
306
233
|
* For a one-shot Promise-based API see {@link resolveBun}.
|
|
307
234
|
*
|
|
308
235
|
* @example
|
|
@@ -323,10 +250,35 @@ export declare interface BunResolver {
|
|
|
323
250
|
*
|
|
324
251
|
* @see {@link BunResolverLive}
|
|
325
252
|
* @see {@link resolveBun}
|
|
253
|
+
* @see {@link BunResolverOptions}
|
|
254
|
+
* @see {@link ResolvedVersions}
|
|
326
255
|
*
|
|
327
256
|
* @public
|
|
328
257
|
*/
|
|
329
|
-
export declare
|
|
258
|
+
export declare class BunResolver extends BunResolver_base {
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
declare const BunResolver_base: Context.TagClass<BunResolver, "runtime-resolver/BunResolver", {
|
|
262
|
+
/**
|
|
263
|
+
* Resolves Bun versions according to `options` and returns a
|
|
264
|
+
* {@link ResolvedVersions} object containing the matching version list,
|
|
265
|
+
* the latest version string, and the data source indicator.
|
|
266
|
+
*
|
|
267
|
+
* Fails with {@link BunResolverError} when no version can be resolved and
|
|
268
|
+
* no `defaultVersion` was provided.
|
|
269
|
+
*
|
|
270
|
+
* @param options - Optional resolution constraints.
|
|
271
|
+
*
|
|
272
|
+
* @see {@link BunResolverOptions}
|
|
273
|
+
*/
|
|
274
|
+
readonly resolve: (options?: BunResolverOptions | undefined) => Effect.Effect<{
|
|
275
|
+
readonly source: "api" | "cache";
|
|
276
|
+
readonly versions: readonly string[];
|
|
277
|
+
readonly latest: string;
|
|
278
|
+
readonly lts?: string | undefined;
|
|
279
|
+
readonly default?: string | undefined;
|
|
280
|
+
}, VersionNotFoundError, never>;
|
|
281
|
+
}>;
|
|
330
282
|
|
|
331
283
|
/**
|
|
332
284
|
* Union of all typed errors that {@link BunResolver.resolve} can fail with.
|
|
@@ -419,47 +371,13 @@ export declare interface BunResolverOptions {
|
|
|
419
371
|
}
|
|
420
372
|
|
|
421
373
|
/**
|
|
422
|
-
* Service
|
|
374
|
+
* Service for fetching Bun release data from the GitHub API.
|
|
423
375
|
*
|
|
424
376
|
* Retrieves both the parsed semver version list and the raw release input
|
|
425
377
|
* records needed to populate a {@link BunReleaseCache}. The live
|
|
426
378
|
* implementation queries the `oven-sh/bun` GitHub repository via
|
|
427
379
|
* {@link GitHubClient}.
|
|
428
380
|
*
|
|
429
|
-
* @see {@link BunVersionFetcherLive}
|
|
430
|
-
* @see {@link BunReleaseCache}
|
|
431
|
-
* @see {@link AuthenticationError}
|
|
432
|
-
* @see {@link NetworkError}
|
|
433
|
-
* @see {@link ParseError}
|
|
434
|
-
* @see {@link RateLimitError}
|
|
435
|
-
*
|
|
436
|
-
* @public
|
|
437
|
-
*/
|
|
438
|
-
export declare interface BunVersionFetcher {
|
|
439
|
-
/**
|
|
440
|
-
* Fetches all available Bun releases from the GitHub API and returns both
|
|
441
|
-
* the parsed semver version objects and the raw release input records.
|
|
442
|
-
*
|
|
443
|
-
* Fails with:
|
|
444
|
-
* - {@link AuthenticationError} — missing or invalid GitHub credentials.
|
|
445
|
-
* - {@link NetworkError} — the upstream request could not be completed.
|
|
446
|
-
* - {@link ParseError} — the response payload could not be decoded.
|
|
447
|
-
* - {@link RateLimitError} — the GitHub API rate limit was exceeded.
|
|
448
|
-
*/
|
|
449
|
-
readonly fetch: () => Effect.Effect<{
|
|
450
|
-
readonly versions: ReadonlyArray<SemVer.SemVer>;
|
|
451
|
-
readonly inputs: ReadonlyArray<RuntimeReleaseInput>;
|
|
452
|
-
}, AuthenticationError | NetworkError | ParseError | RateLimitError>;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* Service tag and companion object for {@link BunVersionFetcher}.
|
|
457
|
-
*
|
|
458
|
-
* Acts as both the TypeScript service interface and the Effect dependency tag
|
|
459
|
-
* used for dependency injection (companion object pattern). Yield this tag
|
|
460
|
-
* inside `Effect.gen` to access the fetcher implementation provided by
|
|
461
|
-
* {@link BunVersionFetcherLive}.
|
|
462
|
-
*
|
|
463
381
|
* @example
|
|
464
382
|
* ```typescript
|
|
465
383
|
* import type { RuntimeReleaseInput } from "runtime-resolver";
|
|
@@ -478,10 +396,36 @@ export declare interface BunVersionFetcher {
|
|
|
478
396
|
* ```
|
|
479
397
|
*
|
|
480
398
|
* @see {@link BunVersionFetcherLive}
|
|
399
|
+
* @see {@link BunReleaseCache}
|
|
400
|
+
* @see {@link AuthenticationError}
|
|
401
|
+
* @see {@link NetworkError}
|
|
402
|
+
* @see {@link ParseError}
|
|
403
|
+
* @see {@link RateLimitError}
|
|
481
404
|
*
|
|
482
405
|
* @public
|
|
483
406
|
*/
|
|
484
|
-
export declare
|
|
407
|
+
export declare class BunVersionFetcher extends BunVersionFetcher_base {
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
declare const BunVersionFetcher_base: Context.TagClass<BunVersionFetcher, "runtime-resolver/BunVersionFetcher", {
|
|
411
|
+
/**
|
|
412
|
+
* Fetches all available Bun releases from the GitHub API and returns both
|
|
413
|
+
* the parsed semver version objects and the raw release input records.
|
|
414
|
+
*
|
|
415
|
+
* Fails with:
|
|
416
|
+
* - {@link AuthenticationError} — missing or invalid GitHub credentials.
|
|
417
|
+
* - {@link NetworkError} — the upstream request could not be completed.
|
|
418
|
+
* - {@link ParseError} — the response payload could not be decoded.
|
|
419
|
+
* - {@link RateLimitError} — the GitHub API rate limit was exceeded.
|
|
420
|
+
*/
|
|
421
|
+
readonly fetch: () => Effect.Effect<{
|
|
422
|
+
readonly versions: readonly SemVer[];
|
|
423
|
+
readonly inputs: readonly {
|
|
424
|
+
readonly version: string;
|
|
425
|
+
readonly date: string;
|
|
426
|
+
}[];
|
|
427
|
+
}, AuthenticationError | NetworkError | ParseError | RateLimitError, never>;
|
|
428
|
+
}>;
|
|
485
429
|
|
|
486
430
|
/**
|
|
487
431
|
* Provides the {@link BunVersionFetcher} service using the live GitHub API.
|
|
@@ -527,23 +471,13 @@ export declare const BunVersionFetcherLive: Layer.Layer<BunVersionFetcher, never
|
|
|
527
471
|
*
|
|
528
472
|
* @public
|
|
529
473
|
*/
|
|
530
|
-
export declare class CacheError extends
|
|
474
|
+
export declare class CacheError extends CacheError_base<{
|
|
531
475
|
readonly operation: "read" | "write";
|
|
532
476
|
readonly message: string;
|
|
533
477
|
}> {
|
|
534
478
|
}
|
|
535
479
|
|
|
536
|
-
|
|
537
|
-
* @internal
|
|
538
|
-
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
539
|
-
*
|
|
540
|
-
* @privateRemarks
|
|
541
|
-
* This base constant must remain a named export so that api-extractor can
|
|
542
|
-
* resolve the extends clause of {@link CacheError} to a stable declaration.
|
|
543
|
-
* Without it the bundled `.d.ts` would contain an anonymous `_base` symbol
|
|
544
|
-
* that cannot be referenced by downstream consumers.
|
|
545
|
-
*/
|
|
546
|
-
export declare const CacheErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
480
|
+
declare const CacheError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
547
481
|
readonly _tag: "CacheError";
|
|
548
482
|
} & Readonly<A>;
|
|
549
483
|
|
|
@@ -579,14 +513,14 @@ export declare const CacheErrorBase: new <A extends Record<string, any> = {}>(ar
|
|
|
579
513
|
export declare const createRuntimeCache: <R extends RuntimeRelease>() => Effect.Effect<RuntimeCache<R>, never, VersionCache>;
|
|
580
514
|
|
|
581
515
|
/**
|
|
582
|
-
* A Deno release entry with a parsed {@link SemVer
|
|
516
|
+
* A Deno release entry with a parsed {@link SemVer} version and an
|
|
583
517
|
* Effect {@link DateTime.DateTime} publication date.
|
|
584
518
|
*
|
|
585
519
|
* `DenoRelease` extends `Data.TaggedClass` so instances support structural
|
|
586
520
|
* equality comparison and can be used safely inside Effect data structures.
|
|
587
521
|
* Construct instances via the {@link DenoRelease.fromInput} factory rather than
|
|
588
522
|
* calling `new DenoRelease(...)` directly, as the factory validates the version
|
|
589
|
-
* string through `SemVer.
|
|
523
|
+
* string through `SemVer.parse`.
|
|
590
524
|
*
|
|
591
525
|
* @see {@link DenoReleaseCache}
|
|
592
526
|
* @see {@link DenoResolver}
|
|
@@ -611,14 +545,14 @@ export declare const createRuntimeCache: <R extends RuntimeRelease>() => Effect.
|
|
|
611
545
|
*
|
|
612
546
|
* @public
|
|
613
547
|
*/
|
|
614
|
-
export declare class DenoRelease extends
|
|
615
|
-
readonly version: SemVer
|
|
548
|
+
export declare class DenoRelease extends DenoRelease_base<{
|
|
549
|
+
readonly version: SemVer;
|
|
616
550
|
readonly date: DateTime.DateTime;
|
|
617
551
|
}> {
|
|
618
552
|
/**
|
|
619
553
|
* Create a {@link DenoRelease} from lean string inputs.
|
|
620
554
|
*
|
|
621
|
-
* Parses `input.version` via `SemVer.
|
|
555
|
+
* Parses `input.version` via `SemVer.parse` and constructs the
|
|
622
556
|
* publication date with `DateTime.unsafeMake`. Falls back to the current
|
|
623
557
|
* timestamp when `input.date` is an empty string (rare in production data).
|
|
624
558
|
*
|
|
@@ -629,46 +563,13 @@ export declare class DenoRelease extends DenoReleaseBase<{
|
|
|
629
563
|
static fromInput(input: RuntimeReleaseInput): Effect.Effect<DenoRelease, InvalidVersionError>;
|
|
630
564
|
}
|
|
631
565
|
|
|
632
|
-
|
|
633
|
-
* @internal
|
|
634
|
-
*
|
|
635
|
-
* Exported for declaration bundling (api-extractor). When `export *`
|
|
636
|
-
* re-exports a class whose `extends` expression is an inline call like
|
|
637
|
-
* `Data.TaggedClass(...)`, TypeScript emits an un-nameable `_base` symbol in
|
|
638
|
-
* the declaration file. Splitting the base into a named export gives the
|
|
639
|
-
* bundler a stable reference.
|
|
640
|
-
*
|
|
641
|
-
* @privateRemarks
|
|
642
|
-
* This base constant must remain a named export so that api-extractor can
|
|
643
|
-
* resolve the extends clause of {@link DenoRelease} to a stable declaration.
|
|
644
|
-
* Without it the bundled `.d.ts` would contain an anonymous `_base` symbol
|
|
645
|
-
* that cannot be referenced by downstream consumers.
|
|
646
|
-
*/
|
|
647
|
-
export declare const DenoReleaseBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => Readonly<A> & {
|
|
566
|
+
declare const DenoRelease_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Readonly<A> & {
|
|
648
567
|
readonly _tag: "DenoRelease";
|
|
649
568
|
};
|
|
650
569
|
|
|
651
570
|
/**
|
|
652
571
|
* Specialisation of {@link RuntimeCache} for Deno release objects.
|
|
653
572
|
*
|
|
654
|
-
* @see {@link DenoRelease}
|
|
655
|
-
* @see {@link RuntimeCache}
|
|
656
|
-
* @see {@link AutoDenoCacheLive}
|
|
657
|
-
* @see {@link FreshDenoCacheLive}
|
|
658
|
-
* @see {@link OfflineDenoCacheLive}
|
|
659
|
-
*
|
|
660
|
-
* @public
|
|
661
|
-
*/
|
|
662
|
-
export declare type DenoReleaseCache = RuntimeCache<DenoRelease>;
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
* Service tag and companion object for {@link DenoReleaseCache}.
|
|
666
|
-
*
|
|
667
|
-
* Acts as both the TypeScript service interface (via the type alias above) and
|
|
668
|
-
* the Effect dependency tag used for dependency injection. Yield this tag
|
|
669
|
-
* inside `Effect.gen` to access the cache implementation provided by one of
|
|
670
|
-
* the cache layers.
|
|
671
|
-
*
|
|
672
573
|
* @example
|
|
673
574
|
* ```typescript
|
|
674
575
|
* import type { DenoRelease } from "runtime-resolver";
|
|
@@ -684,13 +585,18 @@ export declare type DenoReleaseCache = RuntimeCache<DenoRelease>;
|
|
|
684
585
|
* Effect.runPromise(program.pipe(Effect.provide(OfflineDenoCacheLive)));
|
|
685
586
|
* ```
|
|
686
587
|
*
|
|
588
|
+
* @see {@link DenoRelease}
|
|
589
|
+
* @see {@link RuntimeCache}
|
|
687
590
|
* @see {@link AutoDenoCacheLive}
|
|
688
591
|
* @see {@link FreshDenoCacheLive}
|
|
689
592
|
* @see {@link OfflineDenoCacheLive}
|
|
690
593
|
*
|
|
691
594
|
* @public
|
|
692
595
|
*/
|
|
693
|
-
export declare
|
|
596
|
+
export declare class DenoReleaseCache extends DenoReleaseCache_base {
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
declare const DenoReleaseCache_base: Context.TagClass<DenoReleaseCache, "runtime-resolver/DenoReleaseCache", RuntimeCache<DenoRelease>>;
|
|
694
600
|
|
|
695
601
|
/**
|
|
696
602
|
* Low-level layer that constructs the {@link DenoReleaseCache} service backed by
|
|
@@ -711,40 +617,9 @@ export declare const DenoReleaseCache: Context.Tag<DenoReleaseCache, DenoRelease
|
|
|
711
617
|
export declare const DenoReleaseCacheLive: Layer.Layer<DenoReleaseCache, never, VersionCache>;
|
|
712
618
|
|
|
713
619
|
/**
|
|
714
|
-
* Service
|
|
620
|
+
* Service for resolving Deno runtime versions against the cached
|
|
715
621
|
* release index.
|
|
716
622
|
*
|
|
717
|
-
* @see {@link DenoResolverLive}
|
|
718
|
-
* @see {@link resolveDeno}
|
|
719
|
-
* @see {@link DenoResolverOptions}
|
|
720
|
-
* @see {@link ResolvedVersions}
|
|
721
|
-
*
|
|
722
|
-
* @public
|
|
723
|
-
*/
|
|
724
|
-
export declare interface DenoResolver {
|
|
725
|
-
/**
|
|
726
|
-
* Resolves Deno versions according to `options` and returns a
|
|
727
|
-
* {@link ResolvedVersions} object containing the matching version list,
|
|
728
|
-
* the latest version string, and the data source indicator.
|
|
729
|
-
*
|
|
730
|
-
* Fails with {@link DenoResolverError} when no version can be resolved and
|
|
731
|
-
* no `defaultVersion` was provided.
|
|
732
|
-
*
|
|
733
|
-
* @param options - Optional resolution constraints.
|
|
734
|
-
*
|
|
735
|
-
* @see {@link DenoResolverOptions}
|
|
736
|
-
*/
|
|
737
|
-
readonly resolve: (options?: DenoResolverOptions) => Effect.Effect<ResolvedVersions, DenoResolverError>;
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* Service tag and companion object for {@link DenoResolver}.
|
|
742
|
-
*
|
|
743
|
-
* Acts as both the TypeScript service interface and the Effect dependency tag
|
|
744
|
-
* used for dependency injection (companion object pattern). Yield this tag
|
|
745
|
-
* inside `Effect.gen` to obtain the resolver implementation provided by
|
|
746
|
-
* {@link DenoResolverLive}.
|
|
747
|
-
*
|
|
748
623
|
* For a one-shot Promise-based API see {@link resolveDeno}.
|
|
749
624
|
*
|
|
750
625
|
* @example
|
|
@@ -765,10 +640,35 @@ export declare interface DenoResolver {
|
|
|
765
640
|
*
|
|
766
641
|
* @see {@link DenoResolverLive}
|
|
767
642
|
* @see {@link resolveDeno}
|
|
643
|
+
* @see {@link DenoResolverOptions}
|
|
644
|
+
* @see {@link ResolvedVersions}
|
|
768
645
|
*
|
|
769
646
|
* @public
|
|
770
647
|
*/
|
|
771
|
-
export declare
|
|
648
|
+
export declare class DenoResolver extends DenoResolver_base {
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
declare const DenoResolver_base: Context.TagClass<DenoResolver, "runtime-resolver/DenoResolver", {
|
|
652
|
+
/**
|
|
653
|
+
* Resolves Deno versions according to `options` and returns a
|
|
654
|
+
* {@link ResolvedVersions} object containing the matching version list,
|
|
655
|
+
* the latest version string, and the data source indicator.
|
|
656
|
+
*
|
|
657
|
+
* Fails with {@link DenoResolverError} when no version can be resolved and
|
|
658
|
+
* no `defaultVersion` was provided.
|
|
659
|
+
*
|
|
660
|
+
* @param options - Optional resolution constraints.
|
|
661
|
+
*
|
|
662
|
+
* @see {@link DenoResolverOptions}
|
|
663
|
+
*/
|
|
664
|
+
readonly resolve: (options?: DenoResolverOptions | undefined) => Effect.Effect<{
|
|
665
|
+
readonly source: "api" | "cache";
|
|
666
|
+
readonly versions: readonly string[];
|
|
667
|
+
readonly latest: string;
|
|
668
|
+
readonly lts?: string | undefined;
|
|
669
|
+
readonly default?: string | undefined;
|
|
670
|
+
}, VersionNotFoundError, never>;
|
|
671
|
+
}>;
|
|
772
672
|
|
|
773
673
|
/**
|
|
774
674
|
* Union of all typed errors that {@link DenoResolver.resolve} can fail with.
|
|
@@ -860,47 +760,13 @@ export declare interface DenoResolverOptions {
|
|
|
860
760
|
}
|
|
861
761
|
|
|
862
762
|
/**
|
|
863
|
-
* Service
|
|
763
|
+
* Service for fetching Deno release data from the GitHub API.
|
|
864
764
|
*
|
|
865
765
|
* Retrieves both the parsed semver version list and the raw release input
|
|
866
766
|
* records needed to populate a {@link DenoReleaseCache}. The live
|
|
867
767
|
* implementation queries the `denoland/deno` GitHub repository via
|
|
868
768
|
* {@link GitHubClient}.
|
|
869
769
|
*
|
|
870
|
-
* @see {@link DenoVersionFetcherLive}
|
|
871
|
-
* @see {@link DenoReleaseCache}
|
|
872
|
-
* @see {@link AuthenticationError}
|
|
873
|
-
* @see {@link NetworkError}
|
|
874
|
-
* @see {@link ParseError}
|
|
875
|
-
* @see {@link RateLimitError}
|
|
876
|
-
*
|
|
877
|
-
* @public
|
|
878
|
-
*/
|
|
879
|
-
export declare interface DenoVersionFetcher {
|
|
880
|
-
/**
|
|
881
|
-
* Fetches all available Deno releases from the GitHub API and returns both
|
|
882
|
-
* the parsed semver version objects and the raw release input records.
|
|
883
|
-
*
|
|
884
|
-
* Fails with:
|
|
885
|
-
* - {@link AuthenticationError} — missing or invalid GitHub credentials.
|
|
886
|
-
* - {@link NetworkError} — the upstream request could not be completed.
|
|
887
|
-
* - {@link ParseError} — the response payload could not be decoded.
|
|
888
|
-
* - {@link RateLimitError} — the GitHub API rate limit was exceeded.
|
|
889
|
-
*/
|
|
890
|
-
readonly fetch: () => Effect.Effect<{
|
|
891
|
-
readonly versions: ReadonlyArray<SemVer.SemVer>;
|
|
892
|
-
readonly inputs: ReadonlyArray<RuntimeReleaseInput>;
|
|
893
|
-
}, AuthenticationError | NetworkError | ParseError | RateLimitError>;
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
/**
|
|
897
|
-
* Service tag and companion object for {@link DenoVersionFetcher}.
|
|
898
|
-
*
|
|
899
|
-
* Acts as both the TypeScript service interface and the Effect dependency tag
|
|
900
|
-
* used for dependency injection (companion object pattern). Yield this tag
|
|
901
|
-
* inside `Effect.gen` to access the fetcher implementation provided by
|
|
902
|
-
* {@link DenoVersionFetcherLive}.
|
|
903
|
-
*
|
|
904
770
|
* @example
|
|
905
771
|
* ```typescript
|
|
906
772
|
* import type { RuntimeReleaseInput } from "runtime-resolver";
|
|
@@ -919,10 +785,36 @@ export declare interface DenoVersionFetcher {
|
|
|
919
785
|
* ```
|
|
920
786
|
*
|
|
921
787
|
* @see {@link DenoVersionFetcherLive}
|
|
788
|
+
* @see {@link DenoReleaseCache}
|
|
789
|
+
* @see {@link AuthenticationError}
|
|
790
|
+
* @see {@link NetworkError}
|
|
791
|
+
* @see {@link ParseError}
|
|
792
|
+
* @see {@link RateLimitError}
|
|
922
793
|
*
|
|
923
794
|
* @public
|
|
924
795
|
*/
|
|
925
|
-
export declare
|
|
796
|
+
export declare class DenoVersionFetcher extends DenoVersionFetcher_base {
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
declare const DenoVersionFetcher_base: Context.TagClass<DenoVersionFetcher, "runtime-resolver/DenoVersionFetcher", {
|
|
800
|
+
/**
|
|
801
|
+
* Fetches all available Deno releases from the GitHub API and returns both
|
|
802
|
+
* the parsed semver version objects and the raw release input records.
|
|
803
|
+
*
|
|
804
|
+
* Fails with:
|
|
805
|
+
* - {@link AuthenticationError} — missing or invalid GitHub credentials.
|
|
806
|
+
* - {@link NetworkError} — the upstream request could not be completed.
|
|
807
|
+
* - {@link ParseError} — the response payload could not be decoded.
|
|
808
|
+
* - {@link RateLimitError} — the GitHub API rate limit was exceeded.
|
|
809
|
+
*/
|
|
810
|
+
readonly fetch: () => Effect.Effect<{
|
|
811
|
+
readonly versions: readonly SemVer[];
|
|
812
|
+
readonly inputs: readonly {
|
|
813
|
+
readonly version: string;
|
|
814
|
+
readonly date: string;
|
|
815
|
+
}[];
|
|
816
|
+
}, AuthenticationError | NetworkError | ParseError | RateLimitError, never>;
|
|
817
|
+
}>;
|
|
926
818
|
|
|
927
819
|
/**
|
|
928
820
|
* Provides the {@link DenoVersionFetcher} service using the live GitHub API.
|
|
@@ -1022,23 +914,13 @@ export declare const FreshDenoCacheLive: Layer.Layer<DenoReleaseCache, Freshness
|
|
|
1022
914
|
*
|
|
1023
915
|
* @public
|
|
1024
916
|
*/
|
|
1025
|
-
export declare class FreshnessError extends
|
|
917
|
+
export declare class FreshnessError extends FreshnessError_base<{
|
|
1026
918
|
readonly strategy: "auto" | "api" | "cache";
|
|
1027
919
|
readonly message: string;
|
|
1028
920
|
}> {
|
|
1029
921
|
}
|
|
1030
922
|
|
|
1031
|
-
|
|
1032
|
-
* @internal
|
|
1033
|
-
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
1034
|
-
*
|
|
1035
|
-
* @privateRemarks
|
|
1036
|
-
* This base constant must remain a named export so that api-extractor can
|
|
1037
|
-
* resolve the extends clause of {@link FreshnessError} to a stable declaration.
|
|
1038
|
-
* Without it the bundled `.d.ts` would contain an anonymous `_base` symbol
|
|
1039
|
-
* that cannot be referenced by downstream consumers.
|
|
1040
|
-
*/
|
|
1041
|
-
export declare const FreshnessErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
923
|
+
declare const FreshnessError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
1042
924
|
readonly _tag: "FreshnessError";
|
|
1043
925
|
} & Readonly<A>;
|
|
1044
926
|
|
|
@@ -1142,7 +1024,7 @@ export declare interface GitHubAppAuthConfig {
|
|
|
1142
1024
|
export declare const GitHubAutoAuth: Layer.Layer<OctokitInstance, AuthenticationError>;
|
|
1143
1025
|
|
|
1144
1026
|
/**
|
|
1145
|
-
* Service
|
|
1027
|
+
* Service for GitHub REST API operations used by the version
|
|
1146
1028
|
* fetcher services.
|
|
1147
1029
|
*
|
|
1148
1030
|
* Abstracts over pagination and authentication so that higher-level services
|
|
@@ -1151,13 +1033,33 @@ export declare const GitHubAutoAuth: Layer.Layer<OctokitInstance, Authentication
|
|
|
1151
1033
|
* transport. The live implementation is provided by {@link GitHubClientLive}
|
|
1152
1034
|
* and requires an {@link OctokitInstance} in its dependency graph.
|
|
1153
1035
|
*
|
|
1036
|
+
* @example
|
|
1037
|
+
* ```typescript
|
|
1038
|
+
* import type { GitHubTag } from "runtime-resolver";
|
|
1039
|
+
* import { GitHubClient, GitHubClientLive, GitHubAutoAuth } from "runtime-resolver";
|
|
1040
|
+
* import { Effect } from "effect";
|
|
1041
|
+
*
|
|
1042
|
+
* const program = Effect.gen(function* () {
|
|
1043
|
+
* const client = yield* GitHubClient;
|
|
1044
|
+
* const tags = yield* client.listTags("oven-sh", "bun", { perPage: 100 });
|
|
1045
|
+
* console.log(`Found ${tags.length} tags`);
|
|
1046
|
+
* });
|
|
1047
|
+
*
|
|
1048
|
+
* Effect.runPromise(
|
|
1049
|
+
* program.pipe(Effect.provide(GitHubClientLive), Effect.provide(GitHubAutoAuth)),
|
|
1050
|
+
* );
|
|
1051
|
+
* ```
|
|
1052
|
+
*
|
|
1154
1053
|
* @see {@link GitHubClientLive}
|
|
1155
1054
|
* @see {@link OctokitInstance}
|
|
1156
1055
|
* @see {@link ListOptions}
|
|
1157
1056
|
*
|
|
1158
1057
|
* @public
|
|
1159
1058
|
*/
|
|
1160
|
-
export declare
|
|
1059
|
+
export declare class GitHubClient extends GitHubClient_base {
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
declare const GitHubClient_base: Context.TagClass<GitHubClient, "runtime-resolver/GitHubClient", {
|
|
1161
1063
|
/**
|
|
1162
1064
|
* Lists all git tags for the given repository, automatically paginating
|
|
1163
1065
|
* through results according to `options`.
|
|
@@ -1172,7 +1074,16 @@ export declare interface GitHubClient {
|
|
|
1172
1074
|
* @param repo - Repository name (e.g. `"bun"`).
|
|
1173
1075
|
* @param options - Optional pagination controls.
|
|
1174
1076
|
*/
|
|
1175
|
-
readonly listTags: (owner: string, repo: string, options?: ListOptions) => Effect.Effect<
|
|
1077
|
+
readonly listTags: (owner: string, repo: string, options?: ListOptions | undefined) => Effect.Effect<readonly {
|
|
1078
|
+
readonly name: string;
|
|
1079
|
+
readonly zipball_url: string;
|
|
1080
|
+
readonly tarball_url: string;
|
|
1081
|
+
readonly commit: {
|
|
1082
|
+
readonly sha: string;
|
|
1083
|
+
readonly url: string;
|
|
1084
|
+
};
|
|
1085
|
+
readonly node_id: string;
|
|
1086
|
+
}[], AuthenticationError | NetworkError | ParseError | RateLimitError, never>;
|
|
1176
1087
|
/**
|
|
1177
1088
|
* Lists all GitHub Releases for the given repository, automatically
|
|
1178
1089
|
* paginating through results according to `options`.
|
|
@@ -1187,7 +1098,13 @@ export declare interface GitHubClient {
|
|
|
1187
1098
|
* @param repo - Repository name (e.g. `"deno"`).
|
|
1188
1099
|
* @param options - Optional pagination controls.
|
|
1189
1100
|
*/
|
|
1190
|
-
readonly listReleases: (owner: string, repo: string, options?: ListOptions) => Effect.Effect<
|
|
1101
|
+
readonly listReleases: (owner: string, repo: string, options?: ListOptions | undefined) => Effect.Effect<readonly {
|
|
1102
|
+
readonly tag_name: string;
|
|
1103
|
+
readonly name: string | null;
|
|
1104
|
+
readonly draft: boolean;
|
|
1105
|
+
readonly prerelease: boolean;
|
|
1106
|
+
readonly published_at: string | null;
|
|
1107
|
+
}[], AuthenticationError | NetworkError | ParseError | RateLimitError, never>;
|
|
1191
1108
|
/**
|
|
1192
1109
|
* Fetches arbitrary JSON from `url` and decodes it with the provided
|
|
1193
1110
|
* schema, returning the typed result.
|
|
@@ -1205,41 +1122,9 @@ export declare interface GitHubClient {
|
|
|
1205
1122
|
* Effect Schema's `decodeUnknown`.
|
|
1206
1123
|
*/
|
|
1207
1124
|
readonly getJson: <A>(url: string, schema: {
|
|
1208
|
-
readonly decode: (input: unknown) => Effect.Effect<A, ParseError>;
|
|
1209
|
-
}) => Effect.Effect<A, NetworkError | ParseError>;
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1212
|
-
/**
|
|
1213
|
-
* Service tag and companion object for {@link GitHubClient}.
|
|
1214
|
-
*
|
|
1215
|
-
* Acts as both the TypeScript service interface and the Effect dependency tag
|
|
1216
|
-
* used for dependency injection (companion object pattern). Yield this tag
|
|
1217
|
-
* inside `Effect.gen` to access the client implementation provided by
|
|
1218
|
-
* {@link GitHubClientLive}.
|
|
1219
|
-
*
|
|
1220
|
-
* @example
|
|
1221
|
-
* ```typescript
|
|
1222
|
-
* import type { GitHubTag } from "runtime-resolver";
|
|
1223
|
-
* import { GitHubClient, GitHubClientLive, GitHubAutoAuth } from "runtime-resolver";
|
|
1224
|
-
* import { Effect } from "effect";
|
|
1225
|
-
*
|
|
1226
|
-
* const program = Effect.gen(function* () {
|
|
1227
|
-
* const client = yield* GitHubClient;
|
|
1228
|
-
* const tags = yield* client.listTags("oven-sh", "bun", { perPage: 100 });
|
|
1229
|
-
* console.log(`Found ${tags.length} tags`);
|
|
1230
|
-
* });
|
|
1231
|
-
*
|
|
1232
|
-
* Effect.runPromise(
|
|
1233
|
-
* program.pipe(Effect.provide(GitHubClientLive), Effect.provide(GitHubAutoAuth)),
|
|
1234
|
-
* );
|
|
1235
|
-
* ```
|
|
1236
|
-
*
|
|
1237
|
-
* @see {@link GitHubClientLive}
|
|
1238
|
-
* @see {@link OctokitInstance}
|
|
1239
|
-
*
|
|
1240
|
-
* @public
|
|
1241
|
-
*/
|
|
1242
|
-
export declare const GitHubClient: Context.Tag<GitHubClient, GitHubClient>;
|
|
1125
|
+
readonly decode: (input: unknown) => Effect.Effect<A, ParseError, never>;
|
|
1126
|
+
}) => Effect.Effect<A, NetworkError | ParseError, never>;
|
|
1127
|
+
}>;
|
|
1243
1128
|
|
|
1244
1129
|
/**
|
|
1245
1130
|
* Provides the {@link GitHubClient} service backed by an {@link OctokitInstance}.
|
|
@@ -1408,24 +1293,14 @@ export declare type Increments = typeof Increments.Type;
|
|
|
1408
1293
|
*
|
|
1409
1294
|
* @public
|
|
1410
1295
|
*/
|
|
1411
|
-
export declare class InvalidInputError extends
|
|
1296
|
+
export declare class InvalidInputError extends InvalidInputError_base<{
|
|
1412
1297
|
readonly field: string;
|
|
1413
1298
|
readonly value: string;
|
|
1414
1299
|
readonly message: string;
|
|
1415
1300
|
}> {
|
|
1416
1301
|
}
|
|
1417
1302
|
|
|
1418
|
-
|
|
1419
|
-
* @internal
|
|
1420
|
-
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
1421
|
-
*
|
|
1422
|
-
* @privateRemarks
|
|
1423
|
-
* This base constant must remain a named export so that api-extractor can
|
|
1424
|
-
* resolve the extends clause of {@link InvalidInputError} to a stable
|
|
1425
|
-
* declaration. Without it the bundled `.d.ts` would contain an anonymous
|
|
1426
|
-
* `_base` symbol that cannot be referenced by downstream consumers.
|
|
1427
|
-
*/
|
|
1428
|
-
export declare const InvalidInputErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
1303
|
+
declare const InvalidInputError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
1429
1304
|
readonly _tag: "InvalidInputError";
|
|
1430
1305
|
} & Readonly<A>;
|
|
1431
1306
|
|
|
@@ -1476,24 +1351,14 @@ export declare interface ListOptions {
|
|
|
1476
1351
|
*
|
|
1477
1352
|
* @public
|
|
1478
1353
|
*/
|
|
1479
|
-
export declare class NetworkError extends
|
|
1354
|
+
export declare class NetworkError extends NetworkError_base<{
|
|
1480
1355
|
readonly url: string;
|
|
1481
1356
|
readonly status?: number;
|
|
1482
1357
|
readonly message: string;
|
|
1483
1358
|
}> {
|
|
1484
1359
|
}
|
|
1485
1360
|
|
|
1486
|
-
|
|
1487
|
-
* @internal
|
|
1488
|
-
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
1489
|
-
*
|
|
1490
|
-
* @privateRemarks
|
|
1491
|
-
* This base constant must remain a named export so that api-extractor can
|
|
1492
|
-
* resolve the extends clause of {@link NetworkError} to a stable declaration.
|
|
1493
|
-
* Without it the bundled `.d.ts` would contain an anonymous `_base` symbol
|
|
1494
|
-
* that cannot be referenced by downstream consumers.
|
|
1495
|
-
*/
|
|
1496
|
-
export declare const NetworkErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
1361
|
+
declare const NetworkError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
1497
1362
|
readonly _tag: "NetworkError";
|
|
1498
1363
|
} & Readonly<A>;
|
|
1499
1364
|
|
|
@@ -1570,12 +1435,12 @@ export declare type NodePhase = typeof NodePhase.Type;
|
|
|
1570
1435
|
* @public
|
|
1571
1436
|
*/
|
|
1572
1437
|
export declare class NodeRelease {
|
|
1573
|
-
readonly version: SemVer
|
|
1574
|
-
readonly npm: SemVer
|
|
1438
|
+
readonly version: SemVer;
|
|
1439
|
+
readonly npm: SemVer;
|
|
1575
1440
|
readonly date: DateTime.DateTime;
|
|
1576
1441
|
readonly scheduleRef: Ref.Ref<NodeSchedule>;
|
|
1577
1442
|
readonly _tag: "NodeRelease";
|
|
1578
|
-
constructor(version: SemVer
|
|
1443
|
+
constructor(version: SemVer, npm: SemVer, date: DateTime.DateTime, scheduleRef: Ref.Ref<NodeSchedule>);
|
|
1579
1444
|
/**
|
|
1580
1445
|
* Determine this release's lifecycle phase at the given point in time.
|
|
1581
1446
|
*
|
|
@@ -1601,7 +1466,7 @@ export declare class NodeRelease {
|
|
|
1601
1466
|
/**
|
|
1602
1467
|
* Create a {@link NodeRelease} from lean string inputs.
|
|
1603
1468
|
*
|
|
1604
|
-
* Parses `input.version` and `input.npm` via `SemVer.
|
|
1469
|
+
* Parses `input.version` and `input.npm` via `SemVer.parse` and
|
|
1605
1470
|
* constructs the publication date with `DateTime.unsafeMake`.
|
|
1606
1471
|
*
|
|
1607
1472
|
* @param input - A {@link NodeReleaseInput} object with raw string fields.
|
|
@@ -1617,16 +1482,9 @@ export declare class NodeRelease {
|
|
|
1617
1482
|
* additional operations for lifecycle schedule data and LTS / current
|
|
1618
1483
|
* release filtering.
|
|
1619
1484
|
*
|
|
1620
|
-
* Unlike the Bun and Deno equivalents this
|
|
1485
|
+
* Unlike the Bun and Deno equivalents this service is not a plain type alias
|
|
1621
1486
|
* — it adds four Node-specific methods on top of the generic cache contract.
|
|
1622
1487
|
*
|
|
1623
|
-
* @see {@link NodeRelease}
|
|
1624
|
-
* @see {@link NodeScheduleData}
|
|
1625
|
-
* @see {@link RuntimeCache}
|
|
1626
|
-
* @see {@link AutoNodeCacheLive}
|
|
1627
|
-
* @see {@link FreshNodeCacheLive}
|
|
1628
|
-
* @see {@link OfflineNodeCacheLive}
|
|
1629
|
-
*
|
|
1630
1488
|
* @example
|
|
1631
1489
|
* ```typescript
|
|
1632
1490
|
* import type { NodeRelease } from "runtime-resolver";
|
|
@@ -1644,9 +1502,19 @@ export declare class NodeRelease {
|
|
|
1644
1502
|
* Effect.runPromise(program.pipe(Effect.provide(OfflineNodeCacheLive)));
|
|
1645
1503
|
* ```
|
|
1646
1504
|
*
|
|
1505
|
+
* @see {@link NodeRelease}
|
|
1506
|
+
* @see {@link NodeScheduleData}
|
|
1507
|
+
* @see {@link RuntimeCache}
|
|
1508
|
+
* @see {@link AutoNodeCacheLive}
|
|
1509
|
+
* @see {@link FreshNodeCacheLive}
|
|
1510
|
+
* @see {@link OfflineNodeCacheLive}
|
|
1511
|
+
*
|
|
1647
1512
|
* @public
|
|
1648
1513
|
*/
|
|
1649
|
-
export declare
|
|
1514
|
+
export declare class NodeReleaseCache extends NodeReleaseCache_base {
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
declare const NodeReleaseCache_base: Context.TagClass<NodeReleaseCache, "runtime-resolver/NodeReleaseCache", RuntimeCache<NodeRelease> & {
|
|
1650
1518
|
/**
|
|
1651
1519
|
* Merges Node.js release-schedule data into the cache, updating lifecycle
|
|
1652
1520
|
* phase information (LTS dates, end-of-life dates, etc.) for every major
|
|
@@ -1657,7 +1525,7 @@ export declare interface NodeReleaseCache extends RuntimeCache<NodeRelease> {
|
|
|
1657
1525
|
*
|
|
1658
1526
|
* @see {@link NodeScheduleData}
|
|
1659
1527
|
*/
|
|
1660
|
-
readonly updateSchedule: (data: NodeScheduleData) => Effect.Effect<void>;
|
|
1528
|
+
readonly updateSchedule: (data: NodeScheduleData) => Effect.Effect<void, never, never>;
|
|
1661
1529
|
/**
|
|
1662
1530
|
* Populates the cache from raw {@link NodeReleaseInput} records (as
|
|
1663
1531
|
* returned by the Node.js release index JSON) rather than from already-
|
|
@@ -1670,7 +1538,11 @@ export declare interface NodeReleaseCache extends RuntimeCache<NodeRelease> {
|
|
|
1670
1538
|
*
|
|
1671
1539
|
* @see {@link NodeReleaseInput}
|
|
1672
1540
|
*/
|
|
1673
|
-
readonly loadFromInputs: (inputs:
|
|
1541
|
+
readonly loadFromInputs: (inputs: readonly {
|
|
1542
|
+
readonly version: string;
|
|
1543
|
+
readonly npm: string;
|
|
1544
|
+
readonly date: string;
|
|
1545
|
+
}[]) => Effect.Effect<void, never, never>;
|
|
1674
1546
|
/**
|
|
1675
1547
|
* Returns all cached releases whose lifecycle phase is `"active-lts"` or
|
|
1676
1548
|
* `"maintenance-lts"` as of the given point in time.
|
|
@@ -1681,7 +1553,7 @@ export declare interface NodeReleaseCache extends RuntimeCache<NodeRelease> {
|
|
|
1681
1553
|
*
|
|
1682
1554
|
* @see {@link NodeRelease}
|
|
1683
1555
|
*/
|
|
1684
|
-
readonly ltsReleases: (now?: DateTime.DateTime) => Effect.Effect<
|
|
1556
|
+
readonly ltsReleases: (now?: DateTime.DateTime | undefined) => Effect.Effect<readonly NodeRelease[], never, never>;
|
|
1685
1557
|
/**
|
|
1686
1558
|
* Returns all cached releases whose lifecycle phase is `"current"` as of
|
|
1687
1559
|
* the given point in time.
|
|
@@ -1692,24 +1564,8 @@ export declare interface NodeReleaseCache extends RuntimeCache<NodeRelease> {
|
|
|
1692
1564
|
*
|
|
1693
1565
|
* @see {@link NodeRelease}
|
|
1694
1566
|
*/
|
|
1695
|
-
readonly currentReleases: (now?: DateTime.DateTime) => Effect.Effect<
|
|
1696
|
-
}
|
|
1697
|
-
|
|
1698
|
-
/**
|
|
1699
|
-
* Service tag and companion object for {@link NodeReleaseCache}.
|
|
1700
|
-
*
|
|
1701
|
-
* Acts as both the TypeScript service interface and the Effect dependency tag
|
|
1702
|
-
* used for dependency injection (companion object pattern). Yield this tag
|
|
1703
|
-
* inside `Effect.gen` to access the cache implementation supplied by one of
|
|
1704
|
-
* the Node cache layers.
|
|
1705
|
-
*
|
|
1706
|
-
* @see {@link AutoNodeCacheLive}
|
|
1707
|
-
* @see {@link FreshNodeCacheLive}
|
|
1708
|
-
* @see {@link OfflineNodeCacheLive}
|
|
1709
|
-
*
|
|
1710
|
-
* @public
|
|
1711
|
-
*/
|
|
1712
|
-
export declare const NodeReleaseCache: Context.Tag<NodeReleaseCache, NodeReleaseCache>;
|
|
1567
|
+
readonly currentReleases: (now?: DateTime.DateTime | undefined) => Effect.Effect<readonly NodeRelease[], never, never>;
|
|
1568
|
+
}>;
|
|
1713
1569
|
|
|
1714
1570
|
/**
|
|
1715
1571
|
* Low-level layer that constructs the {@link NodeReleaseCache} service backed by
|
|
@@ -1740,7 +1596,7 @@ export declare const NodeReleaseCacheLive: Layer.Layer<NodeReleaseCache, never,
|
|
|
1740
1596
|
* bundled default data files and the Node.js dist API response.
|
|
1741
1597
|
*
|
|
1742
1598
|
* The `version` and `npm` fields are raw version strings validated by
|
|
1743
|
-
* `SemVer.
|
|
1599
|
+
* `SemVer.parse`; `date` is a date string accepted by
|
|
1744
1600
|
* `DateTime.unsafeMake`.
|
|
1745
1601
|
*
|
|
1746
1602
|
* @see {@link NodeRelease.fromInput}
|
|
@@ -1764,45 +1620,13 @@ export declare const NodeReleaseInput: Schema.Struct<{
|
|
|
1764
1620
|
export declare type NodeReleaseInput = typeof NodeReleaseInput.Type;
|
|
1765
1621
|
|
|
1766
1622
|
/**
|
|
1767
|
-
* Service
|
|
1623
|
+
* Service for resolving Node.js runtime versions against the cached
|
|
1768
1624
|
* release index.
|
|
1769
1625
|
*
|
|
1770
1626
|
* Unlike {@link BunResolver} and {@link DenoResolver}, this service is
|
|
1771
1627
|
* lifecycle-aware: results can be filtered by {@link NodePhase} and evaluated
|
|
1772
1628
|
* against a specific reference date.
|
|
1773
1629
|
*
|
|
1774
|
-
* @see {@link NodeResolverLive}
|
|
1775
|
-
* @see {@link resolveNode}
|
|
1776
|
-
* @see {@link NodeResolverOptions}
|
|
1777
|
-
* @see {@link ResolvedVersions}
|
|
1778
|
-
*
|
|
1779
|
-
* @public
|
|
1780
|
-
*/
|
|
1781
|
-
export declare interface NodeResolver {
|
|
1782
|
-
/**
|
|
1783
|
-
* Resolves Node.js versions according to `options` and returns a
|
|
1784
|
-
* {@link ResolvedVersions} object containing the matching version list,
|
|
1785
|
-
* the latest version string, optional LTS version string, and the data
|
|
1786
|
-
* source indicator.
|
|
1787
|
-
*
|
|
1788
|
-
* Fails with {@link NodeResolverError} when no version can be resolved and
|
|
1789
|
-
* no `defaultVersion` was provided.
|
|
1790
|
-
*
|
|
1791
|
-
* @param options - Optional resolution constraints.
|
|
1792
|
-
*
|
|
1793
|
-
* @see {@link NodeResolverOptions}
|
|
1794
|
-
*/
|
|
1795
|
-
readonly resolve: (options?: NodeResolverOptions) => Effect.Effect<ResolvedVersions, NodeResolverError>;
|
|
1796
|
-
}
|
|
1797
|
-
|
|
1798
|
-
/**
|
|
1799
|
-
* Service tag and companion object for {@link NodeResolver}.
|
|
1800
|
-
*
|
|
1801
|
-
* Acts as both the TypeScript service interface and the Effect dependency tag
|
|
1802
|
-
* used for dependency injection (companion object pattern). Yield this tag
|
|
1803
|
-
* inside `Effect.gen` to obtain the resolver implementation provided by
|
|
1804
|
-
* {@link NodeResolverLive}.
|
|
1805
|
-
*
|
|
1806
1630
|
* For a one-shot Promise-based API see {@link resolveNode}.
|
|
1807
1631
|
*
|
|
1808
1632
|
* @example
|
|
@@ -1827,10 +1651,36 @@ export declare interface NodeResolver {
|
|
|
1827
1651
|
*
|
|
1828
1652
|
* @see {@link NodeResolverLive}
|
|
1829
1653
|
* @see {@link resolveNode}
|
|
1654
|
+
* @see {@link NodeResolverOptions}
|
|
1655
|
+
* @see {@link ResolvedVersions}
|
|
1830
1656
|
*
|
|
1831
1657
|
* @public
|
|
1832
1658
|
*/
|
|
1833
|
-
export declare
|
|
1659
|
+
export declare class NodeResolver extends NodeResolver_base {
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
declare const NodeResolver_base: Context.TagClass<NodeResolver, "runtime-resolver/NodeResolver", {
|
|
1663
|
+
/**
|
|
1664
|
+
* Resolves Node.js versions according to `options` and returns a
|
|
1665
|
+
* {@link ResolvedVersions} object containing the matching version list,
|
|
1666
|
+
* the latest version string, optional LTS version string, and the data
|
|
1667
|
+
* source indicator.
|
|
1668
|
+
*
|
|
1669
|
+
* Fails with {@link NodeResolverError} when no version can be resolved and
|
|
1670
|
+
* no `defaultVersion` was provided.
|
|
1671
|
+
*
|
|
1672
|
+
* @param options - Optional resolution constraints.
|
|
1673
|
+
*
|
|
1674
|
+
* @see {@link NodeResolverOptions}
|
|
1675
|
+
*/
|
|
1676
|
+
readonly resolve: (options?: NodeResolverOptions | undefined) => Effect.Effect<{
|
|
1677
|
+
readonly source: "api" | "cache";
|
|
1678
|
+
readonly versions: readonly string[];
|
|
1679
|
+
readonly latest: string;
|
|
1680
|
+
readonly lts?: string | undefined;
|
|
1681
|
+
readonly default?: string | undefined;
|
|
1682
|
+
}, VersionNotFoundError, never>;
|
|
1683
|
+
}>;
|
|
1834
1684
|
|
|
1835
1685
|
/**
|
|
1836
1686
|
* Union of all typed errors that {@link NodeResolver.resolve} can fail with.
|
|
@@ -1998,7 +1848,7 @@ export declare interface NodeResolverOptions {
|
|
|
1998
1848
|
*
|
|
1999
1849
|
* @public
|
|
2000
1850
|
*/
|
|
2001
|
-
export declare class NodeSchedule extends
|
|
1851
|
+
export declare class NodeSchedule extends NodeSchedule_base<{
|
|
2002
1852
|
readonly entries: ReadonlyArray<NodeScheduleEntry>;
|
|
2003
1853
|
}> {
|
|
2004
1854
|
/**
|
|
@@ -2032,22 +1882,7 @@ export declare class NodeSchedule extends NodeScheduleBase<{
|
|
|
2032
1882
|
entryFor(major: number): Option.Option<NodeScheduleEntry>;
|
|
2033
1883
|
}
|
|
2034
1884
|
|
|
2035
|
-
|
|
2036
|
-
* @internal
|
|
2037
|
-
*
|
|
2038
|
-
* Exported for declaration bundling (api-extractor). When `export *`
|
|
2039
|
-
* re-exports a class whose `extends` expression is an inline call like
|
|
2040
|
-
* `Data.TaggedClass(...)`, TypeScript emits an un-nameable `_base` symbol in
|
|
2041
|
-
* the declaration file. Splitting the base into a named export gives the
|
|
2042
|
-
* bundler a stable reference.
|
|
2043
|
-
*
|
|
2044
|
-
* @privateRemarks
|
|
2045
|
-
* This base constant must remain a named export so that api-extractor can
|
|
2046
|
-
* resolve the extends clause of {@link NodeSchedule} to a stable declaration.
|
|
2047
|
-
* Without it the bundled `.d.ts` would contain an anonymous `_base` symbol
|
|
2048
|
-
* that cannot be referenced by downstream consumers.
|
|
2049
|
-
*/
|
|
2050
|
-
export declare const NodeScheduleBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => Readonly<A> & {
|
|
1885
|
+
declare const NodeSchedule_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => Readonly<A> & {
|
|
2051
1886
|
readonly _tag: "NodeSchedule";
|
|
2052
1887
|
};
|
|
2053
1888
|
|
|
@@ -2094,41 +1929,13 @@ export declare interface NodeScheduleEntry {
|
|
|
2094
1929
|
}
|
|
2095
1930
|
|
|
2096
1931
|
/**
|
|
2097
|
-
* Service
|
|
1932
|
+
* Service for fetching the official Node.js release schedule.
|
|
2098
1933
|
*
|
|
2099
1934
|
* The schedule maps each major release line to its LTS start date and
|
|
2100
1935
|
* end-of-life date, and is used by {@link NodeReleaseCache} to assign
|
|
2101
1936
|
* lifecycle phases to individual releases. The live implementation fetches
|
|
2102
1937
|
* from the `nodejs/Release` GitHub repository via a plain HTTP request.
|
|
2103
1938
|
*
|
|
2104
|
-
* @see {@link NodeScheduleFetcherLive}
|
|
2105
|
-
* @see {@link NodeReleaseCache}
|
|
2106
|
-
* @see {@link NodeScheduleData}
|
|
2107
|
-
* @see {@link NetworkError}
|
|
2108
|
-
* @see {@link ParseError}
|
|
2109
|
-
*
|
|
2110
|
-
* @public
|
|
2111
|
-
*/
|
|
2112
|
-
export declare interface NodeScheduleFetcher {
|
|
2113
|
-
/**
|
|
2114
|
-
* Fetches and decodes the Node.js release schedule JSON, returning a
|
|
2115
|
-
* typed {@link NodeScheduleData} map keyed by major release line.
|
|
2116
|
-
*
|
|
2117
|
-
* Fails with:
|
|
2118
|
-
* - {@link NetworkError} — the upstream request could not be completed.
|
|
2119
|
-
* - {@link ParseError} — the response payload could not be decoded.
|
|
2120
|
-
*/
|
|
2121
|
-
readonly fetch: () => Effect.Effect<NodeScheduleData, NetworkError | ParseError>;
|
|
2122
|
-
}
|
|
2123
|
-
|
|
2124
|
-
/**
|
|
2125
|
-
* Service tag and companion object for {@link NodeScheduleFetcher}.
|
|
2126
|
-
*
|
|
2127
|
-
* Acts as both the TypeScript service interface and the Effect dependency tag
|
|
2128
|
-
* used for dependency injection (companion object pattern). Yield this tag
|
|
2129
|
-
* inside `Effect.gen` to access the fetcher implementation provided by
|
|
2130
|
-
* {@link NodeScheduleFetcherLive}.
|
|
2131
|
-
*
|
|
2132
1939
|
* @example
|
|
2133
1940
|
* ```typescript
|
|
2134
1941
|
* import type { NodeScheduleData } from "runtime-resolver";
|
|
@@ -2145,10 +1952,27 @@ export declare interface NodeScheduleFetcher {
|
|
|
2145
1952
|
* ```
|
|
2146
1953
|
*
|
|
2147
1954
|
* @see {@link NodeScheduleFetcherLive}
|
|
1955
|
+
* @see {@link NodeReleaseCache}
|
|
1956
|
+
* @see {@link NodeScheduleData}
|
|
1957
|
+
* @see {@link NetworkError}
|
|
1958
|
+
* @see {@link ParseError}
|
|
2148
1959
|
*
|
|
2149
1960
|
* @public
|
|
2150
1961
|
*/
|
|
2151
|
-
export declare
|
|
1962
|
+
export declare class NodeScheduleFetcher extends NodeScheduleFetcher_base {
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
declare const NodeScheduleFetcher_base: Context.TagClass<NodeScheduleFetcher, "runtime-resolver/NodeScheduleFetcher", {
|
|
1966
|
+
/**
|
|
1967
|
+
* Fetches and decodes the Node.js release schedule JSON, returning a
|
|
1968
|
+
* typed {@link NodeScheduleData} map keyed by major release line.
|
|
1969
|
+
*
|
|
1970
|
+
* Fails with:
|
|
1971
|
+
* - {@link NetworkError} — the upstream request could not be completed.
|
|
1972
|
+
* - {@link ParseError} — the response payload could not be decoded.
|
|
1973
|
+
*/
|
|
1974
|
+
readonly fetch: () => Effect.Effect<NodeScheduleData, NetworkError | ParseError, never>;
|
|
1975
|
+
}>;
|
|
2152
1976
|
|
|
2153
1977
|
/**
|
|
2154
1978
|
* Provides the {@link NodeScheduleFetcher} service using the live Node.js release schedule.
|
|
@@ -2171,7 +1995,7 @@ export declare const NodeScheduleFetcher: Context.Tag<NodeScheduleFetcher, NodeS
|
|
|
2171
1995
|
export declare const NodeScheduleFetcherLive: Layer.Layer<NodeScheduleFetcher, never, GitHubClient>;
|
|
2172
1996
|
|
|
2173
1997
|
/**
|
|
2174
|
-
* Service
|
|
1998
|
+
* Service for fetching Node.js release data from the official
|
|
2175
1999
|
* Node.js distribution index.
|
|
2176
2000
|
*
|
|
2177
2001
|
* Retrieves both the parsed semver version list and the raw
|
|
@@ -2180,37 +2004,6 @@ export declare const NodeScheduleFetcherLive: Layer.Layer<NodeScheduleFetcher, n
|
|
|
2180
2004
|
* `https://nodejs.org/dist/index.json` via a plain HTTP request — no GitHub
|
|
2181
2005
|
* credentials are required.
|
|
2182
2006
|
*
|
|
2183
|
-
* @see {@link NodeVersionFetcherLive}
|
|
2184
|
-
* @see {@link NodeReleaseCache}
|
|
2185
|
-
* @see {@link NetworkError}
|
|
2186
|
-
* @see {@link ParseError}
|
|
2187
|
-
*
|
|
2188
|
-
* @public
|
|
2189
|
-
*/
|
|
2190
|
-
export declare interface NodeVersionFetcher {
|
|
2191
|
-
/**
|
|
2192
|
-
* Fetches all available Node.js releases from the distribution index and
|
|
2193
|
-
* returns both the parsed semver version objects and the raw release input
|
|
2194
|
-
* records.
|
|
2195
|
-
*
|
|
2196
|
-
* Fails with:
|
|
2197
|
-
* - {@link NetworkError} — the upstream request could not be completed.
|
|
2198
|
-
* - {@link ParseError} — the response payload could not be decoded.
|
|
2199
|
-
*/
|
|
2200
|
-
readonly fetch: () => Effect.Effect<{
|
|
2201
|
-
readonly versions: ReadonlyArray<SemVer.SemVer>;
|
|
2202
|
-
readonly inputs: ReadonlyArray<NodeReleaseInput>;
|
|
2203
|
-
}, NetworkError | ParseError>;
|
|
2204
|
-
}
|
|
2205
|
-
|
|
2206
|
-
/**
|
|
2207
|
-
* Service tag and companion object for {@link NodeVersionFetcher}.
|
|
2208
|
-
*
|
|
2209
|
-
* Acts as both the TypeScript service interface and the Effect dependency tag
|
|
2210
|
-
* used for dependency injection (companion object pattern). Yield this tag
|
|
2211
|
-
* inside `Effect.gen` to access the fetcher implementation provided by
|
|
2212
|
-
* {@link NodeVersionFetcherLive}.
|
|
2213
|
-
*
|
|
2214
2007
|
* @example
|
|
2215
2008
|
* ```typescript
|
|
2216
2009
|
* import type { NodeReleaseInput } from "runtime-resolver";
|
|
@@ -2227,10 +2020,34 @@ export declare interface NodeVersionFetcher {
|
|
|
2227
2020
|
* ```
|
|
2228
2021
|
*
|
|
2229
2022
|
* @see {@link NodeVersionFetcherLive}
|
|
2023
|
+
* @see {@link NodeReleaseCache}
|
|
2024
|
+
* @see {@link NetworkError}
|
|
2025
|
+
* @see {@link ParseError}
|
|
2230
2026
|
*
|
|
2231
2027
|
* @public
|
|
2232
2028
|
*/
|
|
2233
|
-
export declare
|
|
2029
|
+
export declare class NodeVersionFetcher extends NodeVersionFetcher_base {
|
|
2030
|
+
}
|
|
2031
|
+
|
|
2032
|
+
declare const NodeVersionFetcher_base: Context.TagClass<NodeVersionFetcher, "runtime-resolver/NodeVersionFetcher", {
|
|
2033
|
+
/**
|
|
2034
|
+
* Fetches all available Node.js releases from the distribution index and
|
|
2035
|
+
* returns both the parsed semver version objects and the raw release input
|
|
2036
|
+
* records.
|
|
2037
|
+
*
|
|
2038
|
+
* Fails with:
|
|
2039
|
+
* - {@link NetworkError} — the upstream request could not be completed.
|
|
2040
|
+
* - {@link ParseError} — the response payload could not be decoded.
|
|
2041
|
+
*/
|
|
2042
|
+
readonly fetch: () => Effect.Effect<{
|
|
2043
|
+
readonly versions: readonly SemVer[];
|
|
2044
|
+
readonly inputs: readonly {
|
|
2045
|
+
readonly version: string;
|
|
2046
|
+
readonly npm: string;
|
|
2047
|
+
readonly date: string;
|
|
2048
|
+
}[];
|
|
2049
|
+
}, NetworkError | ParseError, never>;
|
|
2050
|
+
}>;
|
|
2234
2051
|
|
|
2235
2052
|
/**
|
|
2236
2053
|
* Provides the {@link NodeVersionFetcher} service using the live Node.js dist index.
|
|
@@ -2264,6 +2081,24 @@ export declare const NodeVersionFetcherLive: Layer.Layer<NodeVersionFetcher, nev
|
|
|
2264
2081
|
* three authentication layers: {@link GitHubTokenAuth}, {@link GitHubAppAuth},
|
|
2265
2082
|
* or {@link GitHubAutoAuth}.
|
|
2266
2083
|
*
|
|
2084
|
+
* @example
|
|
2085
|
+
* ```typescript
|
|
2086
|
+
* import { OctokitInstance, GitHubClientLive, GitHubAutoAuth } from "runtime-resolver";
|
|
2087
|
+
* import { Effect } from "effect";
|
|
2088
|
+
*
|
|
2089
|
+
* const program = Effect.gen(function* () {
|
|
2090
|
+
* const octokit = yield* OctokitInstance;
|
|
2091
|
+
* const response = await octokit.rest.repos.listTags({
|
|
2092
|
+
* owner: "oven-sh",
|
|
2093
|
+
* repo: "bun",
|
|
2094
|
+
* per_page: 10,
|
|
2095
|
+
* });
|
|
2096
|
+
* console.log(response.data.length);
|
|
2097
|
+
* });
|
|
2098
|
+
*
|
|
2099
|
+
* Effect.runPromise(program.pipe(Effect.provide(GitHubAutoAuth)));
|
|
2100
|
+
* ```
|
|
2101
|
+
*
|
|
2267
2102
|
* @see {@link GitHubClientLive}
|
|
2268
2103
|
* @see {@link GitHubTokenAuth}
|
|
2269
2104
|
* @see {@link GitHubAppAuth}
|
|
@@ -2271,7 +2106,10 @@ export declare const NodeVersionFetcherLive: Layer.Layer<NodeVersionFetcher, nev
|
|
|
2271
2106
|
*
|
|
2272
2107
|
* @public
|
|
2273
2108
|
*/
|
|
2274
|
-
export declare
|
|
2109
|
+
export declare class OctokitInstance extends OctokitInstance_base {
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
declare const OctokitInstance_base: Context.TagClass<OctokitInstance, "runtime-resolver/OctokitInstance", {
|
|
2275
2113
|
readonly rest: {
|
|
2276
2114
|
readonly repos: {
|
|
2277
2115
|
/**
|
|
@@ -2286,7 +2124,7 @@ export declare interface OctokitInstance {
|
|
|
2286
2124
|
per_page?: number;
|
|
2287
2125
|
page?: number;
|
|
2288
2126
|
}) => Promise<{
|
|
2289
|
-
data:
|
|
2127
|
+
data: unknown[];
|
|
2290
2128
|
}>;
|
|
2291
2129
|
/**
|
|
2292
2130
|
* Lists GitHub Releases for a repository, corresponding to
|
|
@@ -2300,50 +2138,11 @@ export declare interface OctokitInstance {
|
|
|
2300
2138
|
per_page?: number;
|
|
2301
2139
|
page?: number;
|
|
2302
2140
|
}) => Promise<{
|
|
2303
|
-
data:
|
|
2141
|
+
data: unknown[];
|
|
2304
2142
|
}>;
|
|
2305
2143
|
};
|
|
2306
2144
|
};
|
|
2307
|
-
}
|
|
2308
|
-
|
|
2309
|
-
/**
|
|
2310
|
-
* Service tag and companion object for {@link OctokitInstance}.
|
|
2311
|
-
*
|
|
2312
|
-
* Acts as both the TypeScript service interface and the Effect dependency tag
|
|
2313
|
-
* used for dependency injection (companion object pattern). This tag is
|
|
2314
|
-
* consumed internally by {@link GitHubClientLive} and is satisfied by
|
|
2315
|
-
* whichever authentication layer is provided — {@link GitHubTokenAuth},
|
|
2316
|
-
* {@link GitHubAppAuth}, or {@link GitHubAutoAuth}.
|
|
2317
|
-
*
|
|
2318
|
-
* Most application code should depend on {@link GitHubClient} rather than
|
|
2319
|
-
* this tag directly.
|
|
2320
|
-
*
|
|
2321
|
-
* @example
|
|
2322
|
-
* ```typescript
|
|
2323
|
-
* import { OctokitInstance, GitHubClientLive, GitHubAutoAuth } from "runtime-resolver";
|
|
2324
|
-
* import { Effect } from "effect";
|
|
2325
|
-
*
|
|
2326
|
-
* const program = Effect.gen(function* () {
|
|
2327
|
-
* const octokit = yield* OctokitInstance;
|
|
2328
|
-
* const response = await octokit.rest.repos.listTags({
|
|
2329
|
-
* owner: "oven-sh",
|
|
2330
|
-
* repo: "bun",
|
|
2331
|
-
* per_page: 10,
|
|
2332
|
-
* });
|
|
2333
|
-
* console.log(response.data.length);
|
|
2334
|
-
* });
|
|
2335
|
-
*
|
|
2336
|
-
* Effect.runPromise(program.pipe(Effect.provide(GitHubAutoAuth)));
|
|
2337
|
-
* ```
|
|
2338
|
-
*
|
|
2339
|
-
* @see {@link GitHubClientLive}
|
|
2340
|
-
* @see {@link GitHubTokenAuth}
|
|
2341
|
-
* @see {@link GitHubAppAuth}
|
|
2342
|
-
* @see {@link GitHubAutoAuth}
|
|
2343
|
-
*
|
|
2344
|
-
* @public
|
|
2345
|
-
*/
|
|
2346
|
-
export declare const OctokitInstance: Context.Tag<OctokitInstance, OctokitInstance>;
|
|
2145
|
+
}>;
|
|
2347
2146
|
|
|
2348
2147
|
/**
|
|
2349
2148
|
* Provides the {@link BunReleaseCache} service using the "Offline" cache strategy.
|
|
@@ -2440,23 +2239,13 @@ export declare const OfflineNodeCacheLive: Layer.Layer<NodeReleaseCache>;
|
|
|
2440
2239
|
*
|
|
2441
2240
|
* @public
|
|
2442
2241
|
*/
|
|
2443
|
-
export declare class ParseError extends
|
|
2242
|
+
export declare class ParseError extends ParseError_base<{
|
|
2444
2243
|
readonly source: string;
|
|
2445
2244
|
readonly message: string;
|
|
2446
2245
|
}> {
|
|
2447
2246
|
}
|
|
2448
2247
|
|
|
2449
|
-
|
|
2450
|
-
* @internal
|
|
2451
|
-
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
2452
|
-
*
|
|
2453
|
-
* @privateRemarks
|
|
2454
|
-
* This base constant must remain a named export so that api-extractor can
|
|
2455
|
-
* resolve the extends clause of {@link ParseError} to a stable declaration.
|
|
2456
|
-
* Without it the bundled `.d.ts` would contain an anonymous `_base` symbol
|
|
2457
|
-
* that cannot be referenced by downstream consumers.
|
|
2458
|
-
*/
|
|
2459
|
-
export declare const ParseErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
2248
|
+
declare const ParseError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
2460
2249
|
readonly _tag: "ParseError";
|
|
2461
2250
|
} & Readonly<A>;
|
|
2462
2251
|
|
|
@@ -2492,7 +2281,7 @@ export declare const ParseErrorBase: new <A extends Record<string, any> = {}>(ar
|
|
|
2492
2281
|
*
|
|
2493
2282
|
* @public
|
|
2494
2283
|
*/
|
|
2495
|
-
export declare class RateLimitError extends
|
|
2284
|
+
export declare class RateLimitError extends RateLimitError_base<{
|
|
2496
2285
|
readonly retryAfter?: number;
|
|
2497
2286
|
readonly limit: number;
|
|
2498
2287
|
readonly remaining: number;
|
|
@@ -2500,17 +2289,7 @@ export declare class RateLimitError extends RateLimitErrorBase<{
|
|
|
2500
2289
|
}> {
|
|
2501
2290
|
}
|
|
2502
2291
|
|
|
2503
|
-
|
|
2504
|
-
* @internal
|
|
2505
|
-
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
2506
|
-
*
|
|
2507
|
-
* @privateRemarks
|
|
2508
|
-
* This base constant must remain a named export so that api-extractor can
|
|
2509
|
-
* resolve the extends clause of {@link RateLimitError} to a stable declaration.
|
|
2510
|
-
* Without it the bundled `.d.ts` would contain an anonymous `_base` symbol
|
|
2511
|
-
* that cannot be referenced by downstream consumers.
|
|
2512
|
-
*/
|
|
2513
|
-
export declare const RateLimitErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
2292
|
+
declare const RateLimitError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
2514
2293
|
readonly _tag: "RateLimitError";
|
|
2515
2294
|
} & Readonly<A>;
|
|
2516
2295
|
|
|
@@ -2800,7 +2579,7 @@ export declare interface RuntimeCache<R extends RuntimeRelease> {
|
|
|
2800
2579
|
*/
|
|
2801
2580
|
export declare interface RuntimeRelease {
|
|
2802
2581
|
readonly _tag: string;
|
|
2803
|
-
readonly version: SemVer
|
|
2582
|
+
readonly version: SemVer;
|
|
2804
2583
|
readonly date: DateTime.DateTime;
|
|
2805
2584
|
}
|
|
2806
2585
|
|
|
@@ -2810,7 +2589,7 @@ export declare interface RuntimeRelease {
|
|
|
2810
2589
|
*
|
|
2811
2590
|
* Both Bun and Deno source their offline snapshots from JSON/TS data files
|
|
2812
2591
|
* whose entries conform to this shape. The `version` and `date` fields are
|
|
2813
|
-
* plain strings that are subsequently parsed by `SemVer.
|
|
2592
|
+
* plain strings that are subsequently parsed by `SemVer.parse` and
|
|
2814
2593
|
* `DateTime.unsafeMake` respectively.
|
|
2815
2594
|
*
|
|
2816
2595
|
* @see {@link BunRelease.fromInput}
|
|
@@ -2880,24 +2659,14 @@ export declare type Source = typeof Source.Type;
|
|
|
2880
2659
|
*
|
|
2881
2660
|
* @public
|
|
2882
2661
|
*/
|
|
2883
|
-
export declare class VersionNotFoundError extends
|
|
2662
|
+
export declare class VersionNotFoundError extends VersionNotFoundError_base<{
|
|
2884
2663
|
readonly runtime: Runtime;
|
|
2885
2664
|
readonly constraint: string;
|
|
2886
2665
|
readonly message: string;
|
|
2887
2666
|
}> {
|
|
2888
2667
|
}
|
|
2889
2668
|
|
|
2890
|
-
|
|
2891
|
-
* @internal
|
|
2892
|
-
* Exported for declaration bundling — see AuthenticationError.ts for details.
|
|
2893
|
-
*
|
|
2894
|
-
* @privateRemarks
|
|
2895
|
-
* This base constant must remain a named export so that api-extractor can
|
|
2896
|
-
* resolve the extends clause of {@link VersionNotFoundError} to a stable
|
|
2897
|
-
* declaration. Without it the bundled `.d.ts` would contain an anonymous
|
|
2898
|
-
* `_base` symbol that cannot be referenced by downstream consumers.
|
|
2899
|
-
*/
|
|
2900
|
-
export declare const VersionNotFoundErrorBase: new <A extends Record<string, any> = {}>(args: Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => YieldableError & {
|
|
2669
|
+
declare const VersionNotFoundError_base: new <A extends Record<string, any> = {}>(args: VoidIfEmpty< { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => YieldableError & {
|
|
2901
2670
|
readonly _tag: "VersionNotFoundError";
|
|
2902
2671
|
} & Readonly<A>;
|
|
2903
2672
|
|