monoidentity 0.14.1 → 0.15.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/dist/+client.d.ts +1 -1
- package/dist/+client.js +1 -1
- package/dist/storage.d.ts +1 -0
- package/dist/storage.js +4 -0
- package/dist/trackready.js +2 -7
- package/dist/utils-hub.d.ts +2 -0
- package/dist/utils-hub.js +6 -0
- package/dist/verification/attest-remote.js +2 -5
- package/package.json +2 -2
package/dist/+client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./+common.js";
|
|
2
|
-
export { getLoginRecognized, getVerification, getStorage, getScopedFS, completeSync, } from "./storage.js";
|
|
2
|
+
export { getLoginRecognized, relog, getVerification, getStorage, getScopedFS, completeSync, } from "./storage.js";
|
|
3
3
|
export { retrieveVerification } from "./verification-client.js";
|
|
4
4
|
export { default as rawAttest } from "./verification/attest-remote.js";
|
|
5
5
|
export { trackReady } from "./trackready.js";
|
package/dist/+client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./+common.js";
|
|
2
|
-
export { getLoginRecognized, getVerification, getStorage, getScopedFS, completeSync, } from "./storage.js";
|
|
2
|
+
export { getLoginRecognized, relog, getVerification, getStorage, getScopedFS, completeSync, } from "./storage.js";
|
|
3
3
|
export { retrieveVerification } from "./verification-client.js";
|
|
4
4
|
export { default as rawAttest } from "./verification/attest-remote.js";
|
|
5
5
|
export { trackReady } from "./trackready.js";
|
package/dist/storage.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare const getLoginRecognized: () => {
|
|
|
6
6
|
password: string;
|
|
7
7
|
};
|
|
8
8
|
export declare const setLoginRecognized: (login: string) => void;
|
|
9
|
+
export declare const relog: () => never;
|
|
9
10
|
export declare const getVerification: () => Promise<any>;
|
|
10
11
|
export declare const setVerification: (jwt: string) => void;
|
|
11
12
|
export declare const getStorage: (realm: "config" | "cache") => Record<string, any>;
|
package/dist/storage.js
CHANGED
|
@@ -5,6 +5,7 @@ import { login as loginSchema } from "./utils-transport.js";
|
|
|
5
5
|
import { verify } from "@tsndr/cloudflare-worker-jwt";
|
|
6
6
|
import publicKey from "./verification/public-key.js";
|
|
7
7
|
import { storageClient } from "./storage/storageclient.svelte.js";
|
|
8
|
+
import { switchToHub } from "./utils-hub.js";
|
|
8
9
|
let app = "unknown";
|
|
9
10
|
let syncPromise = Promise.resolve();
|
|
10
11
|
export const conf = (a) => {
|
|
@@ -26,6 +27,9 @@ export const setLoginRecognized = (login) => {
|
|
|
26
27
|
const client = storageClient();
|
|
27
28
|
client[LOGIN_RECOGNIZED_PATH] = login;
|
|
28
29
|
};
|
|
30
|
+
export const relog = () => {
|
|
31
|
+
switchToHub([{ loginRecognized: true }]);
|
|
32
|
+
};
|
|
29
33
|
const VERIFICATION_PATH = ".core/verification.jwt";
|
|
30
34
|
export const getVerification = async () => {
|
|
31
35
|
const client = storageClient();
|
package/dist/trackready.js
CHANGED
|
@@ -5,6 +5,7 @@ import {} from "./utils-transport.js";
|
|
|
5
5
|
import { conf, setLoginRecognized } from "./storage.js";
|
|
6
6
|
import { backupLocally } from "./storage/backuplocally.js";
|
|
7
7
|
import { backupCloud } from "./storage/backupcloud.js";
|
|
8
|
+
import { switchToHub } from "./utils-hub.js";
|
|
8
9
|
export const trackReady = async (app, intents, shouldBackup, requestBackup) => {
|
|
9
10
|
conf(app);
|
|
10
11
|
let setup = localStorage["monoidentity-x/setup"]
|
|
@@ -24,13 +25,7 @@ export const trackReady = async (app, intents, shouldBackup, requestBackup) => {
|
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
if (!setup) {
|
|
27
|
-
|
|
28
|
-
target.hash = JSON.stringify({
|
|
29
|
-
intents: [{ storage: true }, ...intents],
|
|
30
|
-
redirectURI: location.origin,
|
|
31
|
-
});
|
|
32
|
-
location.href = target.toString();
|
|
33
|
-
throw new Error("halt: redirecting");
|
|
28
|
+
switchToHub([{ storage: true }, ...intents]);
|
|
34
29
|
}
|
|
35
30
|
if (setup.method == "localStorage") {
|
|
36
31
|
await backupLocally(shouldBackup, requestBackup);
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import { parse, stringify } from "devalue";
|
|
2
|
-
|
|
3
1
|
//#region src/lib/verification/attest.remote.ts
|
|
4
2
|
async function attest_remote_default(arg, init) {
|
|
5
3
|
const res = await fetch("https://benignmonoserver.fly.dev/b1c8ae45b4", {
|
|
6
4
|
method: "POST",
|
|
7
|
-
body: stringify(arg),
|
|
5
|
+
body: JSON.stringify(arg),
|
|
8
6
|
...init
|
|
9
7
|
});
|
|
10
8
|
if (!res.ok) throw new Error(await res.text());
|
|
11
|
-
|
|
12
|
-
return parse(await res.text());
|
|
9
|
+
return await res.json();
|
|
13
10
|
}
|
|
14
11
|
|
|
15
12
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "monoidentity",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"repository": "KTibow/monoidentity",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "KTibow"
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@types/wicg-file-system-access": "^2023.10.6",
|
|
45
45
|
"fast-xml-parser": "^5.2.5",
|
|
46
46
|
"knip": "^5.64.1",
|
|
47
|
-
"monoserve": "^
|
|
47
|
+
"monoserve": "^3.0.0",
|
|
48
48
|
"publint": "^0.3.13",
|
|
49
49
|
"rolldown": "1.0.0-beta.40",
|
|
50
50
|
"school-districts": "^2.0.0",
|