@genesislcap/foundation-fdc3 14.192.1 → 14.192.2-FUI-2127.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,15 +9,15 @@ Helper function to add a context listener on a channel with a handler for channe
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- addChannelListener(channelName: string, channelType: string, callback: (any: any) => void): Promise<Channel>;
12
+ addChannelListener(channel: FDC3Channel | Channel, channelType: string, callback: (any: any) => void): Promise<Channel>;
13
13
  ```
14
14
 
15
15
  ## Parameters
16
16
 
17
17
  | Parameter | Type | Description |
18
18
  | --- | --- | --- |
19
- | channelName | string | name of the channel |
20
- | channelType | string | type of the channel |
19
+ | channel | [FDC3Channel](./foundation-fdc3.fdc3channel.md) \| Channel | instance of a channel |
20
+ | channelType | string | type of the channel context |
21
21
  | callback | (any: any) =&gt; void | handler to for the channel context listener |
22
22
 
23
23
  **Returns:**
@@ -0,0 +1,25 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-fdc3](./foundation-fdc3.md) &gt; [FDC3](./foundation-fdc3.fdc3.md) &gt; [broadcastOnCurrentChannel](./foundation-fdc3.fdc3.broadcastoncurrentchannel.md)
4
+
5
+ ## FDC3.broadcastOnCurrentChannel() method
6
+
7
+ Broadcasts a message on the current app channel
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ broadcastOnCurrentChannel(payload: any, type?: string): Promise<void>;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | payload | any | payload sent to the channel |
20
+ | type | string | _(Optional)_ type of the channel |
21
+
22
+ **Returns:**
23
+
24
+ Promise&lt;void&gt;
25
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-fdc3](./foundation-fdc3.md) &gt; [FDC3](./foundation-fdc3.fdc3.md) &gt; [currentChannelObs](./foundation-fdc3.fdc3.currentchannelobs.md)
4
+
5
+ ## FDC3.currentChannelObs property
6
+
7
+ Observable which emits the current channel When a new channel is joined a new value is emitted
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ currentChannelObs: Observable<FDC3Channel>;
13
+ ```
@@ -0,0 +1,17 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-fdc3](./foundation-fdc3.md) &gt; [FDC3](./foundation-fdc3.fdc3.md) &gt; [init](./foundation-fdc3.fdc3.init.md)
4
+
5
+ ## FDC3.init() method
6
+
7
+ Method to initialize the fdc3 service. The service will check if the fdc3 agent has been initialized and emit via the isReadyObs when ready. The service will store the current app channel internally
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ init(): void;
13
+ ```
14
+ **Returns:**
15
+
16
+ void
17
+
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-fdc3](./foundation-fdc3.md) &gt; [FDC3](./foundation-fdc3.fdc3.md) &gt; [isInteropFdc3](./foundation-fdc3.fdc3.isinteropfdc3.md)
4
+
5
+ ## FDC3.isInteropFdc3 property
6
+
7
+ Check if the interop global is available.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ isInteropFdc3: () => boolean;
13
+ ```
@@ -1,13 +1,13 @@
1
1
  <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
2
 
3
- [Home](./index.md) &gt; [@genesislcap/foundation-fdc3](./foundation-fdc3.md) &gt; [FDC3](./foundation-fdc3.fdc3.md) &gt; [isReady](./foundation-fdc3.fdc3.isready.md)
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-fdc3](./foundation-fdc3.md) &gt; [FDC3](./foundation-fdc3.fdc3.md) &gt; [isReadyObs](./foundation-fdc3.fdc3.isreadyobs.md)
4
4
 
5
- ## FDC3.isReady property
5
+ ## FDC3.isReadyObs property
6
6
 
7
- Whether the FDC3 API is ready.
7
+ Observable indicating the FDC3 API is ready.
8
8
 
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- isReady: boolean;
12
+ isReadyObs: Observable<true>;
13
13
  ```
@@ -16,20 +16,25 @@ export interface FDC3
16
16
 
17
17
  | Property | Modifiers | Type | Description |
18
18
  | --- | --- | --- | --- |
19
- | [isReady](./foundation-fdc3.fdc3.isready.md) | | boolean | Whether the FDC3 API is ready. |
19
+ | [currentChannelObs](./foundation-fdc3.fdc3.currentchannelobs.md) | | Observable&lt;[FDC3Channel](./foundation-fdc3.fdc3channel.md)<!-- -->&gt; | Observable which emits the current channel When a new channel is joined a new value is emitted |
20
+ | [isInteropFdc3](./foundation-fdc3.fdc3.isinteropfdc3.md) | | () =&gt; boolean | Check if the interop global is available. |
21
+ | [isReadyObs](./foundation-fdc3.fdc3.isreadyobs.md) | | Observable&lt;true&gt; | Observable indicating the FDC3 API is ready. |
20
22
 
21
23
  ## Methods
22
24
 
23
25
  | Method | Description |
24
26
  | --- | --- |
25
- | [addChannelListener(channelName, channelType, callback)](./foundation-fdc3.fdc3.addchannellistener.md) | Helper function to add a context listener on a channel with a handler for channel messages |
27
+ | [addChannelListener(channel, channelType, callback)](./foundation-fdc3.fdc3.addchannellistener.md) | Helper function to add a context listener on a channel with a handler for channel messages |
26
28
  | [addIntentListeners(listeners)](./foundation-fdc3.fdc3.addintentlisteners.md) | Adds intent listeners for the specified intents. |
27
29
  | [broadcastOnChannel(channelName, type, payload)](./foundation-fdc3.fdc3.broadcastonchannel.md) | Broadcasts a message on a given channel with a given type |
28
30
  | [broadcastOnChannelEventHandler(channelName, type)](./foundation-fdc3.fdc3.broadcastonchanneleventhandler.md) | Helper function to broadcast message on channel in response to dispatched event |
31
+ | [broadcastOnCurrentChannel(payload, type)](./foundation-fdc3.fdc3.broadcastoncurrentchannel.md) | Broadcasts a message on the current app channel |
29
32
  | [findIntent(intent, context)](./foundation-fdc3.fdc3.findintent.md) | Finds an app that supports the specified intent. |
30
33
  | [findIntentsByContext(context)](./foundation-fdc3.fdc3.findintentsbycontext.md) | Finds all the intents supported by the specified context. |
31
34
  | [getCurrentChannel()](./foundation-fdc3.fdc3.getcurrentchannel.md) | Helper function to get the current channel of the application |
32
35
  | [getOrCreateChannel(channelId)](./foundation-fdc3.fdc3.getorcreatechannel.md) | Gets or creates the specified channel. |
36
+ | [init()](./foundation-fdc3.fdc3.init.md) | Method to initialize the fdc3 service. The service will check if the fdc3 agent has been initialized and emit via the isReadyObs when ready. The service will store the current app channel internally |
33
37
  | [joinChannel(channelId)](./foundation-fdc3.fdc3.joinchannel.md) | Joins the specified channel. |
34
38
  | [raiseIntent(context, intent)](./foundation-fdc3.fdc3.raiseintent.md) | Raises the specified intent with the specified context. |
39
+ | [raiseIntentForContext(context)](./foundation-fdc3.fdc3.raiseintentforcontext.md) | Raises an intent against an application based purely on the context data. |
35
40
 
@@ -0,0 +1,26 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/foundation-fdc3](./foundation-fdc3.md) &gt; [FDC3](./foundation-fdc3.fdc3.md) &gt; [raiseIntentForContext](./foundation-fdc3.fdc3.raiseintentforcontext.md)
4
+
5
+ ## FDC3.raiseIntentForContext() method
6
+
7
+ Raises an intent against an application based purely on the context data.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ raiseIntentForContext(context: FDC3Context): Promise<FDC3IntentResolution>;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ | Parameter | Type | Description |
18
+ | --- | --- | --- |
19
+ | context | [FDC3Context](./foundation-fdc3.fdc3context.md) | The context to use. |
20
+
21
+ **Returns:**
22
+
23
+ Promise&lt;[FDC3IntentResolution](./foundation-fdc3.fdc3intentresolution.md)<!-- -->&gt;
24
+
25
+ A promise that resolves with the result of the intent resolution.
26
+
@@ -10,7 +10,6 @@ import { Context } from '@finos/fdc3';
10
10
  import { ContextHandler } from '@finos/fdc3';
11
11
  import { Controller } from '@microsoft/fast-element';
12
12
  import { DOMContainer } from '@genesislcap/foundation-utils';
13
- import { FASTElement } from '@genesislcap/web-core';
14
13
  import { FoundationElement } from '@genesislcap/web-core';
15
14
  import { FoundationElementRegistry } from '@microsoft/fast-foundation';
16
15
  import { FoundationLayoutContainer } from '@genesislcap/foundation-utils';
@@ -21,15 +20,16 @@ import { IOConnectDesktop } from '@interopio/desktop';
21
20
  import { LayoutCacheContainer } from '@genesislcap/foundation-utils';
22
21
  import { NotificationDataRow } from '@genesislcap/foundation-notifications';
23
22
  import { NotificationListener } from '@genesislcap/foundation-ui';
23
+ import { Observable } from 'rxjs';
24
24
  import { OverrideFoundationElementDefinition } from '@microsoft/fast-foundation';
25
25
  import { ViewTemplate } from '@microsoft/fast-element';
26
26
 
27
27
  // @alpha
28
28
  export interface ChannelConfig {
29
29
  // (undocumented)
30
- callback: (any: any) => void;
30
+ callback: (FDC3Context: any) => void;
31
31
  // (undocumented)
32
- channelName: string;
32
+ channelName?: string;
33
33
  // (undocumented)
34
34
  channelType: string;
35
35
  }
@@ -40,7 +40,7 @@ export interface ChannelConfig {
40
40
  export class DefaultFDC3 implements FDC3 {
41
41
  constructor();
42
42
  // (undocumented)
43
- addChannelListener(channelName: string, channelType: string, callback: (any: any) => void): Promise<Channel>;
43
+ addChannelListener(channel: FDC3Channel | Channel, channelType: string, callback: (any: any) => void): Promise<FDC3Channel | Channel>;
44
44
  // (undocumented)
45
45
  addIntentListeners(listeners: Map<FDC3Intents, FDC3ContextHandler>): void;
46
46
  // (undocumented)
@@ -48,6 +48,10 @@ export class DefaultFDC3 implements FDC3 {
48
48
  // (undocumented)
49
49
  broadcastOnChannelEventHandler(channelName: string, type: string): Promise<(e: any) => Promise<void>>;
50
50
  // (undocumented)
51
+ broadcastOnCurrentChannel(payload: any, type?: string): Promise<void>;
52
+ // (undocumented)
53
+ currentChannelObs: Observable<Channel>;
54
+ // (undocumented)
51
55
  findIntent(intent: FDC3Intents, context?: FDC3Context): Promise<FDC3AppIntent>;
52
56
  // (undocumented)
53
57
  findIntentsByContext(context: FDC3Context): Promise<FDC3AppIntent[]>;
@@ -56,28 +60,39 @@ export class DefaultFDC3 implements FDC3 {
56
60
  // (undocumented)
57
61
  getOrCreateChannel(channelId: string): Promise<FDC3Channel>;
58
62
  // (undocumented)
59
- isReady: boolean;
63
+ init(): Promise<void>;
64
+ // (undocumented)
65
+ isInteropFdc3: () => boolean;
66
+ // (undocumented)
67
+ isReadyObs: Observable<true>;
60
68
  // (undocumented)
61
69
  joinChannel(channelId: string): Promise<void>;
62
70
  // (undocumented)
63
- raiseIntent(context: FDC3Context, intent?: FDC3Intents): Promise<FDC3IntentResolution>;
71
+ raiseIntent(context: FDC3Context, intent: FDC3Intents): Promise<FDC3IntentResolution>;
72
+ // (undocumented)
73
+ raiseIntentForContext(context: FDC3Context): Promise<FDC3IntentResolution>;
64
74
  }
65
75
 
66
76
  // Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "FDC3" because one of its declarations is marked as @internal
67
77
  //
68
78
  // @public
69
79
  export interface FDC3 {
70
- addChannelListener(channelName: string, channelType: string, callback: (any: any) => void): Promise<Channel>;
80
+ addChannelListener(channel: FDC3Channel | Channel, channelType: string, callback: (any: any) => void): Promise<Channel>;
71
81
  addIntentListeners(listeners: Map<FDC3Intents, FDC3ContextHandler>): void;
72
82
  broadcastOnChannel(channelName: string, type: string, payload: any): Promise<void>;
73
83
  broadcastOnChannelEventHandler(channelName: string, type: string): Promise<(e: any) => Promise<void>>;
84
+ broadcastOnCurrentChannel(payload: any, type?: string): Promise<void>;
85
+ currentChannelObs: Observable<FDC3Channel>;
74
86
  findIntent(intent: FDC3Intents, context?: FDC3Context): Promise<FDC3AppIntent>;
75
87
  findIntentsByContext(context: FDC3Context): Promise<FDC3AppIntent[]>;
76
88
  getCurrentChannel(): Promise<Channel>;
77
89
  getOrCreateChannel(channelId: string): Promise<FDC3Channel>;
78
- isReady: boolean;
90
+ init(): void;
91
+ isInteropFdc3: () => boolean;
92
+ isReadyObs: Observable<true>;
79
93
  joinChannel(channelId: string): Promise<void>;
80
94
  raiseIntent(context: FDC3Context, intent?: FDC3Intents): Promise<FDC3IntentResolution>;
95
+ raiseIntentForContext(context: FDC3Context): Promise<FDC3IntentResolution>;
81
96
  }
82
97
 
83
98
  // @internal
@@ -128,23 +143,33 @@ export interface FDC3IntentResolution extends IntentResolution {
128
143
  // @public (undocumented)
129
144
  export type FDC3Intents = Intents;
130
145
 
146
+ // Warning: (ae-forgotten-export) The symbol "Fdc3Listener_base" needs to be exported by the entry point index.d.ts
147
+ //
131
148
  // @alpha
132
- export class Fdc3Listener extends FASTElement {
149
+ export class Fdc3Listener extends Fdc3Listener_base {
133
150
  // (undocumented)
134
151
  channelConfig: ChannelConfig[];
135
152
  // (undocumented)
136
153
  connectedCallback(): void;
137
154
  // (undocumented)
155
+ deepClone(): Node;
156
+ // (undocumented)
157
+ disconnectedCallback(): void;
158
+ // (undocumented)
138
159
  fdc3: FDC3;
139
160
  // (undocumented)
140
161
  intentConfig: IntentConfig[];
141
162
  }
142
163
 
164
+ // Warning: (ae-forgotten-export) The symbol "Fdc3RaiseIntent_base" needs to be exported by the entry point index.d.ts
165
+ //
143
166
  // @alpha
144
- export class Fdc3RaiseIntent extends FASTElement {
167
+ export class Fdc3RaiseIntent extends Fdc3RaiseIntent_base {
145
168
  // (undocumented)
146
169
  connectedCallback(): void;
147
170
  // (undocumented)
171
+ deepClone(): Node;
172
+ // (undocumented)
148
173
  disconnectedCallback(): void;
149
174
  // (undocumented)
150
175
  eventName: string;
@@ -161,7 +186,7 @@ export class Fdc3RaiseIntent extends FASTElement {
161
186
  // @alpha
162
187
  export interface IntentConfig {
163
188
  // (undocumented)
164
- callback: (any: any) => void;
189
+ callback: (FDC3Context: any) => void;
165
190
  // (undocumented)
166
191
  intent: string;
167
192
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-fdc3",
3
3
  "description": "Genesis Foundation FDC3",
4
- "version": "14.192.1",
4
+ "version": "14.192.2-FUI-2127.1",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -59,25 +59,26 @@
59
59
  }
60
60
  },
61
61
  "devDependencies": {
62
- "@genesislcap/foundation-testing": "14.192.1",
63
- "@genesislcap/genx": "14.192.1",
64
- "@genesislcap/rollup-builder": "14.192.1",
65
- "@genesislcap/ts-builder": "14.192.1",
66
- "@genesislcap/uvu-playwright-builder": "14.192.1",
67
- "@genesislcap/vite-builder": "14.192.1",
68
- "@genesislcap/webpack-builder": "14.192.1",
62
+ "@genesislcap/foundation-testing": "14.192.2-FUI-2127.1",
63
+ "@genesislcap/genx": "14.192.2-FUI-2127.1",
64
+ "@genesislcap/rollup-builder": "14.192.2-FUI-2127.1",
65
+ "@genesislcap/ts-builder": "14.192.2-FUI-2127.1",
66
+ "@genesislcap/uvu-playwright-builder": "14.192.2-FUI-2127.1",
67
+ "@genesislcap/vite-builder": "14.192.2-FUI-2127.1",
68
+ "@genesislcap/webpack-builder": "14.192.2-FUI-2127.1",
69
69
  "rimraf": "^5.0.0"
70
70
  },
71
71
  "dependencies": {
72
72
  "@finos/fdc3": "^1.2.0",
73
- "@genesislcap/foundation-logger": "14.192.1",
74
- "@genesislcap/foundation-notifications": "14.192.1",
75
- "@genesislcap/foundation-ui": "14.192.1",
76
- "@genesislcap/foundation-utils": "14.192.1",
77
- "@genesislcap/web-core": "14.192.1",
73
+ "@genesislcap/foundation-logger": "14.192.2-FUI-2127.1",
74
+ "@genesislcap/foundation-notifications": "14.192.2-FUI-2127.1",
75
+ "@genesislcap/foundation-ui": "14.192.2-FUI-2127.1",
76
+ "@genesislcap/foundation-utils": "14.192.2-FUI-2127.1",
77
+ "@genesislcap/web-core": "14.192.2-FUI-2127.1",
78
78
  "@interopio/desktop": "^6.3.1",
79
79
  "@microsoft/fast-element": "^1.12.0",
80
80
  "@microsoft/fast-foundation": "^2.49.4",
81
+ "rxjs": "^7.8.1",
81
82
  "tslib": "^2.3.1"
82
83
  },
83
84
  "repository": {
@@ -88,5 +89,5 @@
88
89
  "publishConfig": {
89
90
  "access": "public"
90
91
  },
91
- "gitHead": "a29aa171eb4bd0a83c1787bdcfb0351f77ff0cc5"
92
+ "gitHead": "cafa4ea375512fe75ce9f71646cf84062ffd1c57"
92
93
  }
package/test/fdc3.mock.ts CHANGED
@@ -4,10 +4,18 @@ export const mockFdc3 = () => {
4
4
  if (!('fdc3' in window)) {
5
5
  const broadcast = sinon.stub();
6
6
  const addContextListener = sinon.stub();
7
+ const getCurrentContext = sinon.stub();
8
+ const channel = sinon.stub().returns({
9
+ getCurrentContext: async () => ({}),
10
+ broadcast,
11
+ addContextListener,
12
+ });
7
13
  window.fdc3 = {
8
14
  broadcast,
15
+ channel,
9
16
  addContextListener,
10
17
  getOrCreateChannel: sinon.stub().returns({
18
+ getCurrentContext,
11
19
  broadcast,
12
20
  addContextListener,
13
21
  }),
@@ -19,6 +27,9 @@ export const mockFdc3 = () => {
19
27
  fireIntent: (value) => callback(value),
20
28
  });
21
29
  },
30
+ getCurrentChannel: sinon.stub().returns({
31
+ channel,
32
+ }),
22
33
  };
23
34
  }
24
35
  };