Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added skeleton project for fdc desktop agent TS implementation #227

Merged
merged 2 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/messaging/js/composeui-messaging-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@morgan-stanley/composeui-messaging-client",
"version": "0.1.0-alpha.1",
"private": true,
"description": "JavaScript client for Compose UI's Message Router",
"description": "JavaScript client for ComposeUI's Message Router",
"type": "module",
"files": [
"dist/esm/**/*"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"target": "ESNext",
"module": "ESNext",
"moduleResolution": "Node",
"target": "es2022",
"module": "es2022",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"esModuleInterop": true,
Expand All @@ -12,7 +12,7 @@
"noImplicitThis": true,
"outDir": "dist",
"lib": [
"ES2021",
"es2022",
"DOM"
],
"types": [
Expand Down
5 changes: 5 additions & 0 deletions src/shell/js/composeui-fdc3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->

# ComposeUI FDC3 implementation

This is the implementation of the FDC3 DesktopAgent API injected into web apps running under ComposeUI.
25 changes: 25 additions & 0 deletions src/shell/js/composeui-fdc3/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@morgan-stanley/composeui-fdc3",
"version": "0.1.0",
"description": "FDC3 DesktopAgent implementation for Compose UI",
"type": "module",
"main": "output/index.js",
"module": "output/index.js",
"scripts": {
"clean": "rimraf output",
"build": "npm run clean && tsc",
"test": "node -e \"console.log('no tests exists yet')\""
},
"author": "Morgan Stanley",
"license": "Apache-2.0",
"dependencies": {
"@types/node": "^18.11.18",
"@finos/fdc3": "^2.0.1"
},
"devDependencies":{
"rimraf": "4.1.2",
"ts-node": "10.9.1",
"tslib": "^2.4.0",
"typescript": "^4.7.4"
}
}
93 changes: 93 additions & 0 deletions src/shell/js/composeui-fdc3/src/ComposeDesktopAgent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Morgan Stanley makes this available to you under the Apache License,
* Version 2.0 (the "License"). You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. Unless required by applicable law or agreed
* to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions
* and limitations under the License.
*
*/


import { AppIdentifier, AppIntent, AppMetadata, Channel, Context, ContextHandler, DesktopAgent, ImplementationMetadata, IntentHandler, IntentResolution, Listener, PrivateChannel } from '@finos/fdc3'

export class ComposeDesktopAgent implements DesktopAgent {
public open(app?: string | AppIdentifier, context?: Context): Promise<AppIdentifier> {
throw new Error("Not implemented");
}

public findIntent(intent: string, context?: Context, resultType?: string): Promise<AppIntent> {
throw new Error("Not implemented");
}

public findIntentsByContext(context: Context, resultType?: string): Promise<Array<AppIntent>> {
throw new Error("Not implemented");
}

public findInstances(app: AppIdentifier): Promise<Array<AppIdentifier>> {
throw new Error("Not implemented");
}

public broadcast(context: Context): Promise<void> {
throw new Error("Not implemented");
}

public raiseIntent(intent: string, context: Context, app?: string | AppIdentifier): Promise<IntentResolution> {
throw new Error("Not implemented");
}

public raiseIntentForContext(context: Context, app?: string | AppIdentifier): Promise<IntentResolution> {
throw new Error("Not implemented");
}

public addIntentListener(intent: string, handler: IntentHandler): Promise<Listener> {
throw new Error("Not implemented");
}

public addContextListener(contextType: string | null | ContextHandler, handler?: ContextHandler): Promise<Listener> {
throw new Error("Not implemented");
}

public getUserChannels(): Promise<Array<Channel>> {
throw new Error("Not implemented");
}

public joinUserChannel(channelId: string): Promise<void> {
throw new Error("Not implemented");
}

public getOrCreateChannel(channelId: string): Promise<Channel> {
throw new Error("Not implemented");
}

public createPrivateChannel(): Promise<PrivateChannel> {
throw new Error("Not implemented");
}

public getCurrentChannel(): Promise<Channel | null> {
throw new Error("Not implemented");
}

public leaveCurrentChannel(): Promise<void> {
throw new Error("Not implemented");
}

public getInfo(): Promise<ImplementationMetadata> {
throw new Error("Not implemented");
}

public getAppMetadata(app: AppIdentifier): Promise<AppMetadata> {
throw new Error("Not implemented");
}

public getSystemChannels(): Promise<Channel[]> {
throw new Error("Not implemented");
}

public joinChannel(channelId: string): Promise<void> {
throw new Error("Not implemented");
}
}
15 changes: 15 additions & 0 deletions src/shell/js/composeui-fdc3/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Morgan Stanley makes this available to you under the Apache License,
* Version 2.0 (the "License"). You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. Unless required by applicable law or agreed
* to in writing, software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions
* and limitations under the License.
*
*/


export * from "./ComposeDesktopAgent";
14 changes: 14 additions & 0 deletions src/shell/js/composeui-fdc3/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"moduleResolution": "node",
kruplm marked this conversation as resolved.
Show resolved Hide resolved
"types": [ "node" ],
"module": "es2022",
"esModuleInterop": true,
"target": "es2022",
"declaration": true,
"outDir": "output",
"lib": [ "es2022" ],
"strict": true
},
"include": [ "src/**/*.ts" ]
}