runtime-resolver 0.2.0 → 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/{701.js → 711.js} +73 -49
- package/bin/runtime-resolver.js +4 -5
- package/index.d.ts +267 -563
- 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,29 @@ 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) => Effect.Effect<ResolvedVersions, BunResolverError>;
|
|
275
|
+
}>;
|
|
330
276
|
|
|
331
277
|
/**
|
|
332
278
|
* Union of all typed errors that {@link BunResolver.resolve} can fail with.
|
|
@@ -419,13 +365,30 @@ export declare interface BunResolverOptions {
|
|
|
419
365
|
}
|
|
420
366
|
|
|
421
367
|
/**
|
|
422
|
-
* Service
|
|
368
|
+
* Service for fetching Bun release data from the GitHub API.
|
|
423
369
|
*
|
|
424
370
|
* Retrieves both the parsed semver version list and the raw release input
|
|
425
371
|
* records needed to populate a {@link BunReleaseCache}. The live
|
|
426
372
|
* implementation queries the `oven-sh/bun` GitHub repository via
|
|
427
373
|
* {@link GitHubClient}.
|
|
428
374
|
*
|
|
375
|
+
* @example
|
|
376
|
+
* ```typescript
|
|
377
|
+
* import type { RuntimeReleaseInput } from "runtime-resolver";
|
|
378
|
+
* import { BunVersionFetcher, BunVersionFetcherLive, GitHubAutoAuth } from "runtime-resolver";
|
|
379
|
+
* import { Effect } from "effect";
|
|
380
|
+
*
|
|
381
|
+
* const program = Effect.gen(function* () {
|
|
382
|
+
* const fetcher = yield* BunVersionFetcher;
|
|
383
|
+
* const { versions, inputs } = yield* fetcher.fetch();
|
|
384
|
+
* console.log(`Fetched ${versions.length} Bun releases`);
|
|
385
|
+
* });
|
|
386
|
+
*
|
|
387
|
+
* Effect.runPromise(
|
|
388
|
+
* program.pipe(Effect.provide(BunVersionFetcherLive), Effect.provide(GitHubAutoAuth)),
|
|
389
|
+
* );
|
|
390
|
+
* ```
|
|
391
|
+
*
|
|
429
392
|
* @see {@link BunVersionFetcherLive}
|
|
430
393
|
* @see {@link BunReleaseCache}
|
|
431
394
|
* @see {@link AuthenticationError}
|
|
@@ -435,7 +398,10 @@ export declare interface BunResolverOptions {
|
|
|
435
398
|
*
|
|
436
399
|
* @public
|
|
437
400
|
*/
|
|
438
|
-
export declare
|
|
401
|
+
export declare class BunVersionFetcher extends BunVersionFetcher_base {
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
declare const BunVersionFetcher_base: Context.TagClass<BunVersionFetcher, "runtime-resolver/BunVersionFetcher", {
|
|
439
405
|
/**
|
|
440
406
|
* Fetches all available Bun releases from the GitHub API and returns both
|
|
441
407
|
* the parsed semver version objects and the raw release input records.
|
|
@@ -447,41 +413,10 @@ export declare interface BunVersionFetcher {
|
|
|
447
413
|
* - {@link RateLimitError} — the GitHub API rate limit was exceeded.
|
|
448
414
|
*/
|
|
449
415
|
readonly fetch: () => Effect.Effect<{
|
|
450
|
-
readonly versions: ReadonlyArray<SemVer
|
|
416
|
+
readonly versions: ReadonlyArray<SemVer>;
|
|
451
417
|
readonly inputs: ReadonlyArray<RuntimeReleaseInput>;
|
|
452
418
|
}, 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
|
-
* @example
|
|
464
|
-
* ```typescript
|
|
465
|
-
* import type { RuntimeReleaseInput } from "runtime-resolver";
|
|
466
|
-
* import { BunVersionFetcher, BunVersionFetcherLive, GitHubAutoAuth } from "runtime-resolver";
|
|
467
|
-
* import { Effect } from "effect";
|
|
468
|
-
*
|
|
469
|
-
* const program = Effect.gen(function* () {
|
|
470
|
-
* const fetcher = yield* BunVersionFetcher;
|
|
471
|
-
* const { versions, inputs } = yield* fetcher.fetch();
|
|
472
|
-
* console.log(`Fetched ${versions.length} Bun releases`);
|
|
473
|
-
* });
|
|
474
|
-
*
|
|
475
|
-
* Effect.runPromise(
|
|
476
|
-
* program.pipe(Effect.provide(BunVersionFetcherLive), Effect.provide(GitHubAutoAuth)),
|
|
477
|
-
* );
|
|
478
|
-
* ```
|
|
479
|
-
*
|
|
480
|
-
* @see {@link BunVersionFetcherLive}
|
|
481
|
-
*
|
|
482
|
-
* @public
|
|
483
|
-
*/
|
|
484
|
-
export declare const BunVersionFetcher: Context.Tag<BunVersionFetcher, BunVersionFetcher>;
|
|
419
|
+
}>;
|
|
485
420
|
|
|
486
421
|
/**
|
|
487
422
|
* Provides the {@link BunVersionFetcher} service using the live GitHub API.
|
|
@@ -527,23 +462,13 @@ export declare const BunVersionFetcherLive: Layer.Layer<BunVersionFetcher, never
|
|
|
527
462
|
*
|
|
528
463
|
* @public
|
|
529
464
|
*/
|
|
530
|
-
export declare class CacheError extends
|
|
465
|
+
export declare class CacheError extends CacheError_base<{
|
|
531
466
|
readonly operation: "read" | "write";
|
|
532
467
|
readonly message: string;
|
|
533
468
|
}> {
|
|
534
469
|
}
|
|
535
470
|
|
|
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 & {
|
|
471
|
+
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
472
|
readonly _tag: "CacheError";
|
|
548
473
|
} & Readonly<A>;
|
|
549
474
|
|
|
@@ -579,14 +504,14 @@ export declare const CacheErrorBase: new <A extends Record<string, any> = {}>(ar
|
|
|
579
504
|
export declare const createRuntimeCache: <R extends RuntimeRelease>() => Effect.Effect<RuntimeCache<R>, never, VersionCache>;
|
|
580
505
|
|
|
581
506
|
/**
|
|
582
|
-
* A Deno release entry with a parsed {@link SemVer
|
|
507
|
+
* A Deno release entry with a parsed {@link SemVer} version and an
|
|
583
508
|
* Effect {@link DateTime.DateTime} publication date.
|
|
584
509
|
*
|
|
585
510
|
* `DenoRelease` extends `Data.TaggedClass` so instances support structural
|
|
586
511
|
* equality comparison and can be used safely inside Effect data structures.
|
|
587
512
|
* Construct instances via the {@link DenoRelease.fromInput} factory rather than
|
|
588
513
|
* calling `new DenoRelease(...)` directly, as the factory validates the version
|
|
589
|
-
* string through `SemVer.
|
|
514
|
+
* string through `SemVer.parse`.
|
|
590
515
|
*
|
|
591
516
|
* @see {@link DenoReleaseCache}
|
|
592
517
|
* @see {@link DenoResolver}
|
|
@@ -611,14 +536,14 @@ export declare const createRuntimeCache: <R extends RuntimeRelease>() => Effect.
|
|
|
611
536
|
*
|
|
612
537
|
* @public
|
|
613
538
|
*/
|
|
614
|
-
export declare class DenoRelease extends
|
|
615
|
-
readonly version: SemVer
|
|
539
|
+
export declare class DenoRelease extends DenoRelease_base<{
|
|
540
|
+
readonly version: SemVer;
|
|
616
541
|
readonly date: DateTime.DateTime;
|
|
617
542
|
}> {
|
|
618
543
|
/**
|
|
619
544
|
* Create a {@link DenoRelease} from lean string inputs.
|
|
620
545
|
*
|
|
621
|
-
* Parses `input.version` via `SemVer.
|
|
546
|
+
* Parses `input.version` via `SemVer.parse` and constructs the
|
|
622
547
|
* publication date with `DateTime.unsafeMake`. Falls back to the current
|
|
623
548
|
* timestamp when `input.date` is an empty string (rare in production data).
|
|
624
549
|
*
|
|
@@ -629,46 +554,13 @@ export declare class DenoRelease extends DenoReleaseBase<{
|
|
|
629
554
|
static fromInput(input: RuntimeReleaseInput): Effect.Effect<DenoRelease, InvalidVersionError>;
|
|
630
555
|
}
|
|
631
556
|
|
|
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> & {
|
|
557
|
+
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
558
|
readonly _tag: "DenoRelease";
|
|
649
559
|
};
|
|
650
560
|
|
|
651
561
|
/**
|
|
652
562
|
* Specialisation of {@link RuntimeCache} for Deno release objects.
|
|
653
563
|
*
|
|
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
564
|
* @example
|
|
673
565
|
* ```typescript
|
|
674
566
|
* import type { DenoRelease } from "runtime-resolver";
|
|
@@ -684,13 +576,18 @@ export declare type DenoReleaseCache = RuntimeCache<DenoRelease>;
|
|
|
684
576
|
* Effect.runPromise(program.pipe(Effect.provide(OfflineDenoCacheLive)));
|
|
685
577
|
* ```
|
|
686
578
|
*
|
|
579
|
+
* @see {@link DenoRelease}
|
|
580
|
+
* @see {@link RuntimeCache}
|
|
687
581
|
* @see {@link AutoDenoCacheLive}
|
|
688
582
|
* @see {@link FreshDenoCacheLive}
|
|
689
583
|
* @see {@link OfflineDenoCacheLive}
|
|
690
584
|
*
|
|
691
585
|
* @public
|
|
692
586
|
*/
|
|
693
|
-
export declare
|
|
587
|
+
export declare class DenoReleaseCache extends DenoReleaseCache_base {
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
declare const DenoReleaseCache_base: Context.TagClass<DenoReleaseCache, "runtime-resolver/DenoReleaseCache", RuntimeCache<DenoRelease>>;
|
|
694
591
|
|
|
695
592
|
/**
|
|
696
593
|
* Low-level layer that constructs the {@link DenoReleaseCache} service backed by
|
|
@@ -711,40 +608,9 @@ export declare const DenoReleaseCache: Context.Tag<DenoReleaseCache, DenoRelease
|
|
|
711
608
|
export declare const DenoReleaseCacheLive: Layer.Layer<DenoReleaseCache, never, VersionCache>;
|
|
712
609
|
|
|
713
610
|
/**
|
|
714
|
-
* Service
|
|
611
|
+
* Service for resolving Deno runtime versions against the cached
|
|
715
612
|
* release index.
|
|
716
613
|
*
|
|
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
614
|
* For a one-shot Promise-based API see {@link resolveDeno}.
|
|
749
615
|
*
|
|
750
616
|
* @example
|
|
@@ -765,10 +631,29 @@ export declare interface DenoResolver {
|
|
|
765
631
|
*
|
|
766
632
|
* @see {@link DenoResolverLive}
|
|
767
633
|
* @see {@link resolveDeno}
|
|
634
|
+
* @see {@link DenoResolverOptions}
|
|
635
|
+
* @see {@link ResolvedVersions}
|
|
768
636
|
*
|
|
769
637
|
* @public
|
|
770
638
|
*/
|
|
771
|
-
export declare
|
|
639
|
+
export declare class DenoResolver extends DenoResolver_base {
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
declare const DenoResolver_base: Context.TagClass<DenoResolver, "runtime-resolver/DenoResolver", {
|
|
643
|
+
/**
|
|
644
|
+
* Resolves Deno versions according to `options` and returns a
|
|
645
|
+
* {@link ResolvedVersions} object containing the matching version list,
|
|
646
|
+
* the latest version string, and the data source indicator.
|
|
647
|
+
*
|
|
648
|
+
* Fails with {@link DenoResolverError} when no version can be resolved and
|
|
649
|
+
* no `defaultVersion` was provided.
|
|
650
|
+
*
|
|
651
|
+
* @param options - Optional resolution constraints.
|
|
652
|
+
*
|
|
653
|
+
* @see {@link DenoResolverOptions}
|
|
654
|
+
*/
|
|
655
|
+
readonly resolve: (options?: DenoResolverOptions) => Effect.Effect<ResolvedVersions, DenoResolverError>;
|
|
656
|
+
}>;
|
|
772
657
|
|
|
773
658
|
/**
|
|
774
659
|
* Union of all typed errors that {@link DenoResolver.resolve} can fail with.
|
|
@@ -860,13 +745,30 @@ export declare interface DenoResolverOptions {
|
|
|
860
745
|
}
|
|
861
746
|
|
|
862
747
|
/**
|
|
863
|
-
* Service
|
|
748
|
+
* Service for fetching Deno release data from the GitHub API.
|
|
864
749
|
*
|
|
865
750
|
* Retrieves both the parsed semver version list and the raw release input
|
|
866
751
|
* records needed to populate a {@link DenoReleaseCache}. The live
|
|
867
752
|
* implementation queries the `denoland/deno` GitHub repository via
|
|
868
753
|
* {@link GitHubClient}.
|
|
869
754
|
*
|
|
755
|
+
* @example
|
|
756
|
+
* ```typescript
|
|
757
|
+
* import type { RuntimeReleaseInput } from "runtime-resolver";
|
|
758
|
+
* import { DenoVersionFetcher, DenoVersionFetcherLive, GitHubAutoAuth } from "runtime-resolver";
|
|
759
|
+
* import { Effect } from "effect";
|
|
760
|
+
*
|
|
761
|
+
* const program = Effect.gen(function* () {
|
|
762
|
+
* const fetcher = yield* DenoVersionFetcher;
|
|
763
|
+
* const { versions, inputs } = yield* fetcher.fetch();
|
|
764
|
+
* console.log(`Fetched ${versions.length} Deno releases`);
|
|
765
|
+
* });
|
|
766
|
+
*
|
|
767
|
+
* Effect.runPromise(
|
|
768
|
+
* program.pipe(Effect.provide(DenoVersionFetcherLive), Effect.provide(GitHubAutoAuth)),
|
|
769
|
+
* );
|
|
770
|
+
* ```
|
|
771
|
+
*
|
|
870
772
|
* @see {@link DenoVersionFetcherLive}
|
|
871
773
|
* @see {@link DenoReleaseCache}
|
|
872
774
|
* @see {@link AuthenticationError}
|
|
@@ -876,7 +778,10 @@ export declare interface DenoResolverOptions {
|
|
|
876
778
|
*
|
|
877
779
|
* @public
|
|
878
780
|
*/
|
|
879
|
-
export declare
|
|
781
|
+
export declare class DenoVersionFetcher extends DenoVersionFetcher_base {
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
declare const DenoVersionFetcher_base: Context.TagClass<DenoVersionFetcher, "runtime-resolver/DenoVersionFetcher", {
|
|
880
785
|
/**
|
|
881
786
|
* Fetches all available Deno releases from the GitHub API and returns both
|
|
882
787
|
* the parsed semver version objects and the raw release input records.
|
|
@@ -888,41 +793,10 @@ export declare interface DenoVersionFetcher {
|
|
|
888
793
|
* - {@link RateLimitError} — the GitHub API rate limit was exceeded.
|
|
889
794
|
*/
|
|
890
795
|
readonly fetch: () => Effect.Effect<{
|
|
891
|
-
readonly versions: ReadonlyArray<SemVer
|
|
796
|
+
readonly versions: ReadonlyArray<SemVer>;
|
|
892
797
|
readonly inputs: ReadonlyArray<RuntimeReleaseInput>;
|
|
893
798
|
}, 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
|
-
* @example
|
|
905
|
-
* ```typescript
|
|
906
|
-
* import type { RuntimeReleaseInput } from "runtime-resolver";
|
|
907
|
-
* import { DenoVersionFetcher, DenoVersionFetcherLive, GitHubAutoAuth } from "runtime-resolver";
|
|
908
|
-
* import { Effect } from "effect";
|
|
909
|
-
*
|
|
910
|
-
* const program = Effect.gen(function* () {
|
|
911
|
-
* const fetcher = yield* DenoVersionFetcher;
|
|
912
|
-
* const { versions, inputs } = yield* fetcher.fetch();
|
|
913
|
-
* console.log(`Fetched ${versions.length} Deno releases`);
|
|
914
|
-
* });
|
|
915
|
-
*
|
|
916
|
-
* Effect.runPromise(
|
|
917
|
-
* program.pipe(Effect.provide(DenoVersionFetcherLive), Effect.provide(GitHubAutoAuth)),
|
|
918
|
-
* );
|
|
919
|
-
* ```
|
|
920
|
-
*
|
|
921
|
-
* @see {@link DenoVersionFetcherLive}
|
|
922
|
-
*
|
|
923
|
-
* @public
|
|
924
|
-
*/
|
|
925
|
-
export declare const DenoVersionFetcher: Context.Tag<DenoVersionFetcher, DenoVersionFetcher>;
|
|
799
|
+
}>;
|
|
926
800
|
|
|
927
801
|
/**
|
|
928
802
|
* Provides the {@link DenoVersionFetcher} service using the live GitHub API.
|
|
@@ -1022,23 +896,13 @@ export declare const FreshDenoCacheLive: Layer.Layer<DenoReleaseCache, Freshness
|
|
|
1022
896
|
*
|
|
1023
897
|
* @public
|
|
1024
898
|
*/
|
|
1025
|
-
export declare class FreshnessError extends
|
|
899
|
+
export declare class FreshnessError extends FreshnessError_base<{
|
|
1026
900
|
readonly strategy: "auto" | "api" | "cache";
|
|
1027
901
|
readonly message: string;
|
|
1028
902
|
}> {
|
|
1029
903
|
}
|
|
1030
904
|
|
|
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 & {
|
|
905
|
+
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
906
|
readonly _tag: "FreshnessError";
|
|
1043
907
|
} & Readonly<A>;
|
|
1044
908
|
|
|
@@ -1087,7 +951,7 @@ export declare const FreshNodeCacheLive: Layer.Layer<NodeReleaseCache, Freshness
|
|
|
1087
951
|
* @see {@link GitHubTokenAuth}
|
|
1088
952
|
* @public
|
|
1089
953
|
*/
|
|
1090
|
-
export declare const GitHubAppAuth: (config: GitHubAppAuthConfig) => Layer.Layer<OctokitInstance, AuthenticationError
|
|
954
|
+
export declare const GitHubAppAuth: (config: GitHubAppAuthConfig) => Layer.Layer<OctokitInstance, AuthenticationError>;
|
|
1091
955
|
|
|
1092
956
|
/**
|
|
1093
957
|
* Configuration required to authenticate as a GitHub App installation.
|
|
@@ -1142,7 +1006,7 @@ export declare interface GitHubAppAuthConfig {
|
|
|
1142
1006
|
export declare const GitHubAutoAuth: Layer.Layer<OctokitInstance, AuthenticationError>;
|
|
1143
1007
|
|
|
1144
1008
|
/**
|
|
1145
|
-
* Service
|
|
1009
|
+
* Service for GitHub REST API operations used by the version
|
|
1146
1010
|
* fetcher services.
|
|
1147
1011
|
*
|
|
1148
1012
|
* Abstracts over pagination and authentication so that higher-level services
|
|
@@ -1151,13 +1015,33 @@ export declare const GitHubAutoAuth: Layer.Layer<OctokitInstance, Authentication
|
|
|
1151
1015
|
* transport. The live implementation is provided by {@link GitHubClientLive}
|
|
1152
1016
|
* and requires an {@link OctokitInstance} in its dependency graph.
|
|
1153
1017
|
*
|
|
1018
|
+
* @example
|
|
1019
|
+
* ```typescript
|
|
1020
|
+
* import type { GitHubTag } from "runtime-resolver";
|
|
1021
|
+
* import { GitHubClient, GitHubClientLive, GitHubAutoAuth } from "runtime-resolver";
|
|
1022
|
+
* import { Effect } from "effect";
|
|
1023
|
+
*
|
|
1024
|
+
* const program = Effect.gen(function* () {
|
|
1025
|
+
* const client = yield* GitHubClient;
|
|
1026
|
+
* const tags = yield* client.listTags("oven-sh", "bun", { perPage: 100 });
|
|
1027
|
+
* console.log(`Found ${tags.length} tags`);
|
|
1028
|
+
* });
|
|
1029
|
+
*
|
|
1030
|
+
* Effect.runPromise(
|
|
1031
|
+
* program.pipe(Effect.provide(GitHubClientLive), Effect.provide(GitHubAutoAuth)),
|
|
1032
|
+
* );
|
|
1033
|
+
* ```
|
|
1034
|
+
*
|
|
1154
1035
|
* @see {@link GitHubClientLive}
|
|
1155
1036
|
* @see {@link OctokitInstance}
|
|
1156
1037
|
* @see {@link ListOptions}
|
|
1157
1038
|
*
|
|
1158
1039
|
* @public
|
|
1159
1040
|
*/
|
|
1160
|
-
export declare
|
|
1041
|
+
export declare class GitHubClient extends GitHubClient_base {
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
declare const GitHubClient_base: Context.TagClass<GitHubClient, "runtime-resolver/GitHubClient", {
|
|
1161
1045
|
/**
|
|
1162
1046
|
* Lists all git tags for the given repository, automatically paginating
|
|
1163
1047
|
* through results according to `options`.
|
|
@@ -1207,39 +1091,7 @@ export declare interface GitHubClient {
|
|
|
1207
1091
|
readonly getJson: <A>(url: string, schema: {
|
|
1208
1092
|
readonly decode: (input: unknown) => Effect.Effect<A, ParseError>;
|
|
1209
1093
|
}) => 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>;
|
|
1094
|
+
}>;
|
|
1243
1095
|
|
|
1244
1096
|
/**
|
|
1245
1097
|
* Provides the {@link GitHubClient} service backed by an {@link OctokitInstance}.
|
|
@@ -1361,7 +1213,7 @@ export declare const GitHubTokenAuth: Layer.Layer<OctokitInstance>;
|
|
|
1361
1213
|
* @see {@link GitHubAppAuth}
|
|
1362
1214
|
* @public
|
|
1363
1215
|
*/
|
|
1364
|
-
export declare const GitHubTokenAuthFromToken: (token: string) => Layer.Layer<OctokitInstance
|
|
1216
|
+
export declare const GitHubTokenAuthFromToken: (token: string) => Layer.Layer<OctokitInstance>;
|
|
1365
1217
|
|
|
1366
1218
|
/**
|
|
1367
1219
|
* Controls the granularity at which matching versions are grouped when a
|
|
@@ -1408,24 +1260,14 @@ export declare type Increments = typeof Increments.Type;
|
|
|
1408
1260
|
*
|
|
1409
1261
|
* @public
|
|
1410
1262
|
*/
|
|
1411
|
-
export declare class InvalidInputError extends
|
|
1263
|
+
export declare class InvalidInputError extends InvalidInputError_base<{
|
|
1412
1264
|
readonly field: string;
|
|
1413
1265
|
readonly value: string;
|
|
1414
1266
|
readonly message: string;
|
|
1415
1267
|
}> {
|
|
1416
1268
|
}
|
|
1417
1269
|
|
|
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 & {
|
|
1270
|
+
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
1271
|
readonly _tag: "InvalidInputError";
|
|
1430
1272
|
} & Readonly<A>;
|
|
1431
1273
|
|
|
@@ -1476,24 +1318,14 @@ export declare interface ListOptions {
|
|
|
1476
1318
|
*
|
|
1477
1319
|
* @public
|
|
1478
1320
|
*/
|
|
1479
|
-
export declare class NetworkError extends
|
|
1321
|
+
export declare class NetworkError extends NetworkError_base<{
|
|
1480
1322
|
readonly url: string;
|
|
1481
1323
|
readonly status?: number;
|
|
1482
1324
|
readonly message: string;
|
|
1483
1325
|
}> {
|
|
1484
1326
|
}
|
|
1485
1327
|
|
|
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 & {
|
|
1328
|
+
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
1329
|
readonly _tag: "NetworkError";
|
|
1498
1330
|
} & Readonly<A>;
|
|
1499
1331
|
|
|
@@ -1570,12 +1402,12 @@ export declare type NodePhase = typeof NodePhase.Type;
|
|
|
1570
1402
|
* @public
|
|
1571
1403
|
*/
|
|
1572
1404
|
export declare class NodeRelease {
|
|
1573
|
-
readonly version: SemVer
|
|
1574
|
-
readonly npm: SemVer
|
|
1405
|
+
readonly version: SemVer;
|
|
1406
|
+
readonly npm: SemVer;
|
|
1575
1407
|
readonly date: DateTime.DateTime;
|
|
1576
1408
|
readonly scheduleRef: Ref.Ref<NodeSchedule>;
|
|
1577
1409
|
readonly _tag: "NodeRelease";
|
|
1578
|
-
constructor(version: SemVer
|
|
1410
|
+
constructor(version: SemVer, npm: SemVer, date: DateTime.DateTime, scheduleRef: Ref.Ref<NodeSchedule>);
|
|
1579
1411
|
/**
|
|
1580
1412
|
* Determine this release's lifecycle phase at the given point in time.
|
|
1581
1413
|
*
|
|
@@ -1601,7 +1433,7 @@ export declare class NodeRelease {
|
|
|
1601
1433
|
/**
|
|
1602
1434
|
* Create a {@link NodeRelease} from lean string inputs.
|
|
1603
1435
|
*
|
|
1604
|
-
* Parses `input.version` and `input.npm` via `SemVer.
|
|
1436
|
+
* Parses `input.version` and `input.npm` via `SemVer.parse` and
|
|
1605
1437
|
* constructs the publication date with `DateTime.unsafeMake`.
|
|
1606
1438
|
*
|
|
1607
1439
|
* @param input - A {@link NodeReleaseInput} object with raw string fields.
|
|
@@ -1617,16 +1449,9 @@ export declare class NodeRelease {
|
|
|
1617
1449
|
* additional operations for lifecycle schedule data and LTS / current
|
|
1618
1450
|
* release filtering.
|
|
1619
1451
|
*
|
|
1620
|
-
* Unlike the Bun and Deno equivalents this
|
|
1452
|
+
* Unlike the Bun and Deno equivalents this service is not a plain type alias
|
|
1621
1453
|
* — it adds four Node-specific methods on top of the generic cache contract.
|
|
1622
1454
|
*
|
|
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
1455
|
* @example
|
|
1631
1456
|
* ```typescript
|
|
1632
1457
|
* import type { NodeRelease } from "runtime-resolver";
|
|
@@ -1644,9 +1469,19 @@ export declare class NodeRelease {
|
|
|
1644
1469
|
* Effect.runPromise(program.pipe(Effect.provide(OfflineNodeCacheLive)));
|
|
1645
1470
|
* ```
|
|
1646
1471
|
*
|
|
1472
|
+
* @see {@link NodeRelease}
|
|
1473
|
+
* @see {@link NodeScheduleData}
|
|
1474
|
+
* @see {@link RuntimeCache}
|
|
1475
|
+
* @see {@link AutoNodeCacheLive}
|
|
1476
|
+
* @see {@link FreshNodeCacheLive}
|
|
1477
|
+
* @see {@link OfflineNodeCacheLive}
|
|
1478
|
+
*
|
|
1647
1479
|
* @public
|
|
1648
1480
|
*/
|
|
1649
|
-
export declare
|
|
1481
|
+
export declare class NodeReleaseCache extends NodeReleaseCache_base {
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
declare const NodeReleaseCache_base: Context.TagClass<NodeReleaseCache, "runtime-resolver/NodeReleaseCache", RuntimeCache<NodeRelease> & {
|
|
1650
1485
|
/**
|
|
1651
1486
|
* Merges Node.js release-schedule data into the cache, updating lifecycle
|
|
1652
1487
|
* phase information (LTS dates, end-of-life dates, etc.) for every major
|
|
@@ -1693,23 +1528,7 @@ export declare interface NodeReleaseCache extends RuntimeCache<NodeRelease> {
|
|
|
1693
1528
|
* @see {@link NodeRelease}
|
|
1694
1529
|
*/
|
|
1695
1530
|
readonly currentReleases: (now?: DateTime.DateTime) => Effect.Effect<ReadonlyArray<NodeRelease>>;
|
|
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>;
|
|
1531
|
+
}>;
|
|
1713
1532
|
|
|
1714
1533
|
/**
|
|
1715
1534
|
* Low-level layer that constructs the {@link NodeReleaseCache} service backed by
|
|
@@ -1740,7 +1559,7 @@ export declare const NodeReleaseCacheLive: Layer.Layer<NodeReleaseCache, never,
|
|
|
1740
1559
|
* bundled default data files and the Node.js dist API response.
|
|
1741
1560
|
*
|
|
1742
1561
|
* The `version` and `npm` fields are raw version strings validated by
|
|
1743
|
-
* `SemVer.
|
|
1562
|
+
* `SemVer.parse`; `date` is a date string accepted by
|
|
1744
1563
|
* `DateTime.unsafeMake`.
|
|
1745
1564
|
*
|
|
1746
1565
|
* @see {@link NodeRelease.fromInput}
|
|
@@ -1764,45 +1583,13 @@ export declare const NodeReleaseInput: Schema.Struct<{
|
|
|
1764
1583
|
export declare type NodeReleaseInput = typeof NodeReleaseInput.Type;
|
|
1765
1584
|
|
|
1766
1585
|
/**
|
|
1767
|
-
* Service
|
|
1586
|
+
* Service for resolving Node.js runtime versions against the cached
|
|
1768
1587
|
* release index.
|
|
1769
1588
|
*
|
|
1770
1589
|
* Unlike {@link BunResolver} and {@link DenoResolver}, this service is
|
|
1771
1590
|
* lifecycle-aware: results can be filtered by {@link NodePhase} and evaluated
|
|
1772
1591
|
* against a specific reference date.
|
|
1773
1592
|
*
|
|
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
1593
|
* For a one-shot Promise-based API see {@link resolveNode}.
|
|
1807
1594
|
*
|
|
1808
1595
|
* @example
|
|
@@ -1827,10 +1614,30 @@ export declare interface NodeResolver {
|
|
|
1827
1614
|
*
|
|
1828
1615
|
* @see {@link NodeResolverLive}
|
|
1829
1616
|
* @see {@link resolveNode}
|
|
1617
|
+
* @see {@link NodeResolverOptions}
|
|
1618
|
+
* @see {@link ResolvedVersions}
|
|
1830
1619
|
*
|
|
1831
1620
|
* @public
|
|
1832
1621
|
*/
|
|
1833
|
-
export declare
|
|
1622
|
+
export declare class NodeResolver extends NodeResolver_base {
|
|
1623
|
+
}
|
|
1624
|
+
|
|
1625
|
+
declare const NodeResolver_base: Context.TagClass<NodeResolver, "runtime-resolver/NodeResolver", {
|
|
1626
|
+
/**
|
|
1627
|
+
* Resolves Node.js versions according to `options` and returns a
|
|
1628
|
+
* {@link ResolvedVersions} object containing the matching version list,
|
|
1629
|
+
* the latest version string, optional LTS version string, and the data
|
|
1630
|
+
* source indicator.
|
|
1631
|
+
*
|
|
1632
|
+
* Fails with {@link NodeResolverError} when no version can be resolved and
|
|
1633
|
+
* no `defaultVersion` was provided.
|
|
1634
|
+
*
|
|
1635
|
+
* @param options - Optional resolution constraints.
|
|
1636
|
+
*
|
|
1637
|
+
* @see {@link NodeResolverOptions}
|
|
1638
|
+
*/
|
|
1639
|
+
readonly resolve: (options?: NodeResolverOptions) => Effect.Effect<ResolvedVersions, NodeResolverError>;
|
|
1640
|
+
}>;
|
|
1834
1641
|
|
|
1835
1642
|
/**
|
|
1836
1643
|
* Union of all typed errors that {@link NodeResolver.resolve} can fail with.
|
|
@@ -1998,7 +1805,7 @@ export declare interface NodeResolverOptions {
|
|
|
1998
1805
|
*
|
|
1999
1806
|
* @public
|
|
2000
1807
|
*/
|
|
2001
|
-
export declare class NodeSchedule extends
|
|
1808
|
+
export declare class NodeSchedule extends NodeSchedule_base<{
|
|
2002
1809
|
readonly entries: ReadonlyArray<NodeScheduleEntry>;
|
|
2003
1810
|
}> {
|
|
2004
1811
|
/**
|
|
@@ -2032,22 +1839,7 @@ export declare class NodeSchedule extends NodeScheduleBase<{
|
|
|
2032
1839
|
entryFor(major: number): Option.Option<NodeScheduleEntry>;
|
|
2033
1840
|
}
|
|
2034
1841
|
|
|
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> & {
|
|
1842
|
+
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
1843
|
readonly _tag: "NodeSchedule";
|
|
2052
1844
|
};
|
|
2053
1845
|
|
|
@@ -2094,41 +1886,13 @@ export declare interface NodeScheduleEntry {
|
|
|
2094
1886
|
}
|
|
2095
1887
|
|
|
2096
1888
|
/**
|
|
2097
|
-
* Service
|
|
1889
|
+
* Service for fetching the official Node.js release schedule.
|
|
2098
1890
|
*
|
|
2099
1891
|
* The schedule maps each major release line to its LTS start date and
|
|
2100
1892
|
* end-of-life date, and is used by {@link NodeReleaseCache} to assign
|
|
2101
1893
|
* lifecycle phases to individual releases. The live implementation fetches
|
|
2102
1894
|
* from the `nodejs/Release` GitHub repository via a plain HTTP request.
|
|
2103
1895
|
*
|
|
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
1896
|
* @example
|
|
2133
1897
|
* ```typescript
|
|
2134
1898
|
* import type { NodeScheduleData } from "runtime-resolver";
|
|
@@ -2145,10 +1909,27 @@ export declare interface NodeScheduleFetcher {
|
|
|
2145
1909
|
* ```
|
|
2146
1910
|
*
|
|
2147
1911
|
* @see {@link NodeScheduleFetcherLive}
|
|
1912
|
+
* @see {@link NodeReleaseCache}
|
|
1913
|
+
* @see {@link NodeScheduleData}
|
|
1914
|
+
* @see {@link NetworkError}
|
|
1915
|
+
* @see {@link ParseError}
|
|
2148
1916
|
*
|
|
2149
1917
|
* @public
|
|
2150
1918
|
*/
|
|
2151
|
-
export declare
|
|
1919
|
+
export declare class NodeScheduleFetcher extends NodeScheduleFetcher_base {
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
declare const NodeScheduleFetcher_base: Context.TagClass<NodeScheduleFetcher, "runtime-resolver/NodeScheduleFetcher", {
|
|
1923
|
+
/**
|
|
1924
|
+
* Fetches and decodes the Node.js release schedule JSON, returning a
|
|
1925
|
+
* typed {@link NodeScheduleData} map keyed by major release line.
|
|
1926
|
+
*
|
|
1927
|
+
* Fails with:
|
|
1928
|
+
* - {@link NetworkError} — the upstream request could not be completed.
|
|
1929
|
+
* - {@link ParseError} — the response payload could not be decoded.
|
|
1930
|
+
*/
|
|
1931
|
+
readonly fetch: () => Effect.Effect<NodeScheduleData, NetworkError | ParseError>;
|
|
1932
|
+
}>;
|
|
2152
1933
|
|
|
2153
1934
|
/**
|
|
2154
1935
|
* Provides the {@link NodeScheduleFetcher} service using the live Node.js release schedule.
|
|
@@ -2171,7 +1952,7 @@ export declare const NodeScheduleFetcher: Context.Tag<NodeScheduleFetcher, NodeS
|
|
|
2171
1952
|
export declare const NodeScheduleFetcherLive: Layer.Layer<NodeScheduleFetcher, never, GitHubClient>;
|
|
2172
1953
|
|
|
2173
1954
|
/**
|
|
2174
|
-
* Service
|
|
1955
|
+
* Service for fetching Node.js release data from the official
|
|
2175
1956
|
* Node.js distribution index.
|
|
2176
1957
|
*
|
|
2177
1958
|
* Retrieves both the parsed semver version list and the raw
|
|
@@ -2180,37 +1961,6 @@ export declare const NodeScheduleFetcherLive: Layer.Layer<NodeScheduleFetcher, n
|
|
|
2180
1961
|
* `https://nodejs.org/dist/index.json` via a plain HTTP request — no GitHub
|
|
2181
1962
|
* credentials are required.
|
|
2182
1963
|
*
|
|
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
1964
|
* @example
|
|
2215
1965
|
* ```typescript
|
|
2216
1966
|
* import type { NodeReleaseInput } from "runtime-resolver";
|
|
@@ -2227,10 +1977,30 @@ export declare interface NodeVersionFetcher {
|
|
|
2227
1977
|
* ```
|
|
2228
1978
|
*
|
|
2229
1979
|
* @see {@link NodeVersionFetcherLive}
|
|
1980
|
+
* @see {@link NodeReleaseCache}
|
|
1981
|
+
* @see {@link NetworkError}
|
|
1982
|
+
* @see {@link ParseError}
|
|
2230
1983
|
*
|
|
2231
1984
|
* @public
|
|
2232
1985
|
*/
|
|
2233
|
-
export declare
|
|
1986
|
+
export declare class NodeVersionFetcher extends NodeVersionFetcher_base {
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
declare const NodeVersionFetcher_base: Context.TagClass<NodeVersionFetcher, "runtime-resolver/NodeVersionFetcher", {
|
|
1990
|
+
/**
|
|
1991
|
+
* Fetches all available Node.js releases from the distribution index and
|
|
1992
|
+
* returns both the parsed semver version objects and the raw release input
|
|
1993
|
+
* records.
|
|
1994
|
+
*
|
|
1995
|
+
* Fails with:
|
|
1996
|
+
* - {@link NetworkError} — the upstream request could not be completed.
|
|
1997
|
+
* - {@link ParseError} — the response payload could not be decoded.
|
|
1998
|
+
*/
|
|
1999
|
+
readonly fetch: () => Effect.Effect<{
|
|
2000
|
+
readonly versions: ReadonlyArray<SemVer>;
|
|
2001
|
+
readonly inputs: ReadonlyArray<NodeReleaseInput>;
|
|
2002
|
+
}, NetworkError | ParseError>;
|
|
2003
|
+
}>;
|
|
2234
2004
|
|
|
2235
2005
|
/**
|
|
2236
2006
|
* Provides the {@link NodeVersionFetcher} service using the live Node.js dist index.
|
|
@@ -2264,6 +2034,24 @@ export declare const NodeVersionFetcherLive: Layer.Layer<NodeVersionFetcher, nev
|
|
|
2264
2034
|
* three authentication layers: {@link GitHubTokenAuth}, {@link GitHubAppAuth},
|
|
2265
2035
|
* or {@link GitHubAutoAuth}.
|
|
2266
2036
|
*
|
|
2037
|
+
* @example
|
|
2038
|
+
* ```typescript
|
|
2039
|
+
* import { OctokitInstance, GitHubClientLive, GitHubAutoAuth } from "runtime-resolver";
|
|
2040
|
+
* import { Effect } from "effect";
|
|
2041
|
+
*
|
|
2042
|
+
* const program = Effect.gen(function* () {
|
|
2043
|
+
* const octokit = yield* OctokitInstance;
|
|
2044
|
+
* const response = await octokit.rest.repos.listTags({
|
|
2045
|
+
* owner: "oven-sh",
|
|
2046
|
+
* repo: "bun",
|
|
2047
|
+
* per_page: 10,
|
|
2048
|
+
* });
|
|
2049
|
+
* console.log(response.data.length);
|
|
2050
|
+
* });
|
|
2051
|
+
*
|
|
2052
|
+
* Effect.runPromise(program.pipe(Effect.provide(GitHubAutoAuth)));
|
|
2053
|
+
* ```
|
|
2054
|
+
*
|
|
2267
2055
|
* @see {@link GitHubClientLive}
|
|
2268
2056
|
* @see {@link GitHubTokenAuth}
|
|
2269
2057
|
* @see {@link GitHubAppAuth}
|
|
@@ -2271,7 +2059,10 @@ export declare const NodeVersionFetcherLive: Layer.Layer<NodeVersionFetcher, nev
|
|
|
2271
2059
|
*
|
|
2272
2060
|
* @public
|
|
2273
2061
|
*/
|
|
2274
|
-
export declare
|
|
2062
|
+
export declare class OctokitInstance extends OctokitInstance_base {
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
declare const OctokitInstance_base: Context.TagClass<OctokitInstance, "runtime-resolver/OctokitInstance", {
|
|
2275
2066
|
readonly rest: {
|
|
2276
2067
|
readonly repos: {
|
|
2277
2068
|
/**
|
|
@@ -2304,46 +2095,7 @@ export declare interface OctokitInstance {
|
|
|
2304
2095
|
}>;
|
|
2305
2096
|
};
|
|
2306
2097
|
};
|
|
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>;
|
|
2098
|
+
}>;
|
|
2347
2099
|
|
|
2348
2100
|
/**
|
|
2349
2101
|
* Provides the {@link BunReleaseCache} service using the "Offline" cache strategy.
|
|
@@ -2440,23 +2192,13 @@ export declare const OfflineNodeCacheLive: Layer.Layer<NodeReleaseCache>;
|
|
|
2440
2192
|
*
|
|
2441
2193
|
* @public
|
|
2442
2194
|
*/
|
|
2443
|
-
export declare class ParseError extends
|
|
2195
|
+
export declare class ParseError extends ParseError_base<{
|
|
2444
2196
|
readonly source: string;
|
|
2445
2197
|
readonly message: string;
|
|
2446
2198
|
}> {
|
|
2447
2199
|
}
|
|
2448
2200
|
|
|
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 & {
|
|
2201
|
+
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
2202
|
readonly _tag: "ParseError";
|
|
2461
2203
|
} & Readonly<A>;
|
|
2462
2204
|
|
|
@@ -2492,7 +2234,7 @@ export declare const ParseErrorBase: new <A extends Record<string, any> = {}>(ar
|
|
|
2492
2234
|
*
|
|
2493
2235
|
* @public
|
|
2494
2236
|
*/
|
|
2495
|
-
export declare class RateLimitError extends
|
|
2237
|
+
export declare class RateLimitError extends RateLimitError_base<{
|
|
2496
2238
|
readonly retryAfter?: number;
|
|
2497
2239
|
readonly limit: number;
|
|
2498
2240
|
readonly remaining: number;
|
|
@@ -2500,17 +2242,7 @@ export declare class RateLimitError extends RateLimitErrorBase<{
|
|
|
2500
2242
|
}> {
|
|
2501
2243
|
}
|
|
2502
2244
|
|
|
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 & {
|
|
2245
|
+
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
2246
|
readonly _tag: "RateLimitError";
|
|
2515
2247
|
} & Readonly<A>;
|
|
2516
2248
|
|
|
@@ -2541,13 +2273,7 @@ export declare const RateLimitErrorBase: new <A extends Record<string, any> = {}
|
|
|
2541
2273
|
*
|
|
2542
2274
|
* @public
|
|
2543
2275
|
*/
|
|
2544
|
-
export declare const resolveBun: (options?: BunResolverOptions
|
|
2545
|
-
readonly source: "api" | "cache";
|
|
2546
|
-
readonly versions: readonly string[];
|
|
2547
|
-
readonly latest: string;
|
|
2548
|
-
readonly lts?: string | undefined;
|
|
2549
|
-
readonly default?: string | undefined;
|
|
2550
|
-
}>;
|
|
2276
|
+
export declare const resolveBun: (options?: BunResolverOptions) => Promise<ResolvedVersions>;
|
|
2551
2277
|
|
|
2552
2278
|
/**
|
|
2553
2279
|
* Resolve Deno versions matching the given options.
|
|
@@ -2576,13 +2302,7 @@ export declare const resolveBun: (options?: BunResolverOptions | undefined) => P
|
|
|
2576
2302
|
*
|
|
2577
2303
|
* @public
|
|
2578
2304
|
*/
|
|
2579
|
-
export declare const resolveDeno: (options?: DenoResolverOptions
|
|
2580
|
-
readonly source: "api" | "cache";
|
|
2581
|
-
readonly versions: readonly string[];
|
|
2582
|
-
readonly latest: string;
|
|
2583
|
-
readonly lts?: string | undefined;
|
|
2584
|
-
readonly default?: string | undefined;
|
|
2585
|
-
}>;
|
|
2305
|
+
export declare const resolveDeno: (options?: DenoResolverOptions) => Promise<ResolvedVersions>;
|
|
2586
2306
|
|
|
2587
2307
|
/**
|
|
2588
2308
|
* The primary return type produced by every runtime resolver.
|
|
@@ -2664,13 +2384,7 @@ export declare type ResolvedVersions = typeof ResolvedVersions.Type;
|
|
|
2664
2384
|
*
|
|
2665
2385
|
* @public
|
|
2666
2386
|
*/
|
|
2667
|
-
export declare const resolveNode: (options?: NodeResolverOptions
|
|
2668
|
-
readonly source: "api" | "cache";
|
|
2669
|
-
readonly versions: readonly string[];
|
|
2670
|
-
readonly latest: string;
|
|
2671
|
-
readonly lts?: string | undefined;
|
|
2672
|
-
readonly default?: string | undefined;
|
|
2673
|
-
}>;
|
|
2387
|
+
export declare const resolveNode: (options?: NodeResolverOptions) => Promise<ResolvedVersions>;
|
|
2674
2388
|
|
|
2675
2389
|
/**
|
|
2676
2390
|
* Discriminates which JavaScript runtime a resolver targets.
|
|
@@ -2800,7 +2514,7 @@ export declare interface RuntimeCache<R extends RuntimeRelease> {
|
|
|
2800
2514
|
*/
|
|
2801
2515
|
export declare interface RuntimeRelease {
|
|
2802
2516
|
readonly _tag: string;
|
|
2803
|
-
readonly version: SemVer
|
|
2517
|
+
readonly version: SemVer;
|
|
2804
2518
|
readonly date: DateTime.DateTime;
|
|
2805
2519
|
}
|
|
2806
2520
|
|
|
@@ -2810,7 +2524,7 @@ export declare interface RuntimeRelease {
|
|
|
2810
2524
|
*
|
|
2811
2525
|
* Both Bun and Deno source their offline snapshots from JSON/TS data files
|
|
2812
2526
|
* whose entries conform to this shape. The `version` and `date` fields are
|
|
2813
|
-
* plain strings that are subsequently parsed by `SemVer.
|
|
2527
|
+
* plain strings that are subsequently parsed by `SemVer.parse` and
|
|
2814
2528
|
* `DateTime.unsafeMake` respectively.
|
|
2815
2529
|
*
|
|
2816
2530
|
* @see {@link BunRelease.fromInput}
|
|
@@ -2880,24 +2594,14 @@ export declare type Source = typeof Source.Type;
|
|
|
2880
2594
|
*
|
|
2881
2595
|
* @public
|
|
2882
2596
|
*/
|
|
2883
|
-
export declare class VersionNotFoundError extends
|
|
2597
|
+
export declare class VersionNotFoundError extends VersionNotFoundError_base<{
|
|
2884
2598
|
readonly runtime: Runtime;
|
|
2885
2599
|
readonly constraint: string;
|
|
2886
2600
|
readonly message: string;
|
|
2887
2601
|
}> {
|
|
2888
2602
|
}
|
|
2889
2603
|
|
|
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 & {
|
|
2604
|
+
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
2605
|
readonly _tag: "VersionNotFoundError";
|
|
2902
2606
|
} & Readonly<A>;
|
|
2903
2607
|
|