diff --git a/packages/fdc3-get-agent/test/support/TestServerContext.ts b/packages/fdc3-get-agent/test/support/TestServerContext.ts index ebc021d7a..3241441ba 100644 --- a/packages/fdc3-get-agent/test/support/TestServerContext.ts +++ b/packages/fdc3-get-agent/test/support/TestServerContext.ts @@ -30,7 +30,7 @@ export class TestServerContext implements ServerContext { this.cw = cw } - async narrowIntents(appIntents: AppIntent[], _context: Context): Promise { + async narrowIntents(_raiser: AppIdentifier, appIntents: AppIntent[], _context: Context): Promise { return appIntents } diff --git a/toolbox/fdc3-for-web/demo/src/client/da/DemoServerContext.ts b/toolbox/fdc3-for-web/demo/src/client/da/DemoServerContext.ts index e6dded167..0360075d1 100644 --- a/toolbox/fdc3-for-web/demo/src/client/da/DemoServerContext.ts +++ b/toolbox/fdc3-for-web/demo/src/client/da/DemoServerContext.ts @@ -2,7 +2,7 @@ import { AppRegistration, Directory, DirectoryApp, InstanceID, ServerContext, St import { Socket } from 'socket.io-client'; import { v4 as uuid } from 'uuid' import { FDC3_DA_EVENT } from '../../message-types'; -import { AppIntent, Context, OpenError } from '@kite9/fdc3'; +import { AppIdentifier, AppIntent, Context, OpenError } from '@kite9/fdc3'; enum Opener { Tab, Frame, Nested } @@ -24,7 +24,7 @@ export class DemoServerContext implements ServerContext { this.directory = directory } - async narrowIntents(appIntents: AppIntent[], _context: Context): Promise { + async narrowIntents(_raiser: AppIdentifier, appIntents: AppIntent[], _context: Context): Promise { console.log("Narrow intents - not doing anything") return appIntents } diff --git a/toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts b/toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts index f07216e4a..3b9ac236e 100644 --- a/toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts +++ b/toolbox/fdc3-for-web/fdc3-web-impl/src/ServerContext.ts @@ -1,4 +1,4 @@ -import { AppIntent } from "@kite9/fdc3-standard"; +import { AppIdentifier, AppIntent } from "@kite9/fdc3-standard"; import { Context } from "@kite9/fdc3-context"; export enum State { @@ -106,5 +106,5 @@ export interface ServerContext { * an opportunity for the server to either present an intent resolver * or otherwise mess with the availble intents, or do nothing. */ - narrowIntents(appIntents: AppIntent[], context: Context): Promise + narrowIntents(raiser: AppIdentifier, IappIntents: AppIntent[], context: Context): Promise } diff --git a/toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts b/toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts index d43d4c8df..17173e78a 100644 --- a/toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts +++ b/toolbox/fdc3-for-web/fdc3-web-impl/src/handlers/IntentHandler.ts @@ -120,8 +120,8 @@ export class IntentHandler implements MessageHandler { shutdown(): void { } - async narrowIntents(appIntents: AppIntent[], context: Context, sc: ServerContext): Promise { - const out = await sc.narrowIntents(appIntents, context) + async narrowIntents(raiser: AppIdentifier, appIntents: AppIntent[], context: Context, sc: ServerContext): Promise { + const out = await sc.narrowIntents(raiser, appIntents, context) return out } @@ -274,7 +274,7 @@ export class IntentHandler implements MessageHandler { const appIntents = this.createAppIntents(arg0, [...runningApps, { appId: target.appId }]) - const narrowedAppIntents = await this.narrowIntents(appIntents, arg0[0].context, sc) + const narrowedAppIntents = await this.narrowIntents(arg0[0].from, appIntents, arg0[0].context, sc) if (narrowedAppIntents.length == 1) { if ((narrowedAppIntents[0].apps.length == 2) && (narrowedAppIntents[0].apps[0].instanceId)) { @@ -337,7 +337,7 @@ export class IntentHandler implements MessageHandler { } }) - const narrowedAppIntents = await this.narrowIntents(appIntents, arg0[0].context, sc) + const narrowedAppIntents = await this.narrowIntents(arg0[0].from, appIntents, arg0[0].context, sc) if (narrowedAppIntents.length == 0) { // nothing can resolve the intent, fail