@coasys/ad4m-connect 0.8.0-fix
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/LICENSE +160 -0
- package/README.md +92 -0
- package/dist/components/AgentLocked.d.ts +4 -0
- package/dist/components/CapNotMatching.d.ts +1 -0
- package/dist/components/CouldNotMakeRequest.d.ts +1 -0
- package/dist/components/Disconnected.d.ts +3 -0
- package/dist/components/Header.d.ts +1 -0
- package/dist/components/InvalidToken.d.ts +3 -0
- package/dist/components/Loading.d.ts +1 -0
- package/dist/components/Logo.d.ts +1 -0
- package/dist/components/RequestCapability.d.ts +8 -0
- package/dist/components/ScanQRCode.d.ts +5 -0
- package/dist/components/Settings.d.ts +11 -0
- package/dist/components/Start.d.ts +8 -0
- package/dist/components/VerifyCode.d.ts +6 -0
- package/dist/core.d.ts +55 -0
- package/dist/core.js +1010 -0
- package/dist/electron.d.ts +2 -0
- package/dist/electron.js +1 -0
- package/dist/utils.d.ts +9 -0
- package/dist/utils.js +1 -0
- package/dist/web.d.ts +46 -0
- package/dist/web.js +1701 -0
- package/package.json +70 -0
- package/public/Ad4mLogo.png +0 -0
- package/public/dialog.html +49 -0
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@coasys/ad4m-connect",
|
|
3
|
+
"description": "Lib for handling everything needed to setup a connection to a local or remote ad4m-executor",
|
|
4
|
+
"license": "CAL-1.0",
|
|
5
|
+
"main": "dist/web.js",
|
|
6
|
+
"browser": "dist/web.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"public"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./dist/web.js",
|
|
13
|
+
"./electron": {
|
|
14
|
+
"require": "./dist/electron.js",
|
|
15
|
+
"type": "commonjs"
|
|
16
|
+
},
|
|
17
|
+
"./web": {
|
|
18
|
+
"import": "./dist/web.js",
|
|
19
|
+
"require": "./dist/web.js",
|
|
20
|
+
"type": "module"
|
|
21
|
+
},
|
|
22
|
+
"./core": {
|
|
23
|
+
"import": "./dist/core.js",
|
|
24
|
+
"require": "./dist/core.js",
|
|
25
|
+
"type": "module"
|
|
26
|
+
},
|
|
27
|
+
"./utils": {
|
|
28
|
+
"import": "./dist/utils.js",
|
|
29
|
+
"require": "./dist/utils.js",
|
|
30
|
+
"type": "module"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"release": "np --no-2fa --no-tests --tag=latest",
|
|
35
|
+
"release:beta": "np --no-2fa --no-tests --tag=beta --any-branch",
|
|
36
|
+
"dev": "NODE_ENV=dev && vite dev",
|
|
37
|
+
"serve": "npx serve",
|
|
38
|
+
"build": "pnpm run build:core && pnpm run build:web && pnpm run build:electron && pnpm run build:utils && tsc",
|
|
39
|
+
"build:core": "tsc --project tsconfig.json && node scripts/esbuild.js",
|
|
40
|
+
"build:web": "tsc --project tsconfig.json && node scripts/esbuild_web.js",
|
|
41
|
+
"build:utils": "tsc --project tsconfig.json && node scripts/esbuild_utils.js",
|
|
42
|
+
"build:electron": "tsc --project tsconfig.json && node scripts/esbuild_electron.js"
|
|
43
|
+
},
|
|
44
|
+
"author": {
|
|
45
|
+
"name": "Nicolas Luck",
|
|
46
|
+
"email": "nicolas@coasys.org"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@apollo/client": "3.7.10",
|
|
50
|
+
"@coasys/ad4m": "*",
|
|
51
|
+
"esbuild": "^0.15.5",
|
|
52
|
+
"esbuild-plugin-lit": "^0.0.10",
|
|
53
|
+
"graphql-ws": "5.12.0",
|
|
54
|
+
"np": "^7.6.2",
|
|
55
|
+
"npm-run-all": "^4.1.5",
|
|
56
|
+
"typescript": "^4.6.2",
|
|
57
|
+
"vite": "^4.1.1",
|
|
58
|
+
"@types/node": "^16.11.11"
|
|
59
|
+
},
|
|
60
|
+
"dependencies": {
|
|
61
|
+
"@undecaf/barcode-detector-polyfill": "^0.9.15",
|
|
62
|
+
"@undecaf/zbar-wasm": "^0.9.12",
|
|
63
|
+
"auto-bind": "^5.0.1",
|
|
64
|
+
"electron": "^20.0.3",
|
|
65
|
+
"esbuild-plugin-copy": "^2.1.1",
|
|
66
|
+
"esbuild-plugin-replace": "^1.4.0",
|
|
67
|
+
"lit": "^2.3.1"
|
|
68
|
+
},
|
|
69
|
+
"version": "0.8.0-fix"
|
|
70
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
6
|
+
<title>AD4M Connection Wizard</title>
|
|
7
|
+
<link rel="icon" type="image/png" href="favicon.png" />
|
|
8
|
+
</head>
|
|
9
|
+
|
|
10
|
+
<body>
|
|
11
|
+
<div id="container"></div>
|
|
12
|
+
<script type="module">
|
|
13
|
+
const { ipcRenderer } = require("electron");
|
|
14
|
+
|
|
15
|
+
import { getForVersion } from "../src/utils";
|
|
16
|
+
import Ad4mConnectUI from "../dist/web.js";
|
|
17
|
+
|
|
18
|
+
const {
|
|
19
|
+
appName,
|
|
20
|
+
appDesc = "",
|
|
21
|
+
appDomain = "",
|
|
22
|
+
appIconPath,
|
|
23
|
+
executorUrl,
|
|
24
|
+
capabilityToken,
|
|
25
|
+
capabilities,
|
|
26
|
+
} = ipcRenderer.sendSync("get");
|
|
27
|
+
|
|
28
|
+
const ui = Ad4mConnectUI({
|
|
29
|
+
appName,
|
|
30
|
+
appDesc,
|
|
31
|
+
appDomain,
|
|
32
|
+
appIconPath,
|
|
33
|
+
capabilities,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
ui.connect();
|
|
37
|
+
|
|
38
|
+
ui.addEventListener("authstatechange", (e) => {
|
|
39
|
+
if (ui.authState === "authenticated") {
|
|
40
|
+
console.log(ui.token);
|
|
41
|
+
ipcRenderer.send("resolve", {
|
|
42
|
+
executorUrl,
|
|
43
|
+
capabilityToken: ui.token || getForVersion("ad4mtoken"),
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
48
|
+
</body>
|
|
49
|
+
</html>
|