-
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.
Fixed compile errors in client package
- Loading branch information
Showing
21 changed files
with
851 additions
and
214 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
packages/client/src/intent-resolution/DesktopAgentIntentResolver.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,20 @@ | ||
import { AppIntent } from "@finos/fdc3"; | ||
import { IntentResolver, Messaging } from "da-proxy"; | ||
import { SingleAppIntent } from "da-proxy/src/intents/IntentResolver"; | ||
|
||
/** | ||
* Works with the desktop agent to provide a resolution to the intent choices. | ||
*/ | ||
export class DesktopAgentIntentResolver implements IntentResolver { | ||
|
||
private readonly m: Messaging | ||
|
||
constructor(m: Messaging) { | ||
this.m = m | ||
} | ||
|
||
async chooseIntent(_appIntents: AppIntent[]): Promise<SingleAppIntent> { | ||
throw new Error("Method not implemented."); | ||
} | ||
|
||
} |
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
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
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
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
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
10 changes: 0 additions & 10 deletions
10
packages/da-server/src/directory/fdc3-2.1-json-directory.ts
This file was deleted.
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
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
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
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 @@ | ||
import { WebSocketServer } from 'ws'; | ||
|
||
const wss = new WebSocketServer(); | ||
|
||
wss.on('connection', function connection(ws) { | ||
ws.on('error', console.error); | ||
|
||
ws.on('message', function message(data) { | ||
console.log('received: %s', data); | ||
}); | ||
|
||
ws.send('something'); | ||
}); |
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,36 @@ | ||
import { BasicDirectory } from "da-server/src/directory/BasicDirectory"; | ||
import { DirectoryApp } from "da-server/src/directory/DirectoryInterface"; | ||
import { readFile } from 'fs/promises'; | ||
|
||
function loadRemotely(u: string) { | ||
return fetch(u).then((response) => response.json()); | ||
} | ||
|
||
function loadLocally(u: string) { | ||
return readFile(u) | ||
.then((buf) => buf.toString('utf8')) | ||
.then((data) => JSON.parse(data)); | ||
} | ||
|
||
async function load(url: string): Promise<DirectoryApp[]> { | ||
if (url.startsWith('http')) { | ||
return await loadRemotely(url).then(convertToDirectoryList); | ||
} else { | ||
return await loadLocally(url).then(convertToDirectoryList); | ||
} | ||
} | ||
const convertToDirectoryList = (data: any) => { | ||
return data.applications as DirectoryApp[]; | ||
} | ||
|
||
export class FDC3_2_1_JSONDirectory extends BasicDirectory { | ||
|
||
constructor() { | ||
super([]) | ||
} | ||
|
||
async load(url: string) { | ||
this.allApps = await load(url); | ||
} | ||
|
||
} |
Oops, something went wrong.