Compare commits
181 Commits
master
...
no-need-cr
Author | SHA1 | Date |
---|---|---|
|
b274ac7334 | 4 months ago |
|
f2e3257814 | 4 months ago |
|
e4b96ad37c | 4 months ago |
|
0b4cdefe00 | 4 months ago |
|
1cd249f356 | 5 months ago |
|
eb3765ea6e | 6 months ago |
|
d51020dcda | 6 months ago |
|
9f91fcd014 | 6 months ago |
|
c969e49633 | 6 months ago |
|
ecf9b766d8 | 8 months ago |
|
9b239229b5 | 8 months ago |
|
fcba2e867d | 9 months ago |
|
bb518792eb | 9 months ago |
|
254ad56e5b | 9 months ago |
|
711fa42621 | 9 months ago |
|
513d7742f1 | 9 months ago |
|
30f93e0797 | 9 months ago |
|
86a64d7ef5 | 9 months ago |
|
b4ea570146 | 9 months ago |
|
e4b96d96e5 | 9 months ago |
|
b7c5aa7cc4 | 9 months ago |
|
856d713a73 | 9 months ago |
|
48c63ead2f | 9 months ago |
|
17e1eb95e3 | 9 months ago |
|
495340dabe | 9 months ago |
|
4ef7e2730e | 9 months ago |
|
b16e649d53 | 9 months ago |
|
fa7cd603ee | 9 months ago |
|
f781f446fb | 9 months ago |
|
de6d053961 | 9 months ago |
|
2b9b9107a5 | 9 months ago |
|
dc4cf5ae13 | 9 months ago |
|
44fd445f4d | 9 months ago |
|
09a0e83a21 | 9 months ago |
|
465b43d88d | 9 months ago |
|
3295c685d6 | 9 months ago |
|
6110ebf733 | 9 months ago |
|
8f053793f0 | 9 months ago |
|
f2245c3b8c | 9 months ago |
|
b76dc2be9b | 9 months ago |
|
d819fd4618 | 9 months ago |
|
8b9c3ea409 | 9 months ago |
|
76ef3eee4d | 9 months ago |
|
81eeae8947 | 9 months ago |
|
e453c8998f | 9 months ago |
|
cc89bb1808 | 9 months ago |
|
077ba6265e | 9 months ago |
|
d03d15f9b7 | 9 months ago |
|
6852d56bbc | 9 months ago |
|
3926f1f2e4 | 9 months ago |
|
2f799ed937 | 9 months ago |
|
6f3e7b16eb | 9 months ago |
|
a127efffa6 | 9 months ago |
|
b8474bc2ce | 9 months ago |
|
248916c561 | 9 months ago |
|
a983205baa | 9 months ago |
|
5155dc208b | 9 months ago |
|
c38585f87d | 9 months ago |
|
8209fff45b | 9 months ago |
|
456ddf7e30 | 9 months ago |
|
ea38ac7d2a | 9 months ago |
|
a29c225216 | 10 months ago |
|
c1945d7349 | 10 months ago |
|
ded846f2fc | 10 months ago |
|
fa0102f1f4 | 10 months ago |
|
f289170e74 | 10 months ago |
|
0a5c03ebd1 | 10 months ago |
|
74137c4bdd | 10 months ago |
|
4ae372a860 | 10 months ago |
|
c7eda5198b | 10 months ago |
|
434201c657 | 10 months ago |
|
9e6c004fc4 | 10 months ago |
|
9f3efec14c | 10 months ago |
|
28bf09f24d | 10 months ago |
|
fdac0dfa68 | 10 months ago |
|
8396f30975 | 10 months ago |
![]() |
2cb65a4d16 | 10 months ago |
|
01816d000b | 10 months ago |
|
947afbdceb | 10 months ago |
|
68ad4ac632 | 10 months ago |
|
00e39f0cc4 | 10 months ago |
|
5e7ba770cd | 10 months ago |
|
148838aada | 10 months ago |
|
00398272bd | 10 months ago |
|
b6680d7cab | 10 months ago |
|
c956cfcb35 | 10 months ago |
|
f7ee5457ef | 10 months ago |
|
9659f1bbd2 | 10 months ago |
|
029276e205 | 10 months ago |
|
95ed77e414 | 10 months ago |
|
263df00e93 | 10 months ago |
|
b6db6b0d76 | 10 months ago |
|
9fbeccc3f5 | 10 months ago |
|
7c621509d2 | 10 months ago |
|
a8ec95a583 | 10 months ago |
|
ff379ccf65 | 10 months ago |
|
3f635248be | 10 months ago |
|
1bc2d46ba8 | 10 months ago |
|
b3a00f3963 | 10 months ago |
|
8c9147712d | 10 months ago |
|
707d105091 | 10 months ago |
|
5b7cb80142 | 10 months ago |
|
947e5f5de4 | 10 months ago |
|
c9630401f5 | 10 months ago |
|
81167ed5f3 | 10 months ago |
|
50153b2018 | 10 months ago |
|
b02375ff47 | 10 months ago |
|
abfe68b4ac | 10 months ago |
|
aa3b1321bd | 10 months ago |
|
700413d31a | 10 months ago |
|
a403ea31e7 | 10 months ago |
|
4860a943bb | 10 months ago |
|
dfa9c99615 | 10 months ago |
|
2dca4c0567 | 10 months ago |
![]() |
6362fb09f1 | 10 months ago |
![]() |
18101e4fae | 10 months ago |
|
bb6d118f34 | 10 months ago |
|
8b2558cd9c | 10 months ago |
![]() |
46c6228de2 | 10 months ago |
![]() |
a62c0cc342 | 10 months ago |
|
26e67a0bc4 | 10 months ago |
|
41cba12377 | 10 months ago |
|
ee385cbdfe | 10 months ago |
|
b06b31916e | 10 months ago |
|
fb0c161f7d | 10 months ago |
![]() |
e68bc0c4d6 | 10 months ago |
|
65b91ffc3f | 10 months ago |
![]() |
6f818448b3 | 10 months ago |
![]() |
4edb821e5e | 10 months ago |
![]() |
9882667604 | 10 months ago |
![]() |
a29db952e2 | 10 months ago |
|
f8a2f6ebb4 | 10 months ago |
|
104c796f68 | 10 months ago |
![]() |
1532213602 | 10 months ago |
|
e2c2596e1e | 10 months ago |
![]() |
3c0a1f8971 | 10 months ago |
|
ebd5b06a3c | 11 months ago |
|
98e70670af | 11 months ago |
|
f4675ac042 | 11 months ago |
![]() |
df5af0fe26 | 11 months ago |
![]() |
bf0efefd1f | 11 months ago |
![]() |
08168a0a33 | 11 months ago |
![]() |
3ad23d8a27 | 11 months ago |
|
760e63214a | 11 months ago |
![]() |
e68907869e | 11 months ago |
![]() |
b5542d5406 | 11 months ago |
|
ce2aeb326f | 11 months ago |
|
8975f26714 | 11 months ago |
|
3acb85b3ff | 11 months ago |
|
78a9b7f1af | 11 months ago |
|
2bf6e56d79 | 11 months ago |
|
ace0a30a91 | 11 months ago |
|
ccc23b8dda | 11 months ago |
|
71d1607693 | 11 months ago |
![]() |
16e0baa90a | 11 months ago |
![]() |
c17d9c538b | 11 months ago |
![]() |
ade307a61d | 11 months ago |
![]() |
c3ad6a60cc | 11 months ago |
![]() |
9a4d0d8c49 | 11 months ago |
![]() |
9a299d316b | 11 months ago |
![]() |
c3e2426ea8 | 11 months ago |
![]() |
ee58c8327e | 11 months ago |
![]() |
de8aa2129c | 11 months ago |
![]() |
2d0b8d5614 | 11 months ago |
![]() |
d79acc94d2 | 11 months ago |
![]() |
7547039998 | 11 months ago |
![]() |
d343837eb1 | 11 months ago |
![]() |
1d475fd9c2 | 11 months ago |
![]() |
7f24dfecd2 | 11 months ago |
![]() |
16466b720a | 11 months ago |
|
9227ae33a4 | 11 months ago |
![]() |
6ed4486fbc | 11 months ago |
![]() |
b39613117c | 11 months ago |
![]() |
230001274e | 11 months ago |
![]() |
3a2be2a217 | 11 months ago |
![]() |
89d3dbdd55 | 11 months ago |
![]() |
dfdce388a4 | 11 months ago |
![]() |
264f13f6b1 | 11 months ago |
![]() |
1be5c5be50 | 11 months ago |
![]() |
a4a1e63977 | 11 months ago |
![]() |
b6c2b40f14 | 11 months ago |
@ -1,28 +0,0 @@ |
||||
# Logs |
||||
logs |
||||
*.log |
||||
npm-debug.log* |
||||
yarn-debug.log* |
||||
yarn-error.log* |
||||
pnpm-debug.log* |
||||
lerna-debug.log* |
||||
|
||||
index.html |
||||
|
||||
node_modules |
||||
dist |
||||
dist-web |
||||
dist-file |
||||
dist-ssr |
||||
*.local |
||||
|
||||
# Editor directories and files |
||||
.vscode/* |
||||
!.vscode/extensions.json |
||||
.idea |
||||
.DS_Store |
||||
*.suo |
||||
*.ntvs* |
||||
*.njsproj |
||||
*.sln |
||||
*.sw? |
@ -1,6 +0,0 @@ |
||||
{ |
||||
"recommendations": [ |
||||
"svelte.svelte-vscode", |
||||
"rust-lang.rust-analyzer" |
||||
] |
||||
} |
@ -1,2 +0,0 @@ |
||||
# NextGraph common Svelte components |
||||
|
@ -1,68 +0,0 @@ |
||||
{ |
||||
"name": "@nextgraph-monorepo/common", |
||||
"private": true, |
||||
"version": "0.1.1-alpha", |
||||
"type": "module", |
||||
"scripts": { |
||||
"dev": "vite", |
||||
"preview": "vite preview", |
||||
"check": "svelte-check --tsconfig ./tsconfig.json" |
||||
}, |
||||
"main": "src/main.ts", |
||||
"exports": { |
||||
".": "./src/main.ts", |
||||
"./store": "./src/store.ts", |
||||
"./api": "./src/api.ts", |
||||
"./routes": "./src/routes/index.ts", |
||||
"./lib": "./src/lib/index.ts", |
||||
"./lang": "./src/lang.ts", |
||||
"./components": "./src/lib/component.ts" |
||||
}, |
||||
"dependencies": { |
||||
"@sindresorhus/is": "4.6.0", |
||||
"@tailwindcss/typography": "^0.5.13", |
||||
"async-proxy": "^0.4.1", |
||||
"char-regex": "1.0.2", |
||||
"classnames": "^2.3.2", |
||||
"debug": "^4.3.6", |
||||
"emojilib": "2.4.0", |
||||
"extend": "3.0.2", |
||||
"flowbite": "^1.6.5", |
||||
"flowbite-svelte": "^0.43.3", |
||||
"html5-qrcode": "^2.3.8", |
||||
"immutable-json-patch": "^6.0.1", |
||||
"lodash.debounce": "4.0.8", |
||||
"skin-tone": "2.0.0", |
||||
"style-mod": "^4.1.2", |
||||
"svelte-i18n": "^4.0.0", |
||||
"svelte-inview": "^4.0.2", |
||||
"svelte-spa-router": "^3.3.0", |
||||
"vite-plugin-top-level-await": "1.3.1", |
||||
"xml-beautifier": "^0.5.0" |
||||
}, |
||||
"devDependencies": { |
||||
"@sveltejs/vite-plugin-svelte": "2.0.0", |
||||
"@swc/core": "~1.6.0", |
||||
"@tsconfig/svelte": "^3.0.0", |
||||
"@types/node": "^18.7.10", |
||||
"autoprefixer": "^10.4.14", |
||||
"dayjs": "^1.11.10", |
||||
"internal-ip": "^7.0.0", |
||||
"postcss": "^8.4.23", |
||||
"postcss-load-config": "^4.0.1", |
||||
"prettier": "^3.3.2", |
||||
"prettier-plugin-svelte": "^3.2.5", |
||||
"shx": "^0.3.4", |
||||
"svelte": "^3.54.0", |
||||
"svelte-check": "^3.0.0", |
||||
"svelte-heros-v2": "^0.10.12", |
||||
"svelte-preprocess": "^5.0.3", |
||||
"svelte-time": "^0.8.0", |
||||
"tailwindcss": "^3.3.1", |
||||
"tslib": "^2.4.1", |
||||
"typescript": "^4.9.5", |
||||
"vite": "4.2.1", |
||||
"vite-plugin-svelte-svg": "2.2.1", |
||||
"vite-plugin-wasm": "3.2.2" |
||||
} |
||||
} |
@ -1,310 +0,0 @@ |
||||
<!-- |
||||
// Copyright (c) 2022-2025 Niko Bonnieure, Par le Peuple, NextGraph.org developers |
||||
// All rights reserved. |
||||
// Licensed under the Apache License, Version 2.0 |
||||
// <LICENSE-APACHE2 or http://www.apache.org/licenses/LICENSE-2.0> |
||||
// or the MIT license <LICENSE-MIT or http://opensource.org/licenses/MIT>, |
||||
// at your option. All files in the project carrying such |
||||
// notice may not be copied, modified, or distributed except |
||||
// according to those terms. |
||||
--> |
||||
|
||||
<script lang="ts"> |
||||
import { push, default as Router } from "svelte-spa-router"; |
||||
import { isLoading } from "svelte-i18n"; |
||||
|
||||
import { onMount, tick, onDestroy } from "svelte"; |
||||
import { |
||||
wallets, |
||||
active_wallet, |
||||
opened_wallets, |
||||
close_active_session, |
||||
disconnections_subscribe, |
||||
} from "./store"; |
||||
|
||||
import { select_default_lang } from "./lang"; |
||||
|
||||
import Home from "./routes/Home.svelte"; |
||||
import Test from "./routes/Test.svelte"; |
||||
|
||||
import NURI from "./routes/NURI.svelte"; |
||||
import NotFound from "./routes/NotFound.svelte"; |
||||
import WalletCreate from "./routes/WalletCreate.svelte"; |
||||
import Invitation from "./routes/Invitation.svelte"; |
||||
import WalletLogin from "./routes/WalletLogin.svelte"; |
||||
import WalletInfo from "./routes/WalletInfo.svelte"; |
||||
import User from "./routes/User.svelte"; |
||||
import UserRegistered from "./routes/UserRegistered.svelte"; |
||||
import Install from "./routes/Install.svelte"; |
||||
import ScanQR from "./routes/ScanQR.svelte"; |
||||
import Shared from "./routes/Shared.svelte"; |
||||
import Site from "./routes/Site.svelte"; |
||||
|
||||
import ng from "./api"; |
||||
import AccountInfo from "./routes/AccountInfo.svelte"; |
||||
import WalletLoginUsername from "./routes/WalletLoginUsername.svelte"; |
||||
import WalletLoginQr from "./routes/WalletLoginQr.svelte"; |
||||
import WalletLoginTextCode from "./routes/WalletLoginTextCode.svelte"; |
||||
|
||||
const routes = new Map(); |
||||
routes.set("/", Home); |
||||
routes.set("/test", Test); |
||||
routes.set("/wallet/login", WalletLogin); |
||||
routes.set("/wallet/username", WalletLoginUsername); |
||||
routes.set("/wallet/login-qr", WalletLoginQr); |
||||
routes.set("/wallet/login-text-code", WalletLoginTextCode); |
||||
routes.set("/wallet/create", WalletCreate); |
||||
routes.set("/i/:invitation", Invitation); |
||||
routes.set("/user", User); |
||||
routes.set("/user/registered", UserRegistered); |
||||
routes.set("/wallet", WalletInfo); |
||||
routes.set("/user/accounts", AccountInfo); |
||||
routes.set("/wallet/scanqr", ScanQR); |
||||
routes.set("/install", Install); |
||||
routes.set("/shared", Shared); |
||||
routes.set("/site", Site); |
||||
routes.set(/^\/did:ng:(.*)/i, NURI); |
||||
routes.set("*", NotFound); |
||||
|
||||
let unsubscribe = () => {}; |
||||
|
||||
let wallet_channel; |
||||
let unsub_main_close; |
||||
|
||||
// window.refresh_wallets = async () => { |
||||
// let walls = await ng.get_wallets(); |
||||
// wallets.set(walls); |
||||
// }; |
||||
|
||||
onMount(async () => { |
||||
|
||||
//console.log("hide splash", window.supported); |
||||
if (window.supported) { |
||||
window.document.getElementById("splash").className="noshow"; |
||||
window.document.getElementById("app").className=""; |
||||
} |
||||
|
||||
//window.document.getElementById("splash").className="splash-loaded"; |
||||
try { |
||||
await disconnections_subscribe(); |
||||
await select_default_lang(); |
||||
} catch (e) { |
||||
console.warn(e); |
||||
//console.log("called disconnections_subscribe twice"); |
||||
} |
||||
let tauri_platform = import.meta.env.TAURI_PLATFORM; |
||||
//console.log(await ng.test()); |
||||
if (tauri_platform) { |
||||
let walls = await ng.get_wallets(); |
||||
wallets.set(walls); |
||||
|
||||
unsubscribe = active_wallet.subscribe(async (value) => { |
||||
if (value) { |
||||
if (value.wallet) { |
||||
opened_wallets.update((w) => { |
||||
w[value.id] = value.wallet; |
||||
return w; |
||||
}); |
||||
} else { |
||||
await ng.wallet_close(value.id); |
||||
active_wallet.set(undefined); |
||||
opened_wallets.update((w) => { |
||||
delete w[value.id]; |
||||
return w; |
||||
}); |
||||
push("#/wallet/login"); |
||||
} |
||||
} |
||||
}); |
||||
|
||||
let window_api = await import("@tauri-apps/plugin-window"); |
||||
let event_api = await import("@tauri-apps/api/event"); |
||||
let main = window_api.Window.getByLabel("main"); |
||||
unsub_main_close = await main.onCloseRequested(async (event) => { |
||||
//console.log("onCloseRequested main"); |
||||
await event_api.emit("close_all", {}); |
||||
let registration = window_api.Window.getByLabel("registration"); |
||||
if (registration) { |
||||
await registration.close(); |
||||
} |
||||
let viewer = window_api.Window.getByLabel("viewer"); |
||||
if (viewer) { |
||||
await viewer.close(); |
||||
} |
||||
}); |
||||
} else { |
||||
// ON WEB CLIENTS |
||||
window.addEventListener("storage", async (event) => { |
||||
//console.log("localStorage event", event); |
||||
if (event.storageArea != localStorage) return; |
||||
if (event.key === "ng_wallets") { |
||||
//console.log("localStorage", JSON.stringify($wallets)); |
||||
await ng.wallets_reload(); |
||||
wallets.set(await ng.get_wallets()); |
||||
//console.log("localStorage after", JSON.stringify($wallets)); |
||||
} |
||||
}); |
||||
wallets.set(await ng.get_wallets()); |
||||
// TODO: check the possibility of XS-Leaks. I don't see any, but it should be checked |
||||
// https://github.com/privacycg/storage-partitioning |
||||
// https://github.com/whatwg/html/issues/5803 |
||||
// https://w3cping.github.io/privacy-threat-model/ |
||||
// https://chromium.googlesource.com/chromium/src/+/fa17a6142f99d58de533d65cd8f3cd0e9a8ee58e |
||||
// https://bugs.webkit.org/show_bug.cgi?id=229814 |
||||
wallet_channel = new BroadcastChannel("ng_wallet"); |
||||
window.wallet_channel = wallet_channel; |
||||
wallet_channel.postMessage({ cmd: "startup" }, location.href); |
||||
wallet_channel.onmessage = async (event) => { |
||||
// console.log(event.data.cmd, event.data); |
||||
if (!location.href.startsWith(event.origin)) return; |
||||
switch (event.data.cmd) { |
||||
case "startup": |
||||
for (let saved_id of Object.keys($wallets)) { |
||||
if ($wallets[saved_id].in_memory) { |
||||
wallet_channel.postMessage( |
||||
{ |
||||
cmd: "new_in_mem", |
||||
name: saved_id, |
||||
lws: $wallets[saved_id], |
||||
}, |
||||
location.href |
||||
); |
||||
} |
||||
} |
||||
// if ($active_wallet && $active_wallet.wallet) { |
||||
// wallet_channel.postMessage( |
||||
// { cmd: "opened", wallet: $active_wallet }, |
||||
// location.href |
||||
// ); |
||||
// } |
||||
for (let opened of Object.keys($opened_wallets)) { |
||||
wallet_channel.postMessage( |
||||
{ |
||||
cmd: "opened", |
||||
wallet: { wallet: $opened_wallets[opened], id: opened }, |
||||
}, |
||||
location.href |
||||
); |
||||
} |
||||
|
||||
break; |
||||
case "opened": |
||||
if (!$opened_wallets[event.data.wallet.id]) { |
||||
//await tick(); |
||||
// console.log( |
||||
// "ADDING TO OPENED", |
||||
// event.data.wallet.id, |
||||
// JSON.stringify($opened_wallets), |
||||
// event.data.wallet.wallet |
||||
// ); |
||||
if (event.data.ng_wallets) { |
||||
localStorage.setItem("ng_wallets", event.data.ng_wallets); |
||||
await ng.wallets_reload(); |
||||
wallets.set(await ng.get_wallets()); |
||||
} |
||||
try { |
||||
await ng.wallet_was_opened(event.data.wallet.wallet); |
||||
} catch (e) { |
||||
console.error(e); |
||||
} |
||||
opened_wallets.update((w) => { |
||||
w[event.data.wallet.id] = event.data.wallet.wallet; |
||||
return w; |
||||
}); |
||||
} |
||||
break; |
||||
case "new_in_mem": |
||||
//console.log("GOT new_in_mem", event.data); |
||||
if (event.data.lws) { |
||||
if (!$wallets[event.data.name]) { |
||||
await ng.add_in_memory_wallet(event.data.lws); |
||||
wallets.update((w) => { |
||||
w[event.data.name] = event.data.lws; |
||||
return w; |
||||
}); |
||||
} |
||||
} |
||||
if (event.data.opened) { |
||||
if (!$opened_wallets[event.data.name]) { |
||||
await ng.wallet_was_opened(event.data.opened); |
||||
opened_wallets.update((w) => { |
||||
w[event.data.name] = event.data.opened; |
||||
return w; |
||||
}); |
||||
} |
||||
} |
||||
break; |
||||
case "closed": |
||||
opened_wallets.update((w) => { |
||||
delete w[event.data.walletid]; |
||||
return w; |
||||
}); |
||||
await ng.wallet_close(event.data.walletid); |
||||
if ($active_wallet && $active_wallet.id == event.data.walletid) { |
||||
await close_active_session(); |
||||
active_wallet.set(undefined); |
||||
push("#/wallet/login"); |
||||
} |
||||
break; |
||||
} |
||||
}; |
||||
unsubscribe = active_wallet.subscribe(async (value) => { |
||||
if (value) { |
||||
if (value.wallet) { |
||||
opened_wallets.update((w) => { |
||||
w[value.id] = value.wallet; |
||||
return w; |
||||
}); |
||||
//await tick(); |
||||
//console.log("posting opened"); |
||||
wallet_channel.postMessage( |
||||
{ |
||||
cmd: "opened", |
||||
wallet: value, |
||||
ng_wallets: localStorage.getItem("ng_wallets"), |
||||
}, |
||||
location.href |
||||
); |
||||
} else { |
||||
wallet_channel.postMessage( |
||||
{ cmd: "closed", walletid: value.id }, |
||||
location.href |
||||
); |
||||
active_wallet.set(undefined); |
||||
await ng.wallet_close(value.id); |
||||
//active_session.set(undefined); |
||||
opened_wallets.update((w) => { |
||||
delete w[value.id]; |
||||
return w; |
||||
}); |
||||
push("#/wallet/login"); |
||||
} |
||||
} else { |
||||
} |
||||
}); |
||||
} |
||||
|
||||
}); |
||||
|
||||
onDestroy(() => { |
||||
unsubscribe(); |
||||
if (unsub_main_close) unsub_main_close(); |
||||
}); |
||||
|
||||
// import { to_debug } from "./wallet_emojis"; |
||||
// to_debug(); |
||||
</script> |
||||
|
||||
<!-- <p> |
||||
{!$active_session} |
||||
{JSON.stringify(Object.keys($wallets))} |
||||
{JSON.stringify($active_wallet)} |
||||
{JSON.stringify(Object.keys($opened_wallets))} |
||||
{JSON.stringify($active_session)} |
||||
</p> --> |
||||
|
||||
{#if $isLoading} |
||||
<p class="text-center">Loading translations...</p> |
||||
{:else} |
||||
<Router {routes} /> |
||||
{/if} |
@ -1,44 +0,0 @@ |
||||
// Copyright (c) 2022-2025 Niko Bonnieure, Par le Peuple, NextGraph.org developers
|
||||
// All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0
|
||||
// <LICENSE-APACHE2 or http://www.apache.org/licenses/LICENSE-2.0>
|
||||
// or the MIT license <LICENSE-MIT or http://opensource.org/licenses/MIT>,
|
||||
// at your option. All files in the project carrying such
|
||||
// notice may not be copied, modified, or distributed except
|
||||
// according to those terms.
|
||||
import {createAsyncProxy} from "async-proxy"; |
||||
|
||||
let proxy = null; |
||||
|
||||
let api = createAsyncProxy({},{ |
||||
async apply(target, path, caller, args) { |
||||
if (proxy) { |
||||
//console.log("calling ",path, args);
|
||||
return Reflect.apply(proxy[path], caller, args) |
||||
} |
||||
else |
||||
throw new Error("You must call init_api() before using the API. load an API from @nextgraph-monorepo/app_api_tauri or @nextgraph-monorepo/app_api_web"); |
||||
} |
||||
}); |
||||
|
||||
export default api; |
||||
|
||||
export const NG_EU_BSP = "https://nextgraph.eu"; |
||||
export const NG_EU_BSP_REGISTER = import.meta.env.PROD |
||||
? "https://account.nextgraph.eu/#/create" |
||||
: "http://account-dev.nextgraph.eu:5173/#/create"; |
||||
|
||||
export const NG_NET_BSP = "https://nextgraph.net"; |
||||
export const NG_NET_BSP_REGISTER = import.meta.env.PROD |
||||
? "https://account.nextgraph.net/#/create" |
||||
: "http://account-dev.nextgraph.net:5173/#/create"; |
||||
|
||||
export const APP_ACCOUNT_REGISTERED_SUFFIX = "/#/user/registered"; |
||||
export const APP_WALLET_CREATE_SUFFIX = "/#/wallet/create"; |
||||
|
||||
export const LINK_NG_BOX = "https://nextgraph.org/ng-box/"; |
||||
export const LINK_SELF_HOST = "https://nextgraph.org/self-host/"; |
||||
|
||||
export const init_api = function (a) { |
||||
proxy = a; |
||||
} |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 7.2 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 786 B |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 7.5 KiB |
Before Width: | Height: | Size: 6.6 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 7.6 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 5.9 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 7.7 KiB |