-
Notifications
You must be signed in to change notification settings - Fork 172
Expand file tree
/
Copy pathBridgingTypes.ts
More file actions
6595 lines (6189 loc) · 235 KB
/
BridgingTypes.ts
File metadata and controls
6595 lines (6189 loc) · 235 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// To parse this data:
//
// import { Convert, BaseImplementationMetadata, AgentErrorResponseMessage, AgentRequestMessage, AgentResponseMessage, BridgeErrorResponseMessage, BridgeRequestMessage, BridgeResponseMessage, BroadcastAgentRequest, BroadcastBridgeRequest, ConnectionStepMessage, ConnectionStep2Hello, ConnectionStep3Handshake, ConnectionStep4AuthenticationFailed, ConnectionStep6ConnectedAgentsUpdate, FindInstancesAgentErrorResponse, FindInstancesAgentRequest, FindInstancesAgentResponse, FindInstancesBridgeErrorResponse, FindInstancesBridgeRequest, FindInstancesBridgeResponse, FindIntentAgentErrorResponse, FindIntentAgentRequest, FindIntentAgentResponse, FindIntentBridgeErrorResponse, FindIntentBridgeRequest, FindIntentBridgeResponse, FindIntentsByContextAgentErrorResponse, FindIntentsByContextAgentRequest, FindIntentsByContextAgentResponse, FindIntentsByContextBridgeErrorResponse, FindIntentsByContextBridgeRequest, FindIntentsByContextBridgeResponse, GetAppMetadataAgentErrorResponse, GetAppMetadataAgentRequest, GetAppMetadataAgentResponse, GetAppMetadataBridgeErrorResponse, GetAppMetadataBridgeRequest, GetAppMetadataBridgeResponse, OpenAgentErrorResponse, OpenAgentRequest, OpenAgentResponse, OpenBridgeErrorResponse, OpenBridgeRequest, OpenBridgeResponse, PrivateChannelBroadcastAgentRequest, PrivateChannelBroadcastBridgeRequest, PrivateChannelEventListenerAddedAgentRequest, PrivateChannelEventListenerAddedBridgeRequest, PrivateChannelEventListenerRemovedAgentRequest, PrivateChannelEventListenerRemovedBridgeRequest, PrivateChannelOnAddContextListenerAgentRequest, PrivateChannelOnAddContextListenerBridgeRequest, PrivateChannelOnDisconnectAgentRequest, PrivateChannelOnDisconnectBridgeRequest, PrivateChannelOnUnsubscribeAgentRequest, PrivateChannelOnUnsubscribeBridgeRequest, RaiseIntentAgentErrorResponse, RaiseIntentAgentRequest, RaiseIntentAgentResponse, RaiseIntentBridgeErrorResponse, RaiseIntentBridgeRequest, RaiseIntentBridgeResponse, RaiseIntentResultAgentErrorResponse, RaiseIntentResultAgentResponse, RaiseIntentResultBridgeErrorResponse, RaiseIntentResultBridgeResponse, Context } from "./file";
//
// const fDC3DesktopAgentAPISchema = Convert.toFDC3DesktopAgentAPISchema(json);
// const baseImplementationMetadata = Convert.toBaseImplementationMetadata(json);
// const agentErrorResponseMessage = Convert.toAgentErrorResponseMessage(json);
// const agentRequestMessage = Convert.toAgentRequestMessage(json);
// const agentResponseMessage = Convert.toAgentResponseMessage(json);
// const bridgeErrorResponseMessage = Convert.toBridgeErrorResponseMessage(json);
// const bridgeRequestMessage = Convert.toBridgeRequestMessage(json);
// const bridgeResponseMessage = Convert.toBridgeResponseMessage(json);
// const broadcastAgentRequest = Convert.toBroadcastAgentRequest(json);
// const broadcastBridgeRequest = Convert.toBroadcastBridgeRequest(json);
// const bridgingCommons = Convert.toBridgingCommons(json);
// const connectionStepMessage = Convert.toConnectionStepMessage(json);
// const connectionStep2Hello = Convert.toConnectionStep2Hello(json);
// const connectionStep3Handshake = Convert.toConnectionStep3Handshake(json);
// const connectionStep4AuthenticationFailed = Convert.toConnectionStep4AuthenticationFailed(json);
// const connectionStep6ConnectedAgentsUpdate = Convert.toConnectionStep6ConnectedAgentsUpdate(json);
// const findInstancesAgentErrorResponse = Convert.toFindInstancesAgentErrorResponse(json);
// const findInstancesAgentRequest = Convert.toFindInstancesAgentRequest(json);
// const findInstancesAgentResponse = Convert.toFindInstancesAgentResponse(json);
// const findInstancesBridgeErrorResponse = Convert.toFindInstancesBridgeErrorResponse(json);
// const findInstancesBridgeRequest = Convert.toFindInstancesBridgeRequest(json);
// const findInstancesBridgeResponse = Convert.toFindInstancesBridgeResponse(json);
// const findIntentAgentErrorResponse = Convert.toFindIntentAgentErrorResponse(json);
// const findIntentAgentRequest = Convert.toFindIntentAgentRequest(json);
// const findIntentAgentResponse = Convert.toFindIntentAgentResponse(json);
// const findIntentBridgeErrorResponse = Convert.toFindIntentBridgeErrorResponse(json);
// const findIntentBridgeRequest = Convert.toFindIntentBridgeRequest(json);
// const findIntentBridgeResponse = Convert.toFindIntentBridgeResponse(json);
// const findIntentsByContextAgentErrorResponse = Convert.toFindIntentsByContextAgentErrorResponse(json);
// const findIntentsByContextAgentRequest = Convert.toFindIntentsByContextAgentRequest(json);
// const findIntentsByContextAgentResponse = Convert.toFindIntentsByContextAgentResponse(json);
// const findIntentsByContextBridgeErrorResponse = Convert.toFindIntentsByContextBridgeErrorResponse(json);
// const findIntentsByContextBridgeRequest = Convert.toFindIntentsByContextBridgeRequest(json);
// const findIntentsByContextBridgeResponse = Convert.toFindIntentsByContextBridgeResponse(json);
// const getAppMetadataAgentErrorResponse = Convert.toGetAppMetadataAgentErrorResponse(json);
// const getAppMetadataAgentRequest = Convert.toGetAppMetadataAgentRequest(json);
// const getAppMetadataAgentResponse = Convert.toGetAppMetadataAgentResponse(json);
// const getAppMetadataBridgeErrorResponse = Convert.toGetAppMetadataBridgeErrorResponse(json);
// const getAppMetadataBridgeRequest = Convert.toGetAppMetadataBridgeRequest(json);
// const getAppMetadataBridgeResponse = Convert.toGetAppMetadataBridgeResponse(json);
// const openAgentErrorResponse = Convert.toOpenAgentErrorResponse(json);
// const openAgentRequest = Convert.toOpenAgentRequest(json);
// const openAgentResponse = Convert.toOpenAgentResponse(json);
// const openBridgeErrorResponse = Convert.toOpenBridgeErrorResponse(json);
// const openBridgeRequest = Convert.toOpenBridgeRequest(json);
// const openBridgeResponse = Convert.toOpenBridgeResponse(json);
// const privateChannelBroadcastAgentRequest = Convert.toPrivateChannelBroadcastAgentRequest(json);
// const privateChannelBroadcastBridgeRequest = Convert.toPrivateChannelBroadcastBridgeRequest(json);
// const privateChannelEventListenerAddedAgentRequest = Convert.toPrivateChannelEventListenerAddedAgentRequest(json);
// const privateChannelEventListenerAddedBridgeRequest = Convert.toPrivateChannelEventListenerAddedBridgeRequest(json);
// const privateChannelEventListenerRemovedAgentRequest = Convert.toPrivateChannelEventListenerRemovedAgentRequest(json);
// const privateChannelEventListenerRemovedBridgeRequest = Convert.toPrivateChannelEventListenerRemovedBridgeRequest(json);
// const privateChannelOnAddContextListenerAgentRequest = Convert.toPrivateChannelOnAddContextListenerAgentRequest(json);
// const privateChannelOnAddContextListenerBridgeRequest = Convert.toPrivateChannelOnAddContextListenerBridgeRequest(json);
// const privateChannelOnDisconnectAgentRequest = Convert.toPrivateChannelOnDisconnectAgentRequest(json);
// const privateChannelOnDisconnectBridgeRequest = Convert.toPrivateChannelOnDisconnectBridgeRequest(json);
// const privateChannelOnUnsubscribeAgentRequest = Convert.toPrivateChannelOnUnsubscribeAgentRequest(json);
// const privateChannelOnUnsubscribeBridgeRequest = Convert.toPrivateChannelOnUnsubscribeBridgeRequest(json);
// const raiseIntentAgentErrorResponse = Convert.toRaiseIntentAgentErrorResponse(json);
// const raiseIntentAgentRequest = Convert.toRaiseIntentAgentRequest(json);
// const raiseIntentAgentResponse = Convert.toRaiseIntentAgentResponse(json);
// const raiseIntentBridgeErrorResponse = Convert.toRaiseIntentBridgeErrorResponse(json);
// const raiseIntentBridgeRequest = Convert.toRaiseIntentBridgeRequest(json);
// const raiseIntentBridgeResponse = Convert.toRaiseIntentBridgeResponse(json);
// const raiseIntentResultAgentErrorResponse = Convert.toRaiseIntentResultAgentErrorResponse(json);
// const raiseIntentResultAgentResponse = Convert.toRaiseIntentResultAgentResponse(json);
// const raiseIntentResultBridgeErrorResponse = Convert.toRaiseIntentResultBridgeErrorResponse(json);
// const raiseIntentResultBridgeResponse = Convert.toRaiseIntentResultBridgeResponse(json);
// const context = Convert.toContext(json);
//
// These functions will throw an error if the JSON doesn't
// match the expected interface, even if the JSON is valid.
/**
* Metadata relating to the FDC3 Desktop Agent implementation and its provider.
*/
export interface BaseImplementationMetadata {
/**
* The version number of the FDC3 specification that the implementation provides.
* The string must be a numeric semver version, e.g. 1.2 or 1.2.1.
*/
fdc3Version: string;
/**
* Metadata indicating whether the Desktop Agent implements optional features of
* the Desktop Agent API.
*/
optionalFeatures: BaseImplementationMetadataOptionalFeatures;
/**
* The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42,
* OpenFin etc.).
*/
provider: string;
/**
* The version of the provider of the Desktop Agent implementation (e.g. 5.3.0).
*/
providerVersion?: string;
}
/**
* Metadata indicating whether the Desktop Agent implements optional features of
* the Desktop Agent API.
*/
export interface BaseImplementationMetadataOptionalFeatures {
/**
* Used to indicate whether the experimental Desktop Agent Bridging
* feature is implemented by the Desktop Agent.
*/
DesktopAgentBridging: boolean;
/**
* Used to indicate whether the exposure of 'originating app metadata' for
* context and intent messages is supported by the Desktop Agent.
*/
OriginatingAppMetadata: boolean;
/**
* Used to indicate whether the optional `fdc3.joinUserChannel`,
* `fdc3.getCurrentChannel` and `fdc3.leaveCurrentChannel` are implemented by
* the Desktop Agent.
*/
UserChannelMembershipAPIs: boolean;
}
/**
* A response message from a Desktop Agent to the Bridge containing an error, to be used in
* preference to the standard response when an error needs to be returned.
*/
export interface AgentErrorResponseMessage {
meta: AgentResponseMetadata;
/**
* Error message payload containing an standardized error string.
*/
payload: ErrorResponseMessagePayload;
/**
* Identifies the type of the message and it is typically set to the FDC3 function name that
* the message relates to, e.g. 'findIntent', with 'Response' appended.
*/
type: ResponseMessageType;
}
/**
* Metadata for a response messages sent by a Desktop Agent to the Bridge
*/
export interface AgentResponseMetadata {
requestUuid: string;
responseUuid: string;
timestamp: Date;
}
/**
* Error message payload containing an standardized error string.
*/
export interface ErrorResponseMessagePayload {
error: ResponseErrorDetail;
[property: string]: any;
}
/**
* Array of error message strings for responses that were not returned to the bridge before
* the timeout or because an error occurred. Should be the same length as the `errorSources`
* array and ordered the same. May be omitted if all sources responded without errors.
*
* Constants representing the errors that can be encountered when calling the `open` method
* on the DesktopAgent object (`fdc3`).
*
* Constants representing the errors that can be encountered when calling the `findIntent`,
* `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the
* DesktopAgent (`fdc3`).
*/
export type ResponseErrorDetail =
| 'AccessDenied'
| 'CreationFailed'
| 'MalformedContext'
| 'NoChannelFound'
| 'AppNotFound'
| 'AppTimeout'
| 'DesktopAgentNotFound'
| 'ErrorOnLaunch'
| 'ResolverUnavailable'
| 'IntentDeliveryFailed'
| 'NoAppsFound'
| 'ResolverTimeout'
| 'TargetAppUnavailable'
| 'TargetInstanceUnavailable'
| 'UserCancelledResolution'
| 'IntentHandlerRejected'
| 'NoResultReturned'
| 'AgentDisconnected'
| 'NotConnectedToBridge'
| 'ResponseToBridgeTimedOut'
| 'MalformedMessage';
/**
* Identifies the type of the message and it is typically set to the FDC3 function name that
* the message relates to, e.g. 'findIntent', with 'Response' appended.
*/
export type ResponseMessageType =
| 'findInstancesResponse'
| 'findIntentResponse'
| 'findIntentsByContextResponse'
| 'getAppMetadataResponse'
| 'openResponse'
| 'raiseIntentResponse'
| 'raiseIntentResultResponse';
/**
* A request message from a Desktop Agent to the Bridge.
*/
export interface AgentRequestMessage {
meta: AgentRequestMetadata;
/**
* The message payload typically contains the arguments to FDC3 API functions.
*/
payload: { [key: string]: any };
/**
* Identifies the type of the message and it is typically set to the FDC3 function name that
* the message relates to, e.g. 'findIntent', with 'Request' appended.
*/
type: RequestMessageType;
}
/**
* Metadata for a request message sent by Desktop Agents to the Bridge.
*/
export interface AgentRequestMetadata {
/**
* Optional field that represents the destination that the request should be routed to. Must
* be set by the Desktop Agent for API calls that include a target app parameter and must
* include the name of the Desktop Agent hosting the target application.
*/
destination?: BridgeParticipantIdentifier;
requestUuid: string;
/**
* Field that represents the source application that the request was received from, or the
* source Desktop Agent if it issued the request itself.
*/
source?: SourceIdentifier;
timestamp: Date;
}
/**
* Optional field that represents the destination that the request should be routed to. Must
* be set by the Desktop Agent for API calls that include a target app parameter and must
* include the name of the Desktop Agent hosting the target application.
*
* Represents identifiers that MUST include the Desktop Agent name and MAY identify a
* specific app or instance.
*
* Field that represents the source application that the request was received from, or the
* source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST
* be set by the bridge.
*
* Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios
* where a request needs to be directed to a Desktop Agent rather than a specific app, or a
* response message is returned by the Desktop Agent (or more specifically its resolver)
* rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no
* app details are available or are appropriate.
*
* Array of DesktopAgentIdentifiers for responses that were not returned to the bridge
* before the timeout or because an error occurred. May be omitted if all sources responded
* without errors. MUST include the `desktopAgent` field when returned by the bridge.
*
* Array of DesktopAgentIdentifiers for the sources that generated responses to the request.
* Will contain a single value for individual responses and multiple values for responses
* that were collated by the bridge. May be omitted if all sources errored. MUST include the
* `desktopAgent` field when returned by the bridge.
*
* Field that represents a destination Desktop Agent that a request is to be sent to.
*
* Field that represents a destination App on a remote Desktop Agent that a request is to be
* sent to.
*
* Identifies an application, or instance of an application, and is used to target FDC3 API
* calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application
* instances.
*
* Will always include at least an `appId` field, which uniquely identifies a specific app.
*
* If the `instanceId` field is set then the `AppMetadata` object represents a specific
* instance of the application that may be addressed using that Id.
*
* Field that represents the source application that a request or response was received
* from.
*
* Identifier for the app instance that was selected (or started) to resolve the intent.
* `source.instanceId` MUST be set, indicating the specific app instance that
* received the intent.
*/
export interface BridgeParticipantIdentifier {
/**
* Used in Desktop Agent Bridging to attribute or target a message to a
* particular Desktop Agent.
*
* The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to
* identify the Desktop Agent to target.
*/
desktopAgent: string;
/**
* The unique application identifier located within a specific application directory
* instance. An example of an appId might be 'app@sub.root'
*/
appId?: string;
/**
* An optional instance identifier, indicating that this object represents a specific
* instance of the application described.
*/
instanceId?: string;
[property: string]: any;
}
/**
* Field that represents the source application that the request was received from, or the
* source Desktop Agent if it issued the request itself.
*
* Field that represents the source application that a request or response was received
* from, or the source Desktop Agent if it issued the request or response itself.
*
* Identifies an application, or instance of an application, and is used to target FDC3 API
* calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application
* instances.
*
* Will always include at least an `appId` field, which uniquely identifies a specific app.
*
* If the `instanceId` field is set then the `AppMetadata` object represents a specific
* instance of the application that may be addressed using that Id.
*
* Field that represents the source application that a request or response was received
* from.
*
* Identifier for the app instance that was selected (or started) to resolve the intent.
* `source.instanceId` MUST be set, indicating the specific app instance that
* received the intent.
*
* Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios
* where a request needs to be directed to a Desktop Agent rather than a specific app, or a
* response message is returned by the Desktop Agent (or more specifically its resolver)
* rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no
* app details are available or are appropriate.
*
* Array of DesktopAgentIdentifiers for responses that were not returned to the bridge
* before the timeout or because an error occurred. May be omitted if all sources responded
* without errors. MUST include the `desktopAgent` field when returned by the bridge.
*
* Array of DesktopAgentIdentifiers for the sources that generated responses to the request.
* Will contain a single value for individual responses and multiple values for responses
* that were collated by the bridge. May be omitted if all sources errored. MUST include the
* `desktopAgent` field when returned by the bridge.
*
* Field that represents a destination Desktop Agent that a request is to be sent to.
*/
export interface SourceIdentifier {
/**
* The unique application identifier located within a specific application directory
* instance. An example of an appId might be 'app@sub.root'
*/
appId?: string;
/**
* The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to
* identify the Desktop Agent to target.
*
* Used in Desktop Agent Bridging to attribute or target a message to a
* particular Desktop Agent.
*/
desktopAgent?: string;
/**
* An optional instance identifier, indicating that this object represents a specific
* instance of the application described.
*/
instanceId?: string;
[property: string]: any;
}
/**
* Identifies the type of the message and it is typically set to the FDC3 function name that
* the message relates to, e.g. 'findIntent', with 'Request' appended.
*/
export type RequestMessageType =
| 'broadcastRequest'
| 'findInstancesRequest'
| 'findIntentRequest'
| 'findIntentsByContextRequest'
| 'getAppMetadataRequest'
| 'openRequest'
| 'PrivateChannel.broadcast'
| 'PrivateChannel.eventListenerAdded'
| 'PrivateChannel.eventListenerRemoved'
| 'PrivateChannel.onAddContextListener'
| 'PrivateChannel.onDisconnect'
| 'PrivateChannel.onUnsubscribe'
| 'raiseIntentRequest';
/**
* A response message from a Desktop Agent to the Bridge.
*/
export interface AgentResponseMessage {
meta: AgentResponseMetadata;
/**
* The message payload typically contains return values for FDC3 API functions.
*/
payload: { [key: string]: any };
/**
* Identifies the type of the message and it is typically set to the FDC3 function name that
* the message relates to, e.g. 'findIntent', with 'Response' appended.
*/
type: ResponseMessageType;
}
/**
* A response message from the Bridge back to the original Desktop Agent that raised the
* request, used where all connected agents returned errors.
*/
export interface BridgeErrorResponseMessage {
meta: BridgeErrorResponseMessageMeta;
/**
* The error message payload contains details of an error return to the app or agent that
* raised the original request.
*/
payload: ResponseErrorMessagePayload;
/**
* Identifies the type of the message and it is typically set to the FDC3 function name that
* the message relates to, e.g. 'findIntent', with 'Response' appended.
*/
type: string;
}
/**
* Metadata required in a response message collated and/or forwarded on by the Bridge
*/
export interface BridgeErrorResponseMessageMeta {
errorDetails: ResponseErrorDetail[];
errorSources: DesktopAgentIdentifier[];
requestUuid: string;
responseUuid: string;
timestamp: Date;
}
/**
* Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios
* where a request needs to be directed to a Desktop Agent rather than a specific app, or a
* response message is returned by the Desktop Agent (or more specifically its resolver)
* rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no
* app details are available or are appropriate.
*
* Array of DesktopAgentIdentifiers for responses that were not returned to the bridge
* before the timeout or because an error occurred. May be omitted if all sources responded
* without errors. MUST include the `desktopAgent` field when returned by the bridge.
*
* Array of DesktopAgentIdentifiers for the sources that generated responses to the request.
* Will contain a single value for individual responses and multiple values for responses
* that were collated by the bridge. May be omitted if all sources errored. MUST include the
* `desktopAgent` field when returned by the bridge.
*
* Field that represents a destination Desktop Agent that a request is to be sent to.
*/
export interface DesktopAgentIdentifier {
/**
* Used in Desktop Agent Bridging to attribute or target a message to a
* particular Desktop Agent.
*/
desktopAgent: string;
[property: string]: any;
}
/**
* The error message payload contains details of an error return to the app or agent that
* raised the original request.
*/
export interface ResponseErrorMessagePayload {
error?: ResponseErrorDetail;
[property: string]: any;
}
/**
* A request message forwarded from the Bridge onto a Desktop Agent connected to it.
*/
export interface BridgeRequestMessage {
meta: BridgeRequestMetadata;
/**
* The message payload typically contains the arguments to FDC3 API functions.
*/
payload: { [key: string]: any };
/**
* Identifies the type of the message and it is typically set to the FDC3 function name that
* the message relates to, e.g. 'findIntent', with 'Request' appended.
*/
type: string;
}
/**
* Metadata required in a request message forwarded on by the Bridge
*/
export interface BridgeRequestMetadata {
/**
* Optional field that represents the destination that the request should be routed to. Must
* be set by the Desktop Agent for API calls that include a target app parameter and must
* include the name of the Desktop Agent hosting the target application.
*/
destination?: BridgeParticipantIdentifier;
requestUuid: string;
/**
* Field that represents the source application that the request was received from, or the
* source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST
* be set by the bridge.
*/
source: BridgeParticipantIdentifier;
timestamp: Date;
}
/**
* A response message from the Bridge back to the original Desktop Agent that raised the
* request.
*/
export interface BridgeResponseMessage {
meta: BridgeResponseMessageMeta;
/**
* The message payload typically contains return values for FDC3 API functions.
*/
payload: { [key: string]: any };
/**
* Identifies the type of the message and it is typically set to the FDC3 function name that
* the message relates to, e.g. 'findIntent', with 'Response' appended.
*/
type: string;
}
/**
* Metadata required in a response message collated and/or forwarded on by the Bridge
*/
export interface BridgeResponseMessageMeta {
errorDetails?: ResponseErrorDetail[];
errorSources?: DesktopAgentIdentifier[];
requestUuid: string;
responseUuid: string;
sources?: DesktopAgentIdentifier[];
timestamp: Date;
}
/**
* A request to broadcast context on a channel.
*
* A request message from a Desktop Agent to the Bridge.
*/
export interface BroadcastAgentRequest {
meta: BroadcastAgentRequestMeta;
/**
* The message payload typically contains the arguments to FDC3 API functions.
*/
payload: BroadcastAgentRequestPayload;
/**
* Identifies the type of the message and it is typically set to the FDC3 function name that
* the message relates to, e.g. 'findIntent', with 'Request' appended.
*/
type: 'broadcastRequest';
}
/**
* Metadata for a request message sent by Desktop Agents to the Bridge.
*/
export interface BroadcastAgentRequestMeta {
requestUuid: string;
/**
* Field that represents the source application that the request was received from, or the
* source Desktop Agent if it issued the request itself.
*/
source: SourceObject;
timestamp: Date;
}
/**
* Identifies an application, or instance of an application, and is used to target FDC3 API
* calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application
* instances.
*
* Will always include at least an `appId` field, which uniquely identifies a specific app.
*
* If the `instanceId` field is set then the `AppMetadata` object represents a specific
* instance of the application that may be addressed using that Id.
*
* Field that represents the source application that a request or response was received
* from.
*
* Identifier for the app instance that was selected (or started) to resolve the intent.
* `source.instanceId` MUST be set, indicating the specific app instance that
* received the intent.
*
* Field that represents the source application that the request was received from, or the
* source Desktop Agent if it issued the request itself.
*
* Field that represents the source application that a request or response was received
* from, or the source Desktop Agent if it issued the request or response itself.
*
* Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios
* where a request needs to be directed to a Desktop Agent rather than a specific app, or a
* response message is returned by the Desktop Agent (or more specifically its resolver)
* rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no
* app details are available or are appropriate.
*
* Array of DesktopAgentIdentifiers for responses that were not returned to the bridge
* before the timeout or because an error occurred. May be omitted if all sources responded
* without errors. MUST include the `desktopAgent` field when returned by the bridge.
*
* Array of DesktopAgentIdentifiers for the sources that generated responses to the request.
* Will contain a single value for individual responses and multiple values for responses
* that were collated by the bridge. May be omitted if all sources errored. MUST include the
* `desktopAgent` field when returned by the bridge.
*
* Field that represents a destination Desktop Agent that a request is to be sent to.
*/
export interface SourceObject {
/**
* The unique application identifier located within a specific application directory
* instance. An example of an appId might be 'app@sub.root'
*/
appId: string;
/**
* The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to
* identify the Desktop Agent to target.
*
* Used in Desktop Agent Bridging to attribute or target a message to a
* particular Desktop Agent.
*/
desktopAgent?: string;
/**
* An optional instance identifier, indicating that this object represents a specific
* instance of the application described.
*/
instanceId?: string;
[property: string]: any;
}
/**
* The message payload typically contains the arguments to FDC3 API functions.
*/
export interface BroadcastAgentRequestPayload {
/**
* The Id of the Channel that the broadcast was sent on
*/
channelId: string;
/**
* The context object that was the payload of a broadcast message.
*/
context: ContextElement;
}
/**
* The context object that was the payload of a broadcast message.
*
* The `fdc3.context` type defines the basic contract or "shape" for all data exchanged by
* FDC3 operations. As such, it is not really meant to be used on its own, but is imported
* by more specific type definitions (standardized or custom) to provide the structure and
* properties shared by all FDC3 context data types.
*
* The key element of FDC3 context types is their mandatory `type` property, which is used
* to identify what type of data the object represents, and what shape it has.
*
* The FDC3 context type, and all derived types, define the minimum set of fields a context
* data object of a particular type can be expected to have, but this can always be extended
* with custom fields as appropriate.
*/
export interface ContextElement {
/**
* Context data objects may include a set of equivalent key-value pairs that can be used to
* help applications identify and look up the context type they receive in their own domain.
* The idea behind this design is that applications can provide as many equivalent
* identifiers to a target application as possible, e.g. an instrument may be represented by
* an ISIN, CUSIP or Bloomberg identifier.
*
* Identifiers do not make sense for all types of data, so the `id` property is therefore
* optional, but some derived types may choose to require at least one identifier.
* Identifier values SHOULD always be of type string.
*/
id?: { [key: string]: any };
/**
* Context data objects may include a name property that can be used for more information,
* or display purposes. Some derived types may require the name object as mandatory,
* depending on use case.
*/
name?: string;
/**
* The type property is the only _required_ part of the FDC3 context data schema. The FDC3
* [API](https://fdc3.finos.org/docs/api/spec) relies on the `type` property being present
* to route shared context data appropriately.
*
* FDC3 [Intents](https://fdc3.finos.org/docs/intents/spec) also register the context data
* types they support in an FDC3 [App
* Directory](https://fdc3.finos.org/docs/app-directory/overview), used for intent discovery
* and routing.
*
* Standardized FDC3 context types have well-known `type` properties prefixed with the
* `fdc3` namespace, e.g. `fdc3.instrument`. For non-standard types, e.g. those defined and
* used by a particular organization, the convention is to prefix them with an
* organization-specific namespace, e.g. `blackrock.fund`.
*
* See the [Context Data Specification](https://fdc3.finos.org/docs/context/spec) for more
* information about context data types.
*/
type: string;
[property: string]: any;
}
/**
* Identifies the type of the message and it is typically set to the FDC3 function name that
* the message relates to, e.g. 'findIntent', with 'Request' appended.
*
* UUID for the request
*
* UUID for this specific response message.
*/
/**
* A request to broadcast context on a channel.
*
* A request message forwarded from the Bridge onto a Desktop Agent connected to it.
*/
export interface BroadcastBridgeRequest {
meta: BroadcastBridgeRequestMeta;
/**
* The message payload typically contains the arguments to FDC3 API functions.
*/
payload: BroadcastBridgeRequestPayload;
/**
* Identifies the type of the message and it is typically set to the FDC3 function name that
* the message relates to, e.g. 'findIntent', with 'Request' appended.
*/
type: 'broadcastRequest';
}
/**
* Metadata required in a request message forwarded on by the Bridge
*/
export interface BroadcastBridgeRequestMeta {
requestUuid: string;
/**
* Field that represents the source application that the request was received from, or the
* source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST
* be set by the bridge.
*/
source: MetaSource;
timestamp: Date;
}
/**
* Identifies an application, or instance of an application, and is used to target FDC3 API
* calls, such as `fdc3.open` or `fdc3.raiseIntent` at specific applications or application
* instances.
*
* Will always include at least an `appId` field, which uniquely identifies a specific app.
*
* If the `instanceId` field is set then the `AppMetadata` object represents a specific
* instance of the application that may be addressed using that Id.
*
* Field that represents the source application that a request or response was received
* from.
*
* Identifier for the app instance that was selected (or started) to resolve the intent.
* `source.instanceId` MUST be set, indicating the specific app instance that
* received the intent.
*
* Optional field that represents the destination that the request should be routed to. Must
* be set by the Desktop Agent for API calls that include a target app parameter and must
* include the name of the Desktop Agent hosting the target application.
*
* Represents identifiers that MUST include the Desktop Agent name and MAY identify a
* specific app or instance.
*
* Field that represents the source application that the request was received from, or the
* source Desktop Agent if it issued the request itself. The Desktop Agent identifier MUST
* be set by the bridge.
*
* Identifies a particular Desktop Agent in Desktop Agent Bridging scenarios
* where a request needs to be directed to a Desktop Agent rather than a specific app, or a
* response message is returned by the Desktop Agent (or more specifically its resolver)
* rather than a specific app. Used as a substitute for `AppIdentifier` in cases where no
* app details are available or are appropriate.
*
* Array of DesktopAgentIdentifiers for responses that were not returned to the bridge
* before the timeout or because an error occurred. May be omitted if all sources responded
* without errors. MUST include the `desktopAgent` field when returned by the bridge.
*
* Array of DesktopAgentIdentifiers for the sources that generated responses to the request.
* Will contain a single value for individual responses and multiple values for responses
* that were collated by the bridge. May be omitted if all sources errored. MUST include the
* `desktopAgent` field when returned by the bridge.
*
* Field that represents a destination Desktop Agent that a request is to be sent to.
*
* Field that represents a destination App on a remote Desktop Agent that a request is to be
* sent to.
*/
export interface MetaSource {
/**
* The unique application identifier located within a specific application directory
* instance. An example of an appId might be 'app@sub.root'
*/
appId: string;
/**
* The Desktop Agent that the app is available on. Used in Desktop Agent Bridging to
* identify the Desktop Agent to target.
*
* Used in Desktop Agent Bridging to attribute or target a message to a
* particular Desktop Agent.
*/
desktopAgent: string;
/**
* An optional instance identifier, indicating that this object represents a specific
* instance of the application described.
*/
instanceId?: string;
[property: string]: any;
}
/**
* The message payload typically contains the arguments to FDC3 API functions.
*/
export interface BroadcastBridgeRequestPayload {
/**
* The Id of the Channel that the broadcast was sent on
*/
channelId: string;
/**
* The context object that was the payload of a broadcast message.
*/
context: ContextElement;
}
/**
* A message used during the connection flow for a Desktop Agent to the Bridge. Used for
* messages sent in either direction.
*/
export interface ConnectionStepMessage {
meta: ConnectionStepMetadata;
/**
* The message payload, containing data pertaining to this connection step.
*/
payload: { [key: string]: any };
/**
* Identifies the type of the connection step message.
*/
type: ConnectionStepMessageType;
}
/**
* Metadata for this connection step message.
*/
export interface ConnectionStepMetadata {
requestUuid?: string;
responseUuid?: string;
timestamp: Date;
}
/**
* Identifies the type of the connection step message.
*/
export type ConnectionStepMessageType = 'hello' | 'handshake' | 'authenticationFailed' | 'connectedAgentsUpdate';
/**
* Hello message sent by the Bridge to anyone connecting to the Bridge (enables
* identification as a bridge and confirmation of whether authentication is required)
*
* A message used during the connection flow for a Desktop Agent to the Bridge. Used for
* messages sent in either direction.
*/
export interface ConnectionStep2Hello {
meta: ConnectionStep2HelloMeta;
/**
* The message payload, containing data pertaining to this connection step.
*/
payload: ConnectionStep2HelloPayload;
/**
* Identifies the type of the connection step message.
*/
type: 'hello';
}
/**
* Metadata for this connection step message.
*/
export interface ConnectionStep2HelloMeta {
timestamp: Date;
}
/**
* The message payload, containing data pertaining to this connection step.
*/
export interface ConnectionStep2HelloPayload {
/**
* A flag indicating whether the Desktop Agent Bridge requires authentication or not.
*/
authRequired: boolean;
/**
* An optional Desktop Agent Bridge JWT authentication token if the Desktop Agent want to
* authenticate a bridge.
*/
authToken?: string;
/**
* The version of the Bridge
*/
desktopAgentBridgeVersion: string;
/**
* The FDC3 versions supported by the Bridge
*/
supportedFDC3Versions: string[];
}
/**
* Identifies the type of the connection step message.
*/
/**
* Handshake message sent by the Desktop Agent to the Bridge (including requested name,
* channel state and authentication data)
*
* A message used during the connection flow for a Desktop Agent to the Bridge. Used for
* messages sent in either direction.
*/
export interface ConnectionStep3Handshake {
meta: ConnectionStep3HandshakeMeta;
/**
* The message payload, containing data pertaining to this connection step.
*/
payload: ConnectionStep3HandshakePayload;
/**
* Identifies the type of the connection step message.
*/
type: 'handshake';
}
/**
* Metadata for this connection step message.
*/
export interface ConnectionStep3HandshakeMeta {
requestUuid: string;
timestamp: Date;
}
/**
* The message payload, containing data pertaining to this connection step.
*/
export interface ConnectionStep3HandshakePayload {
authToken?: string;
/**
* The current state of the Desktop Agent's App and User channels (exclude any Private
* channels), as a mapping of channel id to an array of Context objects, one per type found
* in the channel, most recent first.
*/
channelsState: { [key: string]: ContextElement[] };
/**
* Desktop Agent ImplementationMetadata trying to connect to the bridge.
*/
implementationMetadata: ImplementationMetadataElement;
/**
* The requested Desktop Agent name
*/
requestedName: string;
}
/**
* Desktop Agent ImplementationMetadata trying to connect to the bridge.
*
* Metadata relating to the FDC3 Desktop Agent implementation and its provider.
*/
export interface ImplementationMetadataElement {
/**
* The version number of the FDC3 specification that the implementation provides.
* The string must be a numeric semver version, e.g. 1.2 or 1.2.1.
*/
fdc3Version: string;
/**
* Metadata indicating whether the Desktop Agent implements optional features of
* the Desktop Agent API.
*/
optionalFeatures: ImplementationMetadataOptionalFeatures;
/**
* The name of the provider of the Desktop Agent implementation (e.g. Finsemble, Glue42,
* OpenFin etc.).
*/
provider: string;
/**
* The version of the provider of the Desktop Agent implementation (e.g. 5.3.0).
*/
providerVersion?: string;
}
/**
* Metadata indicating whether the Desktop Agent implements optional features of
* the Desktop Agent API.
*/
export interface ImplementationMetadataOptionalFeatures {
/**
* Used to indicate whether the experimental Desktop Agent Bridging
* feature is implemented by the Desktop Agent.
*/
DesktopAgentBridging: boolean;
/**
* Used to indicate whether the exposure of 'originating app metadata' for
* context and intent messages is supported by the Desktop Agent.
*/
OriginatingAppMetadata: boolean;