Skip to content

Commit

Permalink
Added namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
robmoffat committed May 10, 2024
1 parent 4242e9c commit d2b4d45
Show file tree
Hide file tree
Showing 31 changed files with 803 additions and 762 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@finos/web-fdc3",
"name": "@kite9/web-fdc3",
"private": true,
"version": "0.0.0",
"workspaces": [
Expand Down
6 changes: 3 additions & 3 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "client",
"name": "@kite9/client",
"main": "src/index.ts",
"version": "0.0.0",
"scripts": {
"build": "tsc -b"
},
"dependencies": {
"@finos/fdc3": "^2.1.0-beta.4",
"@kite9/da-proxy": "workspace:*",
"@kite9/fdc3-common": "workspace:*",
"@types/uuid": "^9.0.7",
"da-proxy": "workspace:*",
"fdc3-common": "workspace:*",
"uuid": "^9.0.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DesktopAgent } from '@finos/fdc3'
import { Options } from 'fdc3-common';
import { Options } from '@kite9/fdc3-common';
import postMessage from './strategies/post-message'
//import electronEvent from './strategies/electron-event'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AppIntent, IntentResult } from "@finos/fdc3";
import { Messaging } from "da-proxy";
import { IntentResolver, SingleAppIntent, IntentResolutionChoiceAgentResponse } from "fdc3-common";
import { Messaging } from "@kite9/da-proxy";
import { IntentResolver, SingleAppIntent, IntentResolutionChoiceAgentResponse } from "@kite9/fdc3-common";

/**
* Works with the desktop agent to provide a resolution to the intent choices.
Expand Down
6 changes: 3 additions & 3 deletions packages/client/src/messaging/MessagePortMessaging.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AppIdentifier } from "@finos/fdc3"
import { AbstractMessaging } from "da-proxy"
import { RegisterableListener } from "da-proxy/src/listeners/RegisterableListener"
import { exchangePostMessage } from "fdc3-common"
import { AbstractMessaging } from "@kite9/da-proxy"
import { RegisterableListener } from "@kite9/da-proxy/src/listeners/RegisterableListener"
import { exchangePostMessage } from "@kite9/fdc3-common"
import { v4 as uuidv4 } from "uuid"

export class MessagePortMessaging extends AbstractMessaging {
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/messaging/message-port.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DesktopAgent } from "@finos/fdc3";
import { BasicDesktopAgent, DefaultChannelSupport, DefaultAppSupport, DefaultIntentSupport, DefaultChannel, DefaultHandshakeSupport } from "da-proxy";
import { APIResponseMessage, FDC3_PORT_TRANSFER_RESPONSE_TYPE, FDC3_PORT_TRANSFER_REQUEST_TYPE, Options, exchangeForMessagePort, APIResponseMessageParentWindow, APIResponseMessageIFrame } from "fdc3-common"
import { BasicDesktopAgent, DefaultChannelSupport, DefaultAppSupport, DefaultIntentSupport, DefaultChannel, DefaultHandshakeSupport } from "@kite9/da-proxy";
import { APIResponseMessage, FDC3_PORT_TRANSFER_RESPONSE_TYPE, FDC3_PORT_TRANSFER_REQUEST_TYPE, Options, exchangeForMessagePort, APIResponseMessageParentWindow, APIResponseMessageIFrame } from "@kite9/fdc3-common"
import { MessagePortMessaging } from "./MessagePortMessaging";
import { DesktopAgentIntentResolver } from "../intent-resolution/DesktopAgentIntentResolver";

Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/strategies/electron-event.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DesktopAgent, fdc3Ready } from "@finos/fdc3";
import { Loader, Options } from "fdc3-common";
import { Loader, Options } from "@kite9/fdc3-common";

/**
* This approach will resolve the loader promise if the fdc3Ready event occurs.
Expand All @@ -11,7 +11,7 @@ const loader: Loader = (_options: Options) => {
fdc3Ready().then(() => {
resolve(window.fdc3);
})

});

return out;
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/strategies/post-message.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DesktopAgent } from '@finos/fdc3'
import { APIResponseMessage, Loader, Options, FDC3_API_RESPONSE_MESSAGE_TYPE, FDC3_API_REQUEST_MESSAGE_TYPE } from 'fdc3-common'
import { APIResponseMessage, Loader, Options, FDC3_API_RESPONSE_MESSAGE_TYPE, FDC3_API_REQUEST_MESSAGE_TYPE } from '@kite9/fdc3-common'
import { messagePortInit } from '../messaging/message-port';

const loader: Loader = (options: Options) => {
Expand Down
6 changes: 3 additions & 3 deletions packages/da-proxy/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "da-proxy",
"name": "@kite9/da-proxy",
"main": "src/index.ts",
"scripts": {
"build": "nyc --reporter=lcov --reporter=text cucumber-js",
"b2": "tsx cucumber-js"
},
"dependencies": {
"@finos/fdc3": "^2.1.0-beta.6",
"tsx": "^4.7.1"
"@kite9/fdc3-common": "workspace:*"
},
"devDependencies": {
"@cucumber/cucumber": "10.3.1",
Expand All @@ -25,12 +25,12 @@
"eslint-plugin-import": "2.22.1",
"eslint-plugin-prettier": "3.3.1",
"expect": "^29.7.0",
"fdc3-common": "workspace:*",
"is-ci": "2.0.0",
"jsonpath-plus": "^7.2.0",
"nyc": "15.1.0",
"prettier": "2.2.1",
"ts-node": "^10.9.2",
"tsx": "^4.7.1",
"typescript": "^5.3.2",
"uuid": "^9.0.1"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/da-proxy/src/intents/DefaultIntentSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Messaging } from "../Messaging";
import { AppDestinationIdentifier, FindIntentAgentRequest, FindIntentAgentRequestMeta, FindIntentAgentResponse, FindIntentsByContextAgentRequest, FindIntentsByContextAgentRequestMeta, FindIntentsByContextAgentResponse, RaiseIntentAgentRequest, RaiseIntentAgentRequestMeta, RaiseIntentAgentResponse, RaiseIntentResultAgentResponse } from "@finos/fdc3/dist/bridging/BridgingTypes";
import { DefaultIntentResolution } from "./DefaultIntentResolution";
import { DefaultIntentListener } from "../listeners/DefaultIntentListener";
import { IntentResolver } from "fdc3-common";
import { IntentResolver } from "@kite9/fdc3-common";
import { DefaultChannel } from "../channels/DefaultChannel";
import { DefaultPrivateChannel } from "../channels/DefaultPrivateChannel";

Expand Down
2 changes: 1 addition & 1 deletion packages/da-proxy/test/step-definitions/generic.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { expect } from 'expect';
import { doesRowMatch, handleResolve, matchData } from '../support/matching';
import { CustomWorld } from '../world/index';
import { BasicDesktopAgent, DefaultAppSupport, DefaultChannelSupport, DefaultIntentSupport, DefaultHandshakeSupport } from '../../src';
import { IntentResolver, SingleAppIntent } from 'fdc3-common';
import { IntentResolver, SingleAppIntent } from '@kite9/fdc3-common';
import { AppIntent, IntentResult } from '@finos/fdc3';

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/da-server/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "da-server",
"name": "@kite9/da-server",
"main": "src/index.ts",
"scripts": {
"directory-openapi": "npx openapi-typescript https://fdc3.finos.org/schemas/2.1/appd.schema.json --output generated/directory-schema.ts",
"build": "nyc --reporter=lcov --reporter=text cucumber-js"
},
"dependencies": {
"@finos/fdc3": "^2.1.0-beta.4",
"@kite9/fdc3-common": "workspace:*",
"@types/uuid": "^9.0.7",
"fdc3-common": "workspace:*",
"uuid": "^9.0.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/da-server/src/handlers/BroadcastHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
PrivateChannelBroadcastAgentRequest
} from "@finos/fdc3/dist/bridging/BridgingTypes";
import { ContextElement } from "@finos/fdc3";
import { OnAddContextListenerAgentRequest, OnUnsubscribeAgentRequest } from "fdc3-common";
import { OnAddContextListenerAgentRequest, OnUnsubscribeAgentRequest } from "@kite9/fdc3-common";

type ListenerRegistration = {
appId: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/da-server/src/handlers/IntentHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ServerContext } from "../ServerContext";
import { Directory } from "../directory/DirectoryInterface";
import { genericResultTypeSame } from "../directory/BasicDirectory";
import { ResolveError } from "@finos/fdc3";
import { IntentResolutionChoiceAgentRequest, IntentResolutionChoiceAgentResponse, OnAddIntentListenerAgentRequest, OnUnsubscribeIntentListenerAgentRequest } from "fdc3-common";
import { IntentResolutionChoiceAgentRequest, IntentResolutionChoiceAgentResponse, OnAddIntentListenerAgentRequest, OnUnsubscribeIntentListenerAgentRequest } from "@kite9/fdc3-common";


type ListenerRegistration = {
Expand Down
2 changes: 1 addition & 1 deletion packages/da-server/src/handlers/OpenHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MessageHandler } from "../BasicFDC3Server";
import { ServerContext } from "../ServerContext";
import { Directory, DirectoryApp } from "../directory/DirectoryInterface";
import { ContextElement, ResolveError } from "@finos/fdc3";
import { OnAddContextListenerAgentRequest } from "fdc3-common";
import { OnAddContextListenerAgentRequest } from "@kite9/fdc3-common";

function filterPublicDetails(appD: DirectoryApp): GetAppMetadataAgentResponsePayload['appMetadata'] {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/da-server/src/supply/post-message.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AppIdentifier } from '@finos/fdc3';
import { APIResponseMessage, AppChecker, DesktopAgentDetailResolver, Supplier, FDC3_API_RESPONSE_MESSAGE_TYPE, FDC3_API_REQUEST_MESSAGE_TYPE, DesktopAgentPortResolver } from 'fdc3-common';
import { APIResponseMessage, AppChecker, DesktopAgentDetailResolver, Supplier, FDC3_API_RESPONSE_MESSAGE_TYPE, FDC3_API_REQUEST_MESSAGE_TYPE, DesktopAgentPortResolver } from '@kite9/fdc3-common';

/**
* This configures the postMessage listener to respond to requests for desktop agent APIs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { When } from '@cucumber/cucumber'
import { CustomWorld } from '../world';
import { BroadcastAgentRequest } from "@finos/fdc3/dist/bridging/BridgingTypes";
import { contextMap, createMeta } from './generic.steps';
import { OnAddContextListenerAgentRequest, OnUnsubscribeAgentRequest } from 'fdc3-common';
import { OnAddContextListenerAgentRequest, OnUnsubscribeAgentRequest } from '@kite9/fdc3-common';

When('{string} adds a context listener on {string} with type {string}', function (this: CustomWorld, app: string, channelId: string, contextType: string) {
const meta = createMeta(this, app)
Expand Down
2 changes: 1 addition & 1 deletion packages/da-server/test/step-definitions/intents.steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { APP_FIELD } from "./generic.steps";
import { FindIntentAgentRequest, RaiseIntentAgentRequest, RaiseIntentAgentResponse, RaiseIntentResultAgentResponse } from "@finos/fdc3/dist/bridging/BridgingTypes";
import { handleResolve } from "../support/matching";
import { createMeta, contextMap } from './generic.steps';
import { OnAddIntentListenerAgentRequest, OnUnsubscribeIntentListenerAgentRequest } from "fdc3-common";
import { OnAddIntentListenerAgentRequest, OnUnsubscribeIntentListenerAgentRequest } from "@kite9/fdc3-common";

type ListensFor = {
[key: string]: {
Expand Down
8 changes: 4 additions & 4 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "demo",
"name": "@kite9/demo",
"private": true,
"version": "0.0.0",
"scripts": {
Expand All @@ -15,12 +15,12 @@
},
"dependencies": {
"@finos/fdc3": "^2.1.0-beta.6",
"@kite9/client": "workspace:*",
"@kite9/da-server": "workspace:*",
"@kite9/fdc3-common": "workspace:*",
"@types/uuid": "^9.0.8",
"@types/ws": "^8.5.10",
"client": "workspace:*",
"da-server": "workspace:*",
"express": "^4.18.3",
"fdc3-common": "workspace:*",
"socket.io": "^4.7.5",
"socket.io-client": "^4.7.5",
"tsx": "^4.5.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/demo/src/client/apps/app1.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getClientAPI } from 'client'
import { getClientAPI } from '@kite9/client'

function createContext(i: number) {
return {
Expand All @@ -15,12 +15,12 @@ function createContext(i: number) {
*/
async function startBroadcasting() {
console.log("starting...")
const fdc3 = await getClientAPI();
const fdc3 = await getClientAPI();
console.log("got api...")
const channels = await fdc3.getUserChannels()
const channel = channels[0]
for (let index = 0; index < 50; index++) {
setTimeout(() => channel.broadcast(createContext(index)), index*1000);
setTimeout(() => channel.broadcast(createContext(index)), index * 1000);
}
}

Expand Down
6 changes: 3 additions & 3 deletions packages/demo/src/client/apps/app2.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getClientAPI } from 'client'
import { getClientAPI } from '@kite9/client'

/**
* This demonstrates using the API via a promise
Expand All @@ -7,15 +7,15 @@ getClientAPI().then(async fdc3 => {
console.log("in promise")
const log = document.getElementById("log");
const msg = document.createElement("p");
msg.textContent = "FDC3 Loaded: "+JSON.stringify(fdc3.getInfo());
msg.textContent = "FDC3 Loaded: " + JSON.stringify(fdc3.getInfo());
log?.appendChild(msg);
const channels = await fdc3.getUserChannels()

fdc3.joinUserChannel(channels[0].id)

fdc3.addContextListener(null, context => {
const msg = document.createElement("p");
msg.textContent = "Received: "+JSON.stringify(context);
msg.textContent = "Received: " + JSON.stringify(context);
log?.appendChild(msg);
})
});
2 changes: 1 addition & 1 deletion packages/demo/src/client/apps/app4.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getClientAPI } from 'client'
import { getClientAPI } from '@kite9/client'

/**
* This demonstrates using the API via a promise
Expand Down
2 changes: 1 addition & 1 deletion packages/demo/src/client/apps/app5.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getClientAPI } from 'client'
import { getClientAPI } from '@kite9/client'

/**
* This demonstrates using the API via a promise
Expand Down
2 changes: 1 addition & 1 deletion packages/demo/src/client/apps/app6.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getClientAPI } from 'client'
import { getClientAPI } from '@kite9/client'

/**
* This demonstrates using the API via a promise
Expand Down
4 changes: 2 additions & 2 deletions packages/demo/src/client/da/DemoServerContext.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { AppMetadata } from '@finos/fdc3/dist/bridging/BridgingTypes';
import { Directory, DirectoryApp, ServerContext } from 'da-server'
import { Directory, DirectoryApp, ServerContext } from '@kite9/da-server'
import { Socket, io } from 'socket.io-client';
import { v4 as uuid } from 'uuid'
import { APP_HELLO, FDC3_DA_EVENT } from '../../message-types';
import { AppIdentifier, OpenError } from '@finos/fdc3';
import { AppChecker, DesktopAgentDetailResolver, DesktopAgentDetails, DesktopAgentPortResolver } from 'fdc3-common';
import { AppChecker, DesktopAgentDetailResolver, DesktopAgentDetails, DesktopAgentPortResolver } from '@kite9/fdc3-common';
import { link } from './util';

enum Opener { Tab, Frame, Nested }
Expand Down
4 changes: 2 additions & 2 deletions packages/demo/src/client/da/FDC3_2_1_JSONDirectory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BasicDirectory } from "da-server/src/directory/BasicDirectory";
import { DirectoryApp } from "da-server/src/directory/DirectoryInterface";
import { BasicDirectory } from "@kite9/da-server/src/directory/BasicDirectory";
import { DirectoryApp } from "@kite9/da-server/src/directory/DirectoryInterface";

function loadRemotely(u: string) {
return fetch(u).then((response) => response.json());
Expand Down
4 changes: 2 additions & 2 deletions packages/demo/src/client/da/dummy-desktop-agent.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { supply } from "da-server/src/supply/post-message";
import { supply } from "@kite9/da-server/src/supply/post-message";
import { io } from "socket.io-client"
import { v4 as uuid } from 'uuid'
import { DA_HELLO, FDC3_APP_EVENT } from "../../message-types";
import { DemoServerContext } from "./DemoServerContext";
import { FDC3_2_1_JSONDirectory } from "./FDC3_2_1_JSONDirectory";
import { DefaultFDC3Server, DirectoryApp, ServerContext } from "da-server";
import { DefaultFDC3Server, DirectoryApp, ServerContext } from "@kite9/da-server";



Expand Down
2 changes: 1 addition & 1 deletion packages/demo/src/client/da/embed.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FDC3_PORT_TRANSFER_RESPONSE_TYPE } from "fdc3-common";
import { FDC3_PORT_TRANSFER_RESPONSE_TYPE } from "@kite9/fdc3-common";
import { io } from "socket.io-client"
import { link } from "./util";
import { AppIdentifier } from "@finos/fdc3";
Expand Down
2 changes: 1 addition & 1 deletion packages/fdc3-common/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "fdc3-common",
"name": "@kite9/fdc3-common",
"main": "src/index.ts",
"version": "0.0.0",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/fdc3-workbench/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"@apidevtools/json-schema-ref-parser": "^9.0.9",
"@fontsource/roboto": "^4.4.5",
"@fontsource/source-code-pro": "^4.5.0",
"@kite9/client": "workspace:*",
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.59",
Expand All @@ -45,7 +46,6 @@
"@typescript-eslint/parser": "^5.48.0",
"@vitejs/plugin-legacy": "^3.0.1",
"@vitejs/plugin-react": "^3.0.1",
"client": "workspace:*",
"eslint": "^7.28.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
Expand Down
Loading

0 comments on commit d2b4d45

Please sign in to comment.