@deslop/trips 0.1.1227 → 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/server.js +30 -5
- package/package.json +2 -2
package/dist/server.js
CHANGED
|
@@ -92005,6 +92005,8 @@ const SecureOrigin = Origin.check(makeFilter((value) => {
|
|
|
92005
92005
|
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" }));
|
|
92006
92006
|
const AppVersion = String$6.check(isPattern(/^0\.1\.\d+$/u));
|
|
92007
92007
|
const RuntimeConfig = Struct({
|
|
92008
|
+
auth: optionalKey(String$6),
|
|
92009
|
+
name: String$6,
|
|
92008
92010
|
traces: String$6,
|
|
92009
92011
|
version: AppVersion
|
|
92010
92012
|
});
|
|
@@ -92961,10 +92963,17 @@ const layerRoutes = use((router) => gen(function* () {
|
|
|
92961
92963
|
})
|
|
92962
92964
|
});
|
|
92963
92965
|
});
|
|
92964
|
-
yield* router.add("GET", "/api/runtime",
|
|
92965
|
-
|
|
92966
|
-
|
|
92967
|
-
|
|
92966
|
+
yield* router.add("GET", "/api/runtime", gen(function* () {
|
|
92967
|
+
return yield* schemaJson(RuntimeConfig)({
|
|
92968
|
+
...match$8(issuer, {
|
|
92969
|
+
onNone: () => ({}),
|
|
92970
|
+
onSome: (origin) => ({ auth: origin })
|
|
92971
|
+
}),
|
|
92972
|
+
name: yield* appName,
|
|
92973
|
+
traces,
|
|
92974
|
+
version: (yield* packageMetadata).version
|
|
92975
|
+
});
|
|
92976
|
+
}));
|
|
92968
92977
|
yield* router.add("GET", "/auth/sign-in", toIssuer({}));
|
|
92969
92978
|
yield* router.add("GET", "/auth/sign-out", toIssuer({ "sign-out": "" }));
|
|
92970
92979
|
yield* router.add("GET", "/auth/user", gen(function* () {
|
|
@@ -92976,6 +92985,22 @@ const layerRoutes = use((router) => gen(function* () {
|
|
|
92976
92985
|
}, { headers: { "cache-control": "no-store" } });
|
|
92977
92986
|
}));
|
|
92978
92987
|
}));
|
|
92988
|
+
const layerAnnounce = effectDiscard(gen(function* () {
|
|
92989
|
+
const origin = new URL(yield* String$5("APP_URL")).origin;
|
|
92990
|
+
const client = filterStatusOk(yield* HttpClient);
|
|
92991
|
+
yield* match$8(yield* option(String$5("AUTH_URL")), {
|
|
92992
|
+
onNone: () => void_$1,
|
|
92993
|
+
onSome: fnUntraced(function* (issuer) {
|
|
92994
|
+
yield* pipe(post(new URL("/api/apps", issuer).href), bodyJsonUnsafe({ origin }), client.execute, delay("2 seconds"), retry({
|
|
92995
|
+
schedule: spaced("1 minute"),
|
|
92996
|
+
times: 60
|
|
92997
|
+
}), ignore$1({
|
|
92998
|
+
log: "Warn",
|
|
92999
|
+
message: "Auth did not list this app"
|
|
93000
|
+
}), forkScoped);
|
|
93001
|
+
})
|
|
93002
|
+
});
|
|
93003
|
+
}));
|
|
92979
93004
|
function layerIcon(icon) {
|
|
92980
93005
|
return add("GET", "/icon", succeed$5(text$1(icon, {
|
|
92981
93006
|
contentType: "image/svg+xml",
|
|
@@ -93218,7 +93243,7 @@ const provider = fnUntraced(function* (given) {
|
|
|
93218
93243
|
});
|
|
93219
93244
|
const layerPlatform = mergeAll$2(layer$4, layer$12, layer$15);
|
|
93220
93245
|
function server(app) {
|
|
93221
|
-
return pipe(serve(pipe(mergeAll$2(app.routes, layerRoutes, layerIcon(app.icon), layerWeb), provide$2(Auth.layer)), {
|
|
93246
|
+
return pipe(serve(pipe(mergeAll$2(app.routes, layerRoutes, layerIcon(app.icon), layerWeb, layerAnnounce), provide$2(Auth.layer)), {
|
|
93222
93247
|
disableLogger: true,
|
|
93223
93248
|
middleware: (http) => guard(app.middleware?.(http) ?? http)
|
|
93224
93249
|
}), provide$2(mergeAll$2(layerProtocol, match$1(app.telemetry === false, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deslop/trips",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1228",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/MP281X/deslop",
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"engines": {
|
|
32
32
|
"node": ">=26"
|
|
33
33
|
},
|
|
34
|
-
"fingerprint": "
|
|
34
|
+
"fingerprint": "294a6b28f68ce53485307760348f546385fbd35f11be8194ff209424a6184e61"
|
|
35
35
|
}
|