@better-update/cli 0.18.2 → 0.18.3
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/dist/index.mjs +9 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { execFile, spawn, spawnSync } from "node:child_process";
|
|
4
4
|
import { defineCommand, runMain } from "citty";
|
|
5
|
-
import { Console, Context, Data, Deferred, Duration, Effect, Layer, Match, Option, ParseResult, Schema } from "effect";
|
|
5
|
+
import { Console, Context, Data, Deferred, Duration, Effect, Layer, Match, Option, ParseResult, Schedule, Schema } from "effect";
|
|
6
6
|
import { Command, FetchHttpClient, FileSystem, HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup, HttpApiMiddleware, HttpApiSchema, HttpApiSecurity, HttpClient, HttpClientRequest, OpenApi, Path } from "@effect/platform";
|
|
7
7
|
import { NodeContext } from "@effect/platform-node";
|
|
8
8
|
import path, { join } from "node:path";
|
|
@@ -32,7 +32,7 @@ var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region package.json
|
|
35
|
-
var version = "0.18.
|
|
35
|
+
var version = "0.18.3";
|
|
36
36
|
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/lib/interactive-mode.ts
|
|
@@ -1815,17 +1815,23 @@ const ConfigStoreLive = Layer.effect(ConfigStore, Effect.gen(function* () {
|
|
|
1815
1815
|
HttpApiClient.make(ManagementApi);
|
|
1816
1816
|
var ApiClientService = class extends Context.Tag("cli/ApiClient")() {};
|
|
1817
1817
|
const apiClient = Effect.flatMap(ApiClientService, ({ get }) => get);
|
|
1818
|
+
const RETRY_TRANSIENT_OPTIONS = {
|
|
1819
|
+
mode: "errors-only",
|
|
1820
|
+
times: 4,
|
|
1821
|
+
schedule: Schedule.exponential("500 millis", 2)
|
|
1822
|
+
};
|
|
1818
1823
|
const ApiClientLive = Layer.effect(ApiClientService, Effect.gen(function* () {
|
|
1819
1824
|
const clientService = yield* HttpClient.HttpClient;
|
|
1820
1825
|
const authStore = yield* AuthStore;
|
|
1821
1826
|
const configStore = yield* ConfigStore;
|
|
1827
|
+
const retryingClient = HttpClient.retryTransient(clientService, RETRY_TRANSIENT_OPTIONS);
|
|
1822
1828
|
return { get: Effect.gen(function* () {
|
|
1823
1829
|
const token = yield* authStore.getToken;
|
|
1824
1830
|
const baseUrl = yield* configStore.getBaseUrl;
|
|
1825
1831
|
return yield* HttpApiClient.make(ManagementApi, {
|
|
1826
1832
|
transformClient: HttpClient.mapRequest(HttpClientRequest.bearerToken(token)),
|
|
1827
1833
|
baseUrl
|
|
1828
|
-
}).pipe(Effect.provideService(HttpClient.HttpClient,
|
|
1834
|
+
}).pipe(Effect.provideService(HttpClient.HttpClient, retryingClient));
|
|
1829
1835
|
}) };
|
|
1830
1836
|
}));
|
|
1831
1837
|
|