-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from finos-labs/rob-first-version
Apps Working, Desktop Agent created
- Loading branch information
Showing
14 changed files
with
2,757 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/dist | ||
/node_modules |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"compile": "webpack build", | ||
"serve": "npx http-server . -p 3001 -c-1", | ||
"start": "npm run compile && npm run serve" | ||
}, | ||
"dependencies": { | ||
"@finos/fdc3": "^2.0.3", | ||
"source-map-support": "^0.5.21", | ||
"stream-browserify": "^3.0.0", | ||
"util": "^0.12.4", | ||
"window": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"buffer": "^6.0.3", | ||
"css-loader": "^6.7.2", | ||
"http-server": "^14.1.1", | ||
"prettier": "^2.5.1", | ||
"shx": "^0.3.4", | ||
"style-loader": "^3.3.1", | ||
"ts-loader": "^9.2.7", | ||
"typescript": "^4.6.2", | ||
"webpack": "^5.69.1", | ||
"webpack-cli": "^4.9.2" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { DesktopAgent} from '@finos/fdc3' | ||
|
||
|
||
export function load(options: any) : Promise<DesktopAgent> { | ||
|
||
return new Promise<DesktopAgent>((resolve) => { | ||
|
||
}); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { load } from '../WebC3' | ||
|
||
const options = { | ||
|
||
}; | ||
|
||
function createContext(i: number) { | ||
return { | ||
type: "demo.counter", | ||
count: i | ||
} | ||
} | ||
|
||
/** | ||
* Calling this function should get the fdc3 DesktopAgent and then | ||
* broadcast 50 context elements to the default channel. | ||
* | ||
* Can be called any number of times. | ||
*/ | ||
async function startBroadcasting() { | ||
const fdc3 = await load(options); | ||
for (let index = 0; index < 50; index++) { | ||
setInterval(() => fdc3.broadcast(createContext(index)), index*1000); | ||
} | ||
} | ||
|
||
window.addEventListener("load", () => { | ||
const broadcast = document.getElementById("broadcast"); | ||
broadcast.addEventListener("click", () => startBroadcasting()); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { load } from '../WebC3' | ||
|
||
const options = { | ||
|
||
}; | ||
|
||
load(options).then(fdc => { | ||
const log = document.getElementById("log"); | ||
const msg = document.createElement("p"); | ||
msg.textContent = "FDC Loaded: "+JSON.stringify(fdc.getInfo()); | ||
log.appendChild(msg); | ||
|
||
fdc.addContextListener(null, context => { | ||
const msg = document.createElement("p"); | ||
msg.textContent = "Received: "+JSON.stringify(msg); | ||
log.appendChild(msg); | ||
}) | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
window.addEventListener("load", () => { | ||
|
||
// set up desktop agent handler here. | ||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<script src="../../dist/app1.js"></script> | ||
</head> | ||
|
||
<body> | ||
<p>FDC3 For the Web App1</p> | ||
<button id="broadcast">Press Me To Broadcast</button> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<script src="../../dist/app2.js"></script> | ||
</head> | ||
|
||
<body> | ||
<p>FDC3 For the Web App2</p> | ||
<div id="log"></div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8" /> | ||
<script src="../../dist/dummy-desktop-agent.js"></script> | ||
</head> | ||
|
||
<body> | ||
<p>Dummy Desktop Agent</p> | ||
|
||
<a id="app1" href="../app1/index.html" target="_blank">Open App 1</button> | ||
|
||
<button id="app2" href="../app2/index.html" target="_blank">Open App 2</button> | ||
|
||
<div id="log"></div> | ||
|
||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "esnext", | ||
"lib": ["dom", "esnext"], | ||
"allowSyntheticDefaultImports": true, | ||
"noImplicitAny": false, | ||
"target": "es5", | ||
"allowJs": true, | ||
"moduleResolution":"Node", | ||
"esModuleInterop": true, | ||
"sourceMap": true | ||
}, | ||
"include": ["src/**/*.ts"], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
const path = require("path"); | ||
const webpack = require("webpack"); | ||
|
||
const isProduction = process.env.NODE_ENV == "production"; | ||
|
||
const config = { | ||
entry: { | ||
"app1": "./src/app1/index.ts", | ||
"app2": "./src/app2/index.ts", | ||
"dummy-desktop-agent": "./src/dummy-desktop-agent/index.ts", | ||
"dummy-implementation": "./src/dummy-desktop-agent/implementation.ts", | ||
"WebC3": "./src/WebC3/index.ts" | ||
}, | ||
devtool: "source-map", | ||
output: { | ||
filename: "[name].js", | ||
//globalObject: 'this', | ||
path: path.resolve(__dirname, "./dist"), | ||
}, | ||
plugins: [ | ||
new webpack.ProvidePlugin({ | ||
process: "process/browser", | ||
Buffer: ["buffer", "Buffer"], | ||
}), | ||
], | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.(ts|tsx)$/i, | ||
loader: "ts-loader", | ||
exclude: [path.resolve(__dirname, "/node_modules/")], | ||
}, | ||
{ | ||
test: /\.css$/, | ||
use: ["style-loader", "css-loader"], | ||
}, | ||
], | ||
}, | ||
resolve: { | ||
extensions: [".tsx", ".ts", ".js"], | ||
fallback: { | ||
util: require.resolve("util/"), | ||
stream: require.resolve("stream-browserify/"), | ||
buffer: require.resolve("buffer/"), | ||
window: false, | ||
}, | ||
}, | ||
}; | ||
|
||
module.exports = () => { | ||
if (isProduction) { | ||
config.mode = "production"; | ||
} else { | ||
config.mode = "development"; | ||
} | ||
return config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
Arguments: | ||
/usr/local/bin/node /opt/homebrew/Cellar/yarn/1.22.19/libexec/bin/yarn.js start | ||
|
||
PATH: | ||
/Users/rob/miniconda3/bin:/Users/rob/miniconda3/condabin:/Users/rob/.rbenv/shims:/Users/rob/.rbenv/bin:/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin:/Users/rob/Documents/apache-maven-3.6.3/bin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/MacGPG2/bin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/rob/.rbenv/shims:/Users/rob/.rbenv/bin:/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin:/Users/rob/Documents/apache-maven-3.6.3/bin:/opt/homebrew/bin:/Users/rob/Library/Python/3.8/bin:/opt/homebrew/bin:/Users/rob/Library/Python/3.8/bin | ||
|
||
Yarn version: | ||
1.22.19 | ||
|
||
Node version: | ||
18.16.1 | ||
|
||
Platform: | ||
darwin arm64 | ||
|
||
Trace: | ||
SyntaxError: /Users/rob/Documents/finos/fdc3-general/fdc3-for-the-web/package.json: Unexpected token } in JSON at position 166 | ||
at JSON.parse (<anonymous>) | ||
at /opt/homebrew/Cellar/yarn/1.22.19/libexec/lib/cli.js:1629:59 | ||
at Generator.next (<anonymous>) | ||
at step (/opt/homebrew/Cellar/yarn/1.22.19/libexec/lib/cli.js:310:30) | ||
at /opt/homebrew/Cellar/yarn/1.22.19/libexec/lib/cli.js:321:13 | ||
|
||
npm manifest: | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"compile": "webpack build", | ||
"serve": "npx http-server . -p 3001 -c-1", | ||
"start": "npm run compile && npm run serve", | ||
}, | ||
"dependencies": { | ||
"@finos/fdc3": "^2.0.3", | ||
"source-map-support": "^0.5.21", | ||
"stream-browserify": "^3.0.0", | ||
"util": "^0.12.4", | ||
"window": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"buffer": "^6.0.3", | ||
"css-loader": "^6.7.2", | ||
"http-server": "^14.1.1", | ||
"prettier": "^2.5.1", | ||
"shx": "^0.3.4", | ||
"style-loader": "^3.3.1", | ||
"ts-loader": "^9.2.7", | ||
"typescript": "^4.6.2", | ||
"webpack": "^5.69.1", | ||
"webpack-cli": "^4.9.2" | ||
} | ||
} | ||
|
||
yarn manifest: | ||
No manifest | ||
|
||
Lockfile: | ||
No lockfile |