@deslop/portfolio 0.1.1223 → 0.1.1228
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/client/index.html
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
16
16
|
|
|
17
17
|
<title>Portfolio</title>
|
|
18
|
-
<script type="module" crossorigin src="/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/assets/index-w71U_E9C.js"></script>
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-WkwZ5CU-.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/profile-B5GCDOor.js">
|
|
21
21
|
<link rel="stylesheet" crossorigin href="/assets/index-DDKtg7R3.css">
|
package/dist/server.js
CHANGED
|
@@ -43744,6 +43744,23 @@ const compressBody = /*#__PURE__*/ dual((args) => isHttpClientRequest(args[0]),
|
|
|
43744
43744
|
return map$5(compressBody$1(self.body, algorithm, options), (body) => body === self.body ? self : makeWith$1(self.method, self.url, self.urlParams, self.hash, set$1(updateContentLength(self.headers, body), "content-encoding", algorithm), body));
|
|
43745
43745
|
});
|
|
43746
43746
|
/**
|
|
43747
|
+
* Sets a JSON request body using unsafe JSON encoding.
|
|
43748
|
+
*
|
|
43749
|
+
* **When to use**
|
|
43750
|
+
*
|
|
43751
|
+
* Use when the request body is known to be JSON-serializable and a synchronous
|
|
43752
|
+
* `HttpClientRequest` result is needed.
|
|
43753
|
+
*
|
|
43754
|
+
* **Gotchas**
|
|
43755
|
+
*
|
|
43756
|
+
* JSON encoding may throw instead of failing in the Effect error channel.
|
|
43757
|
+
*
|
|
43758
|
+
* @stability unstable
|
|
43759
|
+
* @category combinators
|
|
43760
|
+
* @since 4.0.0
|
|
43761
|
+
*/
|
|
43762
|
+
const bodyJsonUnsafe = /*#__PURE__*/ dual(2, (self, body) => setBody$1(self, jsonUnsafe$1(body)));
|
|
43763
|
+
/**
|
|
43747
43764
|
* Builds a `URL` from the request URL, query parameters, and hash, returning `Option.none()` if the URL is invalid.
|
|
43748
43765
|
*
|
|
43749
43766
|
* @stability unstable
|
|
@@ -69543,6 +69560,8 @@ const SecureOrigin = Origin.check(makeFilter((value) => {
|
|
|
69543
69560
|
const Port = String$6.check(isPattern(/^\d{1,5}$/u), makeFilter((value) => exists(parse$2(value), (port) => port >= 1 && port <= 65535), { expected: "a port between 1 and 65535" }));
|
|
69544
69561
|
const AppVersion = String$6.check(isPattern(/^0\.1\.\d+$/u));
|
|
69545
69562
|
const RuntimeConfig = Struct({
|
|
69563
|
+
auth: optionalKey(String$6),
|
|
69564
|
+
name: String$6,
|
|
69546
69565
|
traces: String$6,
|
|
69547
69566
|
version: AppVersion
|
|
69548
69567
|
});
|
|
@@ -70427,7 +70446,7 @@ function layerKeyValueStore(directory) {
|
|
|
70427
70446
|
unwrap$7(map$5(dataDirectory, layerKeyValueStore));
|
|
70428
70447
|
const layerProtocol = mergeAll$1(layerSchemaBinary(), succeed$6(MaxBodySize)(mebibytes(10)));
|
|
70429
70448
|
const layerTelemetry = unwrap$7(gen(function* () {
|
|
70430
|
-
const name = yield*
|
|
70449
|
+
const name = (yield* packageMetadata).name;
|
|
70431
70450
|
return match$7(yield* option(String$5("OTEL_URL")), {
|
|
70432
70451
|
onNone: () => empty$8,
|
|
70433
70452
|
onSome: (url) => layerOtlp(`${name}-server`, url, "server")
|
|
@@ -70452,10 +70471,17 @@ const layerRoutes = use((router) => gen(function* () {
|
|
|
70452
70471
|
})
|
|
70453
70472
|
});
|
|
70454
70473
|
});
|
|
70455
|
-
yield* router.add("GET", "/api/runtime",
|
|
70456
|
-
|
|
70457
|
-
|
|
70458
|
-
|
|
70474
|
+
yield* router.add("GET", "/api/runtime", gen(function* () {
|
|
70475
|
+
return yield* schemaJson(RuntimeConfig)({
|
|
70476
|
+
...match$7(issuer, {
|
|
70477
|
+
onNone: () => ({}),
|
|
70478
|
+
onSome: (origin) => ({ auth: origin })
|
|
70479
|
+
}),
|
|
70480
|
+
name: yield* appName,
|
|
70481
|
+
traces,
|
|
70482
|
+
version: (yield* packageMetadata).version
|
|
70483
|
+
});
|
|
70484
|
+
}));
|
|
70459
70485
|
yield* router.add("GET", "/auth/sign-in", toIssuer({}));
|
|
70460
70486
|
yield* router.add("GET", "/auth/sign-out", toIssuer({ "sign-out": "" }));
|
|
70461
70487
|
yield* router.add("GET", "/auth/user", gen(function* () {
|
|
@@ -70467,6 +70493,22 @@ const layerRoutes = use((router) => gen(function* () {
|
|
|
70467
70493
|
}, { headers: { "cache-control": "no-store" } });
|
|
70468
70494
|
}));
|
|
70469
70495
|
}));
|
|
70496
|
+
const layerAnnounce = effectDiscard(gen(function* () {
|
|
70497
|
+
const origin = new URL(yield* String$5("APP_URL")).origin;
|
|
70498
|
+
const client = filterStatusOk(yield* HttpClient);
|
|
70499
|
+
yield* match$7(yield* option(String$5("AUTH_URL")), {
|
|
70500
|
+
onNone: () => void_$1,
|
|
70501
|
+
onSome: fnUntraced(function* (issuer) {
|
|
70502
|
+
yield* pipe(post(new URL("/api/apps", issuer).href), bodyJsonUnsafe({ origin }), client.execute, delay("2 seconds"), retry({
|
|
70503
|
+
schedule: spaced("1 minute"),
|
|
70504
|
+
times: 60
|
|
70505
|
+
}), ignore$1({
|
|
70506
|
+
log: "Warn",
|
|
70507
|
+
message: "Auth did not list this app"
|
|
70508
|
+
}), forkScoped);
|
|
70509
|
+
})
|
|
70510
|
+
});
|
|
70511
|
+
}));
|
|
70470
70512
|
function layerIcon(icon) {
|
|
70471
70513
|
return add("GET", "/icon", succeed$5(text(icon, {
|
|
70472
70514
|
contentType: "image/svg+xml",
|
|
@@ -70543,17 +70585,20 @@ function systemctl(...args) {
|
|
|
70543
70585
|
const unitDirectory = gen(function* () {
|
|
70544
70586
|
return (yield* Path$1).join(yield* String$5("HOME"), ".config", "systemd", "user");
|
|
70545
70587
|
});
|
|
70546
|
-
const install = fnUntraced(function* (name, command) {
|
|
70588
|
+
const install = fnUntraced(function* (name, command, options) {
|
|
70547
70589
|
const fs = yield* FileSystem;
|
|
70548
70590
|
const path = yield* Path$1;
|
|
70549
70591
|
const home = yield* String$5("HOME");
|
|
70550
70592
|
const directory = yield* unitDirectory;
|
|
70551
70593
|
const unit = `deslop-${name}.service`;
|
|
70552
70594
|
yield* fs.makeDirectory(directory, { recursive: true });
|
|
70553
|
-
yield* fs.writeFileString(path.join(directory, unit), `[Unit]\nDescription=Deslop ${name}\nAfter=network-online.target\n\n[Service]\nType=simple\nEnvironment=NODE_ENV=production\nEnvironment=${systemdArgument(`PATH=${home}/.vite-plus/bin:/usr/local/bin:/usr/bin:/bin`)}\nEnvironmentFile=-${
|
|
70595
|
+
yield* fs.writeFileString(path.join(directory, unit), `[Unit]\nDescription=Deslop ${name}\nAfter=network-online.target\n\n[Service]\nType=simple\nEnvironment=NODE_ENV=production\nEnvironment=${systemdArgument(`PATH=${home}/.vite-plus/bin:/usr/local/bin:/usr/bin:/bin`)}\nEnvironmentFile=-${replaceAll("%", "%%")(`${home}/.deslop/${name}.env`)}\nExecStart=${join$2(map$8(command, systemdArgument), " ")}\nRestart=on-failure\nRestartSec=3\nUMask=0077\n\n[Install]\nWantedBy=default.target\n`, { mode: 384 });
|
|
70554
70596
|
yield* systemctl("daemon-reload");
|
|
70555
70597
|
yield* systemctl("enable", unit);
|
|
70556
|
-
yield* systemctl(
|
|
70598
|
+
yield* systemctl(match(options?.restart === false, {
|
|
70599
|
+
onFalse: () => "restart",
|
|
70600
|
+
onTrue: () => "start"
|
|
70601
|
+
}), unit);
|
|
70557
70602
|
return `${unit} installed\n`;
|
|
70558
70603
|
});
|
|
70559
70604
|
const installUpdates = fnUntraced(function* (name, command) {
|
|
@@ -70676,7 +70721,7 @@ const provider = fnUntraced(function* (given) {
|
|
|
70676
70721
|
});
|
|
70677
70722
|
const layerPlatform = mergeAll$1(layer$4, layer$12, layer$15);
|
|
70678
70723
|
function server(app) {
|
|
70679
|
-
return pipe(serve(pipe(mergeAll$1(app.routes, layerRoutes, layerIcon(app.icon), layerWeb), provide$2(Auth.layer)), {
|
|
70724
|
+
return pipe(serve(pipe(mergeAll$1(app.routes, layerRoutes, layerIcon(app.icon), layerWeb, layerAnnounce), provide$2(Auth.layer)), {
|
|
70680
70725
|
disableLogger: true,
|
|
70681
70726
|
middleware: (http) => guard(app.middleware?.(http) ?? http)
|
|
70682
70727
|
}), provide$2(mergeAll$1(layerProtocol, match(app.telemetry === false, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deslop/portfolio",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1228",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/MP281X/deslop",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"engines": {
|
|
31
31
|
"node": ">=26"
|
|
32
32
|
},
|
|
33
|
-
"fingerprint": "
|
|
33
|
+
"fingerprint": "d03883a030aeb286036d5c501aaf7d685a84a68e0e74122d261c6bfac1348eb6"
|
|
34
34
|
}
|