@interopio/fdc3 2.9.0 → 2.11.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md CHANGED
@@ -1,3 +1,5 @@
1
+ 2.10.0
2
+ feat: io.Connect Browser 4.4
1
3
  2.9.0
2
4
  feat: io.Connect Browser 4.3
3
5
  2.8.3
@@ -4998,7 +4998,7 @@ Decoder$1.valueAt;
4998
4998
  /** See `Decoder.succeed` */
4999
4999
  Decoder$1.succeed;
5000
5000
  /** See `Decoder.fail` */
5001
- Decoder$1.fail;
5001
+ var fail = Decoder$1.fail;
5002
5002
  /** See `Decoder.lazy` */
5003
5003
  Decoder$1.lazy;
5004
5004
 
@@ -5009,11 +5009,15 @@ const regexDecoder = anyJson$1().andThen((value) => {
5009
5009
  });
5010
5010
  const urlDecoder = nonEmptyStringDecoder$1.andThen((url) => {
5011
5011
  try {
5012
- new URL(url);
5012
+ const { protocol } = new URL(url);
5013
+ const disallowedProtocols = ["data:", "javascript:", "vbscript:"];
5014
+ if (disallowedProtocols.includes(protocol)) {
5015
+ return fail(`Expected a URL with a safe protocol, got: ${protocol} (disallowed protocols: ${disallowedProtocols.join(", ")})`);
5016
+ }
5013
5017
  return nonEmptyStringDecoder$1;
5014
5018
  }
5015
5019
  catch {
5016
- return fail("Should be a valid URL");
5020
+ return fail("Expected a valid URL");
5017
5021
  }
5018
5022
  });
5019
5023
 
@@ -5025,7 +5029,7 @@ const intentDefinitionDecoder = object$1({
5025
5029
  });
5026
5030
  const v2TypeDecoder = oneOf$1(constant$1("web"), constant$1("native"), constant$1("citrix"), constant$1("onlineNative"), constant$1("other"));
5027
5031
  const v2DetailsDecoder = object$1({
5028
- url: nonEmptyStringDecoder$1
5032
+ url: urlDecoder
5029
5033
  });
5030
5034
  const v2IconDecoder = object$1({
5031
5035
  src: nonEmptyStringDecoder$1,
@@ -5053,18 +5057,19 @@ const v2UserChannelDecoder = object$1({
5053
5057
  listensFor: optional$1(array$1(nonEmptyStringDecoder$1))
5054
5058
  });
5055
5059
  const v2AppChannelDecoder = object$1({
5056
- name: nonEmptyStringDecoder$1,
5060
+ name: optional$1(nonEmptyStringDecoder$1),
5061
+ id: optional$1(nonEmptyStringDecoder$1),
5057
5062
  description: optional$1(nonEmptyStringDecoder$1),
5058
5063
  broadcasts: optional$1(array$1(nonEmptyStringDecoder$1)),
5059
5064
  listensFor: optional$1(array$1(nonEmptyStringDecoder$1))
5060
- });
5065
+ }).where((appChannel) => Boolean(appChannel.name || appChannel.id), "Expected at least a name or an id property to be present in the app channel definition");
5061
5066
  const v2InteropDecoder = object$1({
5062
5067
  intents: optional$1(v2IntentsDecoder),
5063
5068
  userChannels: optional$1(v2UserChannelDecoder),
5064
5069
  appChannels: optional$1(array$1(v2AppChannelDecoder))
5065
5070
  });
5066
5071
  const glue42ApplicationDetailsDecoder = object$1({
5067
- url: optional$1(nonEmptyStringDecoder$1),
5072
+ url: optional$1(urlDecoder),
5068
5073
  top: optional$1(number$1()),
5069
5074
  left: optional$1(number$1()),
5070
5075
  width: optional$1(nonNegativeNumberDecoder),
@@ -7053,6 +7058,7 @@ function r$2(name) {
7053
7058
  { json: 'details', js: 'details', typ: u$2(undefined, r$2('PurpleOrderDetails')) },
7054
7059
  { json: 'id', js: 'id', typ: m$2('') },
7055
7060
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7061
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7056
7062
  { json: 'type', js: 'type', typ: r$2('OrderType') },
7057
7063
  ], 'any'),
7058
7064
  PurpleOrderDetails: o$2([{ json: 'product', js: 'product', typ: u$2(undefined, r$2('ProductObject')) }], 'any'),
@@ -7060,6 +7066,7 @@ function r$2(name) {
7060
7066
  { json: 'id', js: 'id', typ: m$2('') },
7061
7067
  { json: 'instrument', js: 'instrument', typ: u$2(undefined, r$2('InstrumentElement')) },
7062
7068
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7069
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7063
7070
  { json: 'type', js: 'type', typ: r$2('ProductType') },
7064
7071
  ], 'any'),
7065
7072
  OrderList: o$2([
@@ -7072,6 +7079,7 @@ function r$2(name) {
7072
7079
  { json: 'details', js: 'details', typ: u$2(undefined, r$2('FluffyOrderDetails')) },
7073
7080
  { json: 'id', js: 'id', typ: m$2('') },
7074
7081
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7082
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7075
7083
  { json: 'type', js: 'type', typ: r$2('OrderType') },
7076
7084
  ], 'any'),
7077
7085
  FluffyOrderDetails: o$2([{ json: 'product', js: 'product', typ: u$2(undefined, r$2('ProductObject')) }], 'any'),
@@ -7109,6 +7117,7 @@ function r$2(name) {
7109
7117
  { json: 'id', js: 'id', typ: m$2('') },
7110
7118
  { json: 'instrument', js: 'instrument', typ: u$2(undefined, r$2('InstrumentElement')) },
7111
7119
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7120
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7112
7121
  { json: 'type', js: 'type', typ: r$2('ProductType') },
7113
7122
  ], 'any'),
7114
7123
  TimeRange: o$2([
@@ -7121,6 +7130,7 @@ function r$2(name) {
7121
7130
  Trade: o$2([
7122
7131
  { json: 'id', js: 'id', typ: m$2('') },
7123
7132
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7133
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7124
7134
  { json: 'product', js: 'product', typ: r$2('ProductObject') },
7125
7135
  { json: 'type', js: 'type', typ: r$2('TradeType') },
7126
7136
  ], 'any'),
@@ -7133,6 +7143,7 @@ function r$2(name) {
7133
7143
  TradeElement: o$2([
7134
7144
  { json: 'id', js: 'id', typ: m$2('') },
7135
7145
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7146
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7136
7147
  { json: 'product', js: 'product', typ: r$2('ProductObject') },
7137
7148
  { json: 'type', js: 'type', typ: r$2('TradeType') },
7138
7149
  ], 'any'),
@@ -7271,7 +7282,7 @@ function r$1(name) {
7271
7282
  { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7272
7283
  { json: 'identityUrl', js: 'identityUrl', typ: '' },
7273
7284
  { json: 'intentResolver', js: 'intentResolver', typ: u$1(undefined, true) },
7274
- ], 'any'),
7285
+ ], false),
7275
7286
  WebConnectionProtocol3HandshakePayload: o$1([
7276
7287
  { json: 'appLaunchTimeout', js: 'appLaunchTimeout', typ: u$1(undefined, 3.14) },
7277
7288
  { json: 'channelSelectorUrl', js: 'channelSelectorUrl', typ: u$1(true, '') },
@@ -7383,7 +7394,10 @@ function r$1(name) {
7383
7394
  { json: 'type', js: 'type', typ: '' },
7384
7395
  ], 'any'),
7385
7396
  BroadcastResponseResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) }], 'any'),
7386
- ChannelChangedEventPayload: o$1([{ json: 'newChannelId', js: 'newChannelId', typ: u$1(null, '') }], false),
7397
+ ChannelChangedEventPayload: o$1([
7398
+ { json: 'newChannelId', js: 'newChannelId', typ: u$1(undefined, u$1(null, '')) },
7399
+ { json: 'currentChannelId', js: 'currentChannelId', typ: u$1(undefined, u$1(null, '')) },
7400
+ ], false),
7387
7401
  CreatePrivateChannelResponsePayload: o$1([
7388
7402
  { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7389
7403
  { json: 'privateChannel', js: 'privateChannel', typ: u$1(undefined, r$1('Channel')) },
@@ -8070,6 +8084,8 @@ var OpenError;
8070
8084
  OpenError["DesktopAgentNotFound"] = "DesktopAgentNotFound";
8071
8085
  /** Returned if a timeout occurs before a call to open is resolved for any reason other than the not adding its context listener in time.*/
8072
8086
  OpenError["ApiTimeout"] = "ApiTimeout";
8087
+ /** Returned when incorrect arguments are passed to API calls.*/
8088
+ OpenError["InvalidArguments"] = "InvalidArguments";
8073
8089
  })(OpenError || (OpenError = {}));
8074
8090
  /** Constants representing the errors that can be encountered when calling the `findIntent`, `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the DesktopAgent (`fdc3`). */
8075
8091
  var ResolveError;
@@ -8090,10 +8106,14 @@ var ResolveError;
8090
8106
  ResolveError["IntentDeliveryFailed"] = "IntentDeliveryFailed";
8091
8107
  /** Returned if a call to one of the `raiseIntent` functions is made with an invalid context argument. Contexts should be Objects with at least a `type` field that has a `string` value.*/
8092
8108
  ResolveError["MalformedContext"] = "MalformedContext";
8109
+ /** Returned if `fdc3.addIntentListener` is called for a specified intent that the application has already added a listener for and has not subsequently removed it. */
8110
+ ResolveError["IntentListenerConflict"] = "IntentListenerConflict";
8093
8111
  /** @experimental Returned if the specified Desktop Agent is not found, via a connected Desktop Agent Bridge.*/
8094
8112
  ResolveError["DesktopAgentNotFound"] = "DesktopAgentNotFound";
8095
8113
  /** Returned if a timeout occurs before the API call is resolved for any reason other than the resolver timing out (use ResolverTimeout) or an app launched by a raiseIntent function doesn't add its intent listener in time (use IntentDeliveryFailed).*/
8096
8114
  ResolveError["ApiTimeout"] = "ApiTimeout";
8115
+ /** Returned when incorrect arguments are passed to API calls.*/
8116
+ ResolveError["InvalidArguments"] = "InvalidArguments";
8097
8117
  })(ResolveError || (ResolveError = {}));
8098
8118
  var ResultError;
8099
8119
  (function (ResultError) {
@@ -8116,6 +8136,8 @@ var ChannelError;
8116
8136
  ChannelError["MalformedContext"] = "MalformedContext";
8117
8137
  /** Returned if a timeout occurs before any Channel related API call is resolved.*/
8118
8138
  ChannelError["ApiTimeout"] = "ApiTimeout";
8139
+ /** Returned when incorrect arguments are passed to API calls.*/
8140
+ ChannelError["InvalidArguments"] = "InvalidArguments";
8119
8141
  })(ChannelError || (ChannelError = {}));
8120
8142
  var BridgingError;
8121
8143
  (function (BridgingError) {
@@ -8168,7 +8190,7 @@ var WebDesktopAgentType;
8168
8190
  */
8169
8191
  const exhaustiveStringTuple = () => (...tuple) => tuple;
8170
8192
 
8171
- const STANDARD_CONTEXT_TYPES = exhaustiveStringTuple()('fdc3.action', 'fdc3.chart', 'fdc3.chat.initSettings', 'fdc3.chat.message', 'fdc3.chat.room', 'fdc3.chat.searchCriteria', 'fdc3.contact', 'fdc3.contactList', 'fdc3.country', 'fdc3.currency', 'fdc3.email', 'fdc3.instrument', 'fdc3.instrumentList', 'fdc3.interaction', 'fdc3.message', 'fdc3.organization', 'fdc3.portfolio', 'fdc3.position', 'fdc3.nothing', 'fdc3.timeRange', 'fdc3.transactionResult', 'fdc3.valuation');
8193
+ const STANDARD_CONTEXT_TYPES = exhaustiveStringTuple()('fdc3.action', 'fdc3.chart', 'fdc3.chat.initSettings', 'fdc3.chat.message', 'fdc3.chat.room', 'fdc3.chat.searchCriteria', 'fdc3.contact', 'fdc3.contactList', 'fdc3.country', 'fdc3.currency', 'fdc3.email', 'fdc3.fileAttachment', 'fdc3.instrument', 'fdc3.instrumentList', 'fdc3.interaction', 'fdc3.message', 'fdc3.nothing', 'fdc3.organization', 'fdc3.portfolio', 'fdc3.position', 'fdc3.timeRange', 'fdc3.transactionResult', 'fdc3.valuation');
8172
8194
  // used internally to check if a given intent/context is a standard one
8173
8195
  new Set(STANDARD_CONTEXT_TYPES);
8174
8196
 
@@ -8185,23 +8207,32 @@ new Set(STANDARD_INTENTS);
8185
8207
  */
8186
8208
  var ContextTypes;
8187
8209
  (function (ContextTypes) {
8210
+ ContextTypes["Action"] = "fdc3.action";
8188
8211
  ContextTypes["Chart"] = "fdc3.chart";
8189
8212
  ContextTypes["ChatInitSettings"] = "fdc3.chat.initSettings";
8213
+ ContextTypes["ChatMessage"] = "fdc3.chat.message";
8190
8214
  ContextTypes["ChatRoom"] = "fdc3.chat.room";
8215
+ ContextTypes["ChatSearchCriteria"] = "fdc3.chat.searchCriteria";
8191
8216
  ContextTypes["Contact"] = "fdc3.contact";
8192
8217
  ContextTypes["ContactList"] = "fdc3.contactList";
8193
8218
  ContextTypes["Country"] = "fdc3.country";
8194
8219
  ContextTypes["Currency"] = "fdc3.currency";
8195
8220
  ContextTypes["Email"] = "fdc3.email";
8221
+ ContextTypes["FileAttachment"] = "fdc3.fileAttachment";
8196
8222
  ContextTypes["Instrument"] = "fdc3.instrument";
8197
8223
  ContextTypes["InstrumentList"] = "fdc3.instrumentList";
8198
8224
  ContextTypes["Interaction"] = "fdc3.interaction";
8225
+ ContextTypes["Message"] = "fdc3.message";
8199
8226
  ContextTypes["Nothing"] = "fdc3.nothing";
8227
+ ContextTypes["Order"] = "fdc3.order";
8228
+ ContextTypes["OrderList"] = "fdc3.orderList";
8200
8229
  ContextTypes["Organization"] = "fdc3.organization";
8201
8230
  ContextTypes["Portfolio"] = "fdc3.portfolio";
8202
8231
  ContextTypes["Position"] = "fdc3.position";
8203
- ContextTypes["ChatSearchCriteria"] = "fdc3.chat.searchCriteria";
8232
+ ContextTypes["Product"] = "fdc3.product";
8204
8233
  ContextTypes["TimeRange"] = "fdc3.timeRange";
8234
+ ContextTypes["Trade"] = "fdc3.trade";
8235
+ ContextTypes["TradeList"] = "fdc3.tradeList";
8205
8236
  ContextTypes["TransactionResult"] = "fdc3.transactionResult";
8206
8237
  ContextTypes["Valuation"] = "fdc3.valuation";
8207
8238
  })(ContextTypes || (ContextTypes = {}));
@@ -10364,7 +10395,7 @@ class NewDataWrappingChannelsController {
10364
10395
  if (!contextType) {
10365
10396
  return ioChannel.data.fdc3 || null;
10366
10397
  }
10367
- if (contextType && ioChannel.data.fdc3?.type === contextType) {
10398
+ if (ioChannel.data.fdc3?.type === contextType) {
10368
10399
  return ioChannel.data.fdc3;
10369
10400
  }
10370
10401
  const ioChannelContextName = this.parser.mapChannelNameToContextName(ioChannelName);
@@ -10587,7 +10618,7 @@ const fdc3Factory = () => {
10587
10618
  return ioc.fdc3;
10588
10619
  };
10589
10620
 
10590
- var version = "2.9.0";
10621
+ var version = "2.11.0-beta.0";
10591
10622
 
10592
10623
  const inNodeEnv = checkIfInNodeEnv();
10593
10624
  const globalScope = inNodeEnv ? process : window;
@@ -5004,7 +5004,7 @@
5004
5004
  /** See `Decoder.succeed` */
5005
5005
  Decoder$1.succeed;
5006
5006
  /** See `Decoder.fail` */
5007
- Decoder$1.fail;
5007
+ var fail = Decoder$1.fail;
5008
5008
  /** See `Decoder.lazy` */
5009
5009
  Decoder$1.lazy;
5010
5010
 
@@ -5015,11 +5015,15 @@
5015
5015
  });
5016
5016
  const urlDecoder = nonEmptyStringDecoder$1.andThen((url) => {
5017
5017
  try {
5018
- new URL(url);
5018
+ const { protocol } = new URL(url);
5019
+ const disallowedProtocols = ["data:", "javascript:", "vbscript:"];
5020
+ if (disallowedProtocols.includes(protocol)) {
5021
+ return fail(`Expected a URL with a safe protocol, got: ${protocol} (disallowed protocols: ${disallowedProtocols.join(", ")})`);
5022
+ }
5019
5023
  return nonEmptyStringDecoder$1;
5020
5024
  }
5021
5025
  catch {
5022
- return fail("Should be a valid URL");
5026
+ return fail("Expected a valid URL");
5023
5027
  }
5024
5028
  });
5025
5029
 
@@ -5031,7 +5035,7 @@
5031
5035
  });
5032
5036
  const v2TypeDecoder = oneOf$1(constant$1("web"), constant$1("native"), constant$1("citrix"), constant$1("onlineNative"), constant$1("other"));
5033
5037
  const v2DetailsDecoder = object$1({
5034
- url: nonEmptyStringDecoder$1
5038
+ url: urlDecoder
5035
5039
  });
5036
5040
  const v2IconDecoder = object$1({
5037
5041
  src: nonEmptyStringDecoder$1,
@@ -5059,18 +5063,19 @@
5059
5063
  listensFor: optional$1(array$1(nonEmptyStringDecoder$1))
5060
5064
  });
5061
5065
  const v2AppChannelDecoder = object$1({
5062
- name: nonEmptyStringDecoder$1,
5066
+ name: optional$1(nonEmptyStringDecoder$1),
5067
+ id: optional$1(nonEmptyStringDecoder$1),
5063
5068
  description: optional$1(nonEmptyStringDecoder$1),
5064
5069
  broadcasts: optional$1(array$1(nonEmptyStringDecoder$1)),
5065
5070
  listensFor: optional$1(array$1(nonEmptyStringDecoder$1))
5066
- });
5071
+ }).where((appChannel) => Boolean(appChannel.name || appChannel.id), "Expected at least a name or an id property to be present in the app channel definition");
5067
5072
  const v2InteropDecoder = object$1({
5068
5073
  intents: optional$1(v2IntentsDecoder),
5069
5074
  userChannels: optional$1(v2UserChannelDecoder),
5070
5075
  appChannels: optional$1(array$1(v2AppChannelDecoder))
5071
5076
  });
5072
5077
  const glue42ApplicationDetailsDecoder = object$1({
5073
- url: optional$1(nonEmptyStringDecoder$1),
5078
+ url: optional$1(urlDecoder),
5074
5079
  top: optional$1(number$1()),
5075
5080
  left: optional$1(number$1()),
5076
5081
  width: optional$1(nonNegativeNumberDecoder),
@@ -7059,6 +7064,7 @@
7059
7064
  { json: 'details', js: 'details', typ: u$2(undefined, r$2('PurpleOrderDetails')) },
7060
7065
  { json: 'id', js: 'id', typ: m$2('') },
7061
7066
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7067
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7062
7068
  { json: 'type', js: 'type', typ: r$2('OrderType') },
7063
7069
  ], 'any'),
7064
7070
  PurpleOrderDetails: o$2([{ json: 'product', js: 'product', typ: u$2(undefined, r$2('ProductObject')) }], 'any'),
@@ -7066,6 +7072,7 @@
7066
7072
  { json: 'id', js: 'id', typ: m$2('') },
7067
7073
  { json: 'instrument', js: 'instrument', typ: u$2(undefined, r$2('InstrumentElement')) },
7068
7074
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7075
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7069
7076
  { json: 'type', js: 'type', typ: r$2('ProductType') },
7070
7077
  ], 'any'),
7071
7078
  OrderList: o$2([
@@ -7078,6 +7085,7 @@
7078
7085
  { json: 'details', js: 'details', typ: u$2(undefined, r$2('FluffyOrderDetails')) },
7079
7086
  { json: 'id', js: 'id', typ: m$2('') },
7080
7087
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7088
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7081
7089
  { json: 'type', js: 'type', typ: r$2('OrderType') },
7082
7090
  ], 'any'),
7083
7091
  FluffyOrderDetails: o$2([{ json: 'product', js: 'product', typ: u$2(undefined, r$2('ProductObject')) }], 'any'),
@@ -7115,6 +7123,7 @@
7115
7123
  { json: 'id', js: 'id', typ: m$2('') },
7116
7124
  { json: 'instrument', js: 'instrument', typ: u$2(undefined, r$2('InstrumentElement')) },
7117
7125
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7126
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7118
7127
  { json: 'type', js: 'type', typ: r$2('ProductType') },
7119
7128
  ], 'any'),
7120
7129
  TimeRange: o$2([
@@ -7127,6 +7136,7 @@
7127
7136
  Trade: o$2([
7128
7137
  { json: 'id', js: 'id', typ: m$2('') },
7129
7138
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7139
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7130
7140
  { json: 'product', js: 'product', typ: r$2('ProductObject') },
7131
7141
  { json: 'type', js: 'type', typ: r$2('TradeType') },
7132
7142
  ], 'any'),
@@ -7139,6 +7149,7 @@
7139
7149
  TradeElement: o$2([
7140
7150
  { json: 'id', js: 'id', typ: m$2('') },
7141
7151
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7152
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7142
7153
  { json: 'product', js: 'product', typ: r$2('ProductObject') },
7143
7154
  { json: 'type', js: 'type', typ: r$2('TradeType') },
7144
7155
  ], 'any'),
@@ -7277,7 +7288,7 @@
7277
7288
  { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7278
7289
  { json: 'identityUrl', js: 'identityUrl', typ: '' },
7279
7290
  { json: 'intentResolver', js: 'intentResolver', typ: u$1(undefined, true) },
7280
- ], 'any'),
7291
+ ], false),
7281
7292
  WebConnectionProtocol3HandshakePayload: o$1([
7282
7293
  { json: 'appLaunchTimeout', js: 'appLaunchTimeout', typ: u$1(undefined, 3.14) },
7283
7294
  { json: 'channelSelectorUrl', js: 'channelSelectorUrl', typ: u$1(true, '') },
@@ -7389,7 +7400,10 @@
7389
7400
  { json: 'type', js: 'type', typ: '' },
7390
7401
  ], 'any'),
7391
7402
  BroadcastResponseResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) }], 'any'),
7392
- ChannelChangedEventPayload: o$1([{ json: 'newChannelId', js: 'newChannelId', typ: u$1(null, '') }], false),
7403
+ ChannelChangedEventPayload: o$1([
7404
+ { json: 'newChannelId', js: 'newChannelId', typ: u$1(undefined, u$1(null, '')) },
7405
+ { json: 'currentChannelId', js: 'currentChannelId', typ: u$1(undefined, u$1(null, '')) },
7406
+ ], false),
7393
7407
  CreatePrivateChannelResponsePayload: o$1([
7394
7408
  { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7395
7409
  { json: 'privateChannel', js: 'privateChannel', typ: u$1(undefined, r$1('Channel')) },
@@ -8076,6 +8090,8 @@
8076
8090
  OpenError["DesktopAgentNotFound"] = "DesktopAgentNotFound";
8077
8091
  /** Returned if a timeout occurs before a call to open is resolved for any reason other than the not adding its context listener in time.*/
8078
8092
  OpenError["ApiTimeout"] = "ApiTimeout";
8093
+ /** Returned when incorrect arguments are passed to API calls.*/
8094
+ OpenError["InvalidArguments"] = "InvalidArguments";
8079
8095
  })(OpenError || (OpenError = {}));
8080
8096
  /** Constants representing the errors that can be encountered when calling the `findIntent`, `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the DesktopAgent (`fdc3`). */
8081
8097
  var ResolveError;
@@ -8096,10 +8112,14 @@
8096
8112
  ResolveError["IntentDeliveryFailed"] = "IntentDeliveryFailed";
8097
8113
  /** Returned if a call to one of the `raiseIntent` functions is made with an invalid context argument. Contexts should be Objects with at least a `type` field that has a `string` value.*/
8098
8114
  ResolveError["MalformedContext"] = "MalformedContext";
8115
+ /** Returned if `fdc3.addIntentListener` is called for a specified intent that the application has already added a listener for and has not subsequently removed it. */
8116
+ ResolveError["IntentListenerConflict"] = "IntentListenerConflict";
8099
8117
  /** @experimental Returned if the specified Desktop Agent is not found, via a connected Desktop Agent Bridge.*/
8100
8118
  ResolveError["DesktopAgentNotFound"] = "DesktopAgentNotFound";
8101
8119
  /** Returned if a timeout occurs before the API call is resolved for any reason other than the resolver timing out (use ResolverTimeout) or an app launched by a raiseIntent function doesn't add its intent listener in time (use IntentDeliveryFailed).*/
8102
8120
  ResolveError["ApiTimeout"] = "ApiTimeout";
8121
+ /** Returned when incorrect arguments are passed to API calls.*/
8122
+ ResolveError["InvalidArguments"] = "InvalidArguments";
8103
8123
  })(ResolveError || (ResolveError = {}));
8104
8124
  var ResultError;
8105
8125
  (function (ResultError) {
@@ -8122,6 +8142,8 @@
8122
8142
  ChannelError["MalformedContext"] = "MalformedContext";
8123
8143
  /** Returned if a timeout occurs before any Channel related API call is resolved.*/
8124
8144
  ChannelError["ApiTimeout"] = "ApiTimeout";
8145
+ /** Returned when incorrect arguments are passed to API calls.*/
8146
+ ChannelError["InvalidArguments"] = "InvalidArguments";
8125
8147
  })(ChannelError || (ChannelError = {}));
8126
8148
  var BridgingError;
8127
8149
  (function (BridgingError) {
@@ -8174,7 +8196,7 @@
8174
8196
  */
8175
8197
  const exhaustiveStringTuple = () => (...tuple) => tuple;
8176
8198
 
8177
- const STANDARD_CONTEXT_TYPES = exhaustiveStringTuple()('fdc3.action', 'fdc3.chart', 'fdc3.chat.initSettings', 'fdc3.chat.message', 'fdc3.chat.room', 'fdc3.chat.searchCriteria', 'fdc3.contact', 'fdc3.contactList', 'fdc3.country', 'fdc3.currency', 'fdc3.email', 'fdc3.instrument', 'fdc3.instrumentList', 'fdc3.interaction', 'fdc3.message', 'fdc3.organization', 'fdc3.portfolio', 'fdc3.position', 'fdc3.nothing', 'fdc3.timeRange', 'fdc3.transactionResult', 'fdc3.valuation');
8199
+ const STANDARD_CONTEXT_TYPES = exhaustiveStringTuple()('fdc3.action', 'fdc3.chart', 'fdc3.chat.initSettings', 'fdc3.chat.message', 'fdc3.chat.room', 'fdc3.chat.searchCriteria', 'fdc3.contact', 'fdc3.contactList', 'fdc3.country', 'fdc3.currency', 'fdc3.email', 'fdc3.fileAttachment', 'fdc3.instrument', 'fdc3.instrumentList', 'fdc3.interaction', 'fdc3.message', 'fdc3.nothing', 'fdc3.organization', 'fdc3.portfolio', 'fdc3.position', 'fdc3.timeRange', 'fdc3.transactionResult', 'fdc3.valuation');
8178
8200
  // used internally to check if a given intent/context is a standard one
8179
8201
  new Set(STANDARD_CONTEXT_TYPES);
8180
8202
 
@@ -8191,23 +8213,32 @@
8191
8213
  */
8192
8214
  var ContextTypes;
8193
8215
  (function (ContextTypes) {
8216
+ ContextTypes["Action"] = "fdc3.action";
8194
8217
  ContextTypes["Chart"] = "fdc3.chart";
8195
8218
  ContextTypes["ChatInitSettings"] = "fdc3.chat.initSettings";
8219
+ ContextTypes["ChatMessage"] = "fdc3.chat.message";
8196
8220
  ContextTypes["ChatRoom"] = "fdc3.chat.room";
8221
+ ContextTypes["ChatSearchCriteria"] = "fdc3.chat.searchCriteria";
8197
8222
  ContextTypes["Contact"] = "fdc3.contact";
8198
8223
  ContextTypes["ContactList"] = "fdc3.contactList";
8199
8224
  ContextTypes["Country"] = "fdc3.country";
8200
8225
  ContextTypes["Currency"] = "fdc3.currency";
8201
8226
  ContextTypes["Email"] = "fdc3.email";
8227
+ ContextTypes["FileAttachment"] = "fdc3.fileAttachment";
8202
8228
  ContextTypes["Instrument"] = "fdc3.instrument";
8203
8229
  ContextTypes["InstrumentList"] = "fdc3.instrumentList";
8204
8230
  ContextTypes["Interaction"] = "fdc3.interaction";
8231
+ ContextTypes["Message"] = "fdc3.message";
8205
8232
  ContextTypes["Nothing"] = "fdc3.nothing";
8233
+ ContextTypes["Order"] = "fdc3.order";
8234
+ ContextTypes["OrderList"] = "fdc3.orderList";
8206
8235
  ContextTypes["Organization"] = "fdc3.organization";
8207
8236
  ContextTypes["Portfolio"] = "fdc3.portfolio";
8208
8237
  ContextTypes["Position"] = "fdc3.position";
8209
- ContextTypes["ChatSearchCriteria"] = "fdc3.chat.searchCriteria";
8238
+ ContextTypes["Product"] = "fdc3.product";
8210
8239
  ContextTypes["TimeRange"] = "fdc3.timeRange";
8240
+ ContextTypes["Trade"] = "fdc3.trade";
8241
+ ContextTypes["TradeList"] = "fdc3.tradeList";
8211
8242
  ContextTypes["TransactionResult"] = "fdc3.transactionResult";
8212
8243
  ContextTypes["Valuation"] = "fdc3.valuation";
8213
8244
  })(ContextTypes || (ContextTypes = {}));
@@ -10370,7 +10401,7 @@
10370
10401
  if (!contextType) {
10371
10402
  return ioChannel.data.fdc3 || null;
10372
10403
  }
10373
- if (contextType && ioChannel.data.fdc3?.type === contextType) {
10404
+ if (ioChannel.data.fdc3?.type === contextType) {
10374
10405
  return ioChannel.data.fdc3;
10375
10406
  }
10376
10407
  const ioChannelContextName = this.parser.mapChannelNameToContextName(ioChannelName);
@@ -10593,7 +10624,7 @@
10593
10624
  return ioc.fdc3;
10594
10625
  };
10595
10626
 
10596
- var version = "2.9.0";
10627
+ var version = "2.11.0-beta.0";
10597
10628
 
10598
10629
  const inNodeEnv = checkIfInNodeEnv();
10599
10630
  const globalScope = inNodeEnv ? process : window;
package/dist/fdc3.es.js CHANGED
@@ -4987,7 +4987,7 @@ Decoder$1.valueAt;
4987
4987
  /** See `Decoder.succeed` */
4988
4988
  Decoder$1.succeed;
4989
4989
  /** See `Decoder.fail` */
4990
- Decoder$1.fail;
4990
+ var fail = Decoder$1.fail;
4991
4991
  /** See `Decoder.lazy` */
4992
4992
  Decoder$1.lazy;
4993
4993
 
@@ -4998,11 +4998,15 @@ const regexDecoder = anyJson$1().andThen((value) => {
4998
4998
  });
4999
4999
  const urlDecoder = nonEmptyStringDecoder$1.andThen((url) => {
5000
5000
  try {
5001
- new URL(url);
5001
+ const { protocol } = new URL(url);
5002
+ const disallowedProtocols = ["data:", "javascript:", "vbscript:"];
5003
+ if (disallowedProtocols.includes(protocol)) {
5004
+ return fail(`Expected a URL with a safe protocol, got: ${protocol} (disallowed protocols: ${disallowedProtocols.join(", ")})`);
5005
+ }
5002
5006
  return nonEmptyStringDecoder$1;
5003
5007
  }
5004
5008
  catch {
5005
- return fail("Should be a valid URL");
5009
+ return fail("Expected a valid URL");
5006
5010
  }
5007
5011
  });
5008
5012
 
@@ -5014,7 +5018,7 @@ const intentDefinitionDecoder = object$1({
5014
5018
  });
5015
5019
  const v2TypeDecoder = oneOf$1(constant$1("web"), constant$1("native"), constant$1("citrix"), constant$1("onlineNative"), constant$1("other"));
5016
5020
  const v2DetailsDecoder = object$1({
5017
- url: nonEmptyStringDecoder$1
5021
+ url: urlDecoder
5018
5022
  });
5019
5023
  const v2IconDecoder = object$1({
5020
5024
  src: nonEmptyStringDecoder$1,
@@ -5042,18 +5046,19 @@ const v2UserChannelDecoder = object$1({
5042
5046
  listensFor: optional$1(array$1(nonEmptyStringDecoder$1))
5043
5047
  });
5044
5048
  const v2AppChannelDecoder = object$1({
5045
- name: nonEmptyStringDecoder$1,
5049
+ name: optional$1(nonEmptyStringDecoder$1),
5050
+ id: optional$1(nonEmptyStringDecoder$1),
5046
5051
  description: optional$1(nonEmptyStringDecoder$1),
5047
5052
  broadcasts: optional$1(array$1(nonEmptyStringDecoder$1)),
5048
5053
  listensFor: optional$1(array$1(nonEmptyStringDecoder$1))
5049
- });
5054
+ }).where((appChannel) => Boolean(appChannel.name || appChannel.id), "Expected at least a name or an id property to be present in the app channel definition");
5050
5055
  const v2InteropDecoder = object$1({
5051
5056
  intents: optional$1(v2IntentsDecoder),
5052
5057
  userChannels: optional$1(v2UserChannelDecoder),
5053
5058
  appChannels: optional$1(array$1(v2AppChannelDecoder))
5054
5059
  });
5055
5060
  const glue42ApplicationDetailsDecoder = object$1({
5056
- url: optional$1(nonEmptyStringDecoder$1),
5061
+ url: optional$1(urlDecoder),
5057
5062
  top: optional$1(number$1()),
5058
5063
  left: optional$1(number$1()),
5059
5064
  width: optional$1(nonNegativeNumberDecoder),
@@ -7042,6 +7047,7 @@ function r$2(name) {
7042
7047
  { json: 'details', js: 'details', typ: u$2(undefined, r$2('PurpleOrderDetails')) },
7043
7048
  { json: 'id', js: 'id', typ: m$2('') },
7044
7049
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7050
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7045
7051
  { json: 'type', js: 'type', typ: r$2('OrderType') },
7046
7052
  ], 'any'),
7047
7053
  PurpleOrderDetails: o$2([{ json: 'product', js: 'product', typ: u$2(undefined, r$2('ProductObject')) }], 'any'),
@@ -7049,6 +7055,7 @@ function r$2(name) {
7049
7055
  { json: 'id', js: 'id', typ: m$2('') },
7050
7056
  { json: 'instrument', js: 'instrument', typ: u$2(undefined, r$2('InstrumentElement')) },
7051
7057
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7058
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7052
7059
  { json: 'type', js: 'type', typ: r$2('ProductType') },
7053
7060
  ], 'any'),
7054
7061
  OrderList: o$2([
@@ -7061,6 +7068,7 @@ function r$2(name) {
7061
7068
  { json: 'details', js: 'details', typ: u$2(undefined, r$2('FluffyOrderDetails')) },
7062
7069
  { json: 'id', js: 'id', typ: m$2('') },
7063
7070
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7071
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7064
7072
  { json: 'type', js: 'type', typ: r$2('OrderType') },
7065
7073
  ], 'any'),
7066
7074
  FluffyOrderDetails: o$2([{ json: 'product', js: 'product', typ: u$2(undefined, r$2('ProductObject')) }], 'any'),
@@ -7098,6 +7106,7 @@ function r$2(name) {
7098
7106
  { json: 'id', js: 'id', typ: m$2('') },
7099
7107
  { json: 'instrument', js: 'instrument', typ: u$2(undefined, r$2('InstrumentElement')) },
7100
7108
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7109
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7101
7110
  { json: 'type', js: 'type', typ: r$2('ProductType') },
7102
7111
  ], 'any'),
7103
7112
  TimeRange: o$2([
@@ -7110,6 +7119,7 @@ function r$2(name) {
7110
7119
  Trade: o$2([
7111
7120
  { json: 'id', js: 'id', typ: m$2('') },
7112
7121
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7122
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7113
7123
  { json: 'product', js: 'product', typ: r$2('ProductObject') },
7114
7124
  { json: 'type', js: 'type', typ: r$2('TradeType') },
7115
7125
  ], 'any'),
@@ -7122,6 +7132,7 @@ function r$2(name) {
7122
7132
  TradeElement: o$2([
7123
7133
  { json: 'id', js: 'id', typ: m$2('') },
7124
7134
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7135
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7125
7136
  { json: 'product', js: 'product', typ: r$2('ProductObject') },
7126
7137
  { json: 'type', js: 'type', typ: r$2('TradeType') },
7127
7138
  ], 'any'),
@@ -7260,7 +7271,7 @@ function r$1(name) {
7260
7271
  { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7261
7272
  { json: 'identityUrl', js: 'identityUrl', typ: '' },
7262
7273
  { json: 'intentResolver', js: 'intentResolver', typ: u$1(undefined, true) },
7263
- ], 'any'),
7274
+ ], false),
7264
7275
  WebConnectionProtocol3HandshakePayload: o$1([
7265
7276
  { json: 'appLaunchTimeout', js: 'appLaunchTimeout', typ: u$1(undefined, 3.14) },
7266
7277
  { json: 'channelSelectorUrl', js: 'channelSelectorUrl', typ: u$1(true, '') },
@@ -7372,7 +7383,10 @@ function r$1(name) {
7372
7383
  { json: 'type', js: 'type', typ: '' },
7373
7384
  ], 'any'),
7374
7385
  BroadcastResponseResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) }], 'any'),
7375
- ChannelChangedEventPayload: o$1([{ json: 'newChannelId', js: 'newChannelId', typ: u$1(null, '') }], false),
7386
+ ChannelChangedEventPayload: o$1([
7387
+ { json: 'newChannelId', js: 'newChannelId', typ: u$1(undefined, u$1(null, '')) },
7388
+ { json: 'currentChannelId', js: 'currentChannelId', typ: u$1(undefined, u$1(null, '')) },
7389
+ ], false),
7376
7390
  CreatePrivateChannelResponsePayload: o$1([
7377
7391
  { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7378
7392
  { json: 'privateChannel', js: 'privateChannel', typ: u$1(undefined, r$1('Channel')) },
@@ -8059,6 +8073,8 @@ var OpenError;
8059
8073
  OpenError["DesktopAgentNotFound"] = "DesktopAgentNotFound";
8060
8074
  /** Returned if a timeout occurs before a call to open is resolved for any reason other than the not adding its context listener in time.*/
8061
8075
  OpenError["ApiTimeout"] = "ApiTimeout";
8076
+ /** Returned when incorrect arguments are passed to API calls.*/
8077
+ OpenError["InvalidArguments"] = "InvalidArguments";
8062
8078
  })(OpenError || (OpenError = {}));
8063
8079
  /** Constants representing the errors that can be encountered when calling the `findIntent`, `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the DesktopAgent (`fdc3`). */
8064
8080
  var ResolveError;
@@ -8079,10 +8095,14 @@ var ResolveError;
8079
8095
  ResolveError["IntentDeliveryFailed"] = "IntentDeliveryFailed";
8080
8096
  /** Returned if a call to one of the `raiseIntent` functions is made with an invalid context argument. Contexts should be Objects with at least a `type` field that has a `string` value.*/
8081
8097
  ResolveError["MalformedContext"] = "MalformedContext";
8098
+ /** Returned if `fdc3.addIntentListener` is called for a specified intent that the application has already added a listener for and has not subsequently removed it. */
8099
+ ResolveError["IntentListenerConflict"] = "IntentListenerConflict";
8082
8100
  /** @experimental Returned if the specified Desktop Agent is not found, via a connected Desktop Agent Bridge.*/
8083
8101
  ResolveError["DesktopAgentNotFound"] = "DesktopAgentNotFound";
8084
8102
  /** Returned if a timeout occurs before the API call is resolved for any reason other than the resolver timing out (use ResolverTimeout) or an app launched by a raiseIntent function doesn't add its intent listener in time (use IntentDeliveryFailed).*/
8085
8103
  ResolveError["ApiTimeout"] = "ApiTimeout";
8104
+ /** Returned when incorrect arguments are passed to API calls.*/
8105
+ ResolveError["InvalidArguments"] = "InvalidArguments";
8086
8106
  })(ResolveError || (ResolveError = {}));
8087
8107
  var ResultError;
8088
8108
  (function (ResultError) {
@@ -8105,6 +8125,8 @@ var ChannelError;
8105
8125
  ChannelError["MalformedContext"] = "MalformedContext";
8106
8126
  /** Returned if a timeout occurs before any Channel related API call is resolved.*/
8107
8127
  ChannelError["ApiTimeout"] = "ApiTimeout";
8128
+ /** Returned when incorrect arguments are passed to API calls.*/
8129
+ ChannelError["InvalidArguments"] = "InvalidArguments";
8108
8130
  })(ChannelError || (ChannelError = {}));
8109
8131
  var BridgingError;
8110
8132
  (function (BridgingError) {
@@ -8157,7 +8179,7 @@ var WebDesktopAgentType;
8157
8179
  */
8158
8180
  const exhaustiveStringTuple = () => (...tuple) => tuple;
8159
8181
 
8160
- const STANDARD_CONTEXT_TYPES = exhaustiveStringTuple()('fdc3.action', 'fdc3.chart', 'fdc3.chat.initSettings', 'fdc3.chat.message', 'fdc3.chat.room', 'fdc3.chat.searchCriteria', 'fdc3.contact', 'fdc3.contactList', 'fdc3.country', 'fdc3.currency', 'fdc3.email', 'fdc3.instrument', 'fdc3.instrumentList', 'fdc3.interaction', 'fdc3.message', 'fdc3.organization', 'fdc3.portfolio', 'fdc3.position', 'fdc3.nothing', 'fdc3.timeRange', 'fdc3.transactionResult', 'fdc3.valuation');
8182
+ const STANDARD_CONTEXT_TYPES = exhaustiveStringTuple()('fdc3.action', 'fdc3.chart', 'fdc3.chat.initSettings', 'fdc3.chat.message', 'fdc3.chat.room', 'fdc3.chat.searchCriteria', 'fdc3.contact', 'fdc3.contactList', 'fdc3.country', 'fdc3.currency', 'fdc3.email', 'fdc3.fileAttachment', 'fdc3.instrument', 'fdc3.instrumentList', 'fdc3.interaction', 'fdc3.message', 'fdc3.nothing', 'fdc3.organization', 'fdc3.portfolio', 'fdc3.position', 'fdc3.timeRange', 'fdc3.transactionResult', 'fdc3.valuation');
8161
8183
  // used internally to check if a given intent/context is a standard one
8162
8184
  new Set(STANDARD_CONTEXT_TYPES);
8163
8185
 
@@ -8174,23 +8196,32 @@ new Set(STANDARD_INTENTS);
8174
8196
  */
8175
8197
  var ContextTypes;
8176
8198
  (function (ContextTypes) {
8199
+ ContextTypes["Action"] = "fdc3.action";
8177
8200
  ContextTypes["Chart"] = "fdc3.chart";
8178
8201
  ContextTypes["ChatInitSettings"] = "fdc3.chat.initSettings";
8202
+ ContextTypes["ChatMessage"] = "fdc3.chat.message";
8179
8203
  ContextTypes["ChatRoom"] = "fdc3.chat.room";
8204
+ ContextTypes["ChatSearchCriteria"] = "fdc3.chat.searchCriteria";
8180
8205
  ContextTypes["Contact"] = "fdc3.contact";
8181
8206
  ContextTypes["ContactList"] = "fdc3.contactList";
8182
8207
  ContextTypes["Country"] = "fdc3.country";
8183
8208
  ContextTypes["Currency"] = "fdc3.currency";
8184
8209
  ContextTypes["Email"] = "fdc3.email";
8210
+ ContextTypes["FileAttachment"] = "fdc3.fileAttachment";
8185
8211
  ContextTypes["Instrument"] = "fdc3.instrument";
8186
8212
  ContextTypes["InstrumentList"] = "fdc3.instrumentList";
8187
8213
  ContextTypes["Interaction"] = "fdc3.interaction";
8214
+ ContextTypes["Message"] = "fdc3.message";
8188
8215
  ContextTypes["Nothing"] = "fdc3.nothing";
8216
+ ContextTypes["Order"] = "fdc3.order";
8217
+ ContextTypes["OrderList"] = "fdc3.orderList";
8189
8218
  ContextTypes["Organization"] = "fdc3.organization";
8190
8219
  ContextTypes["Portfolio"] = "fdc3.portfolio";
8191
8220
  ContextTypes["Position"] = "fdc3.position";
8192
- ContextTypes["ChatSearchCriteria"] = "fdc3.chat.searchCriteria";
8221
+ ContextTypes["Product"] = "fdc3.product";
8193
8222
  ContextTypes["TimeRange"] = "fdc3.timeRange";
8223
+ ContextTypes["Trade"] = "fdc3.trade";
8224
+ ContextTypes["TradeList"] = "fdc3.tradeList";
8194
8225
  ContextTypes["TransactionResult"] = "fdc3.transactionResult";
8195
8226
  ContextTypes["Valuation"] = "fdc3.valuation";
8196
8227
  })(ContextTypes || (ContextTypes = {}));
@@ -10353,7 +10384,7 @@ class NewDataWrappingChannelsController {
10353
10384
  if (!contextType) {
10354
10385
  return ioChannel.data.fdc3 || null;
10355
10386
  }
10356
- if (contextType && ioChannel.data.fdc3?.type === contextType) {
10387
+ if (ioChannel.data.fdc3?.type === contextType) {
10357
10388
  return ioChannel.data.fdc3;
10358
10389
  }
10359
10390
  const ioChannelContextName = this.parser.mapChannelNameToContextName(ioChannelName);
@@ -10576,7 +10607,7 @@ const fdc3Factory = () => {
10576
10607
  return ioc.fdc3;
10577
10608
  };
10578
10609
 
10579
- var version = "2.9.0";
10610
+ var version = "2.11.0-beta.0";
10580
10611
 
10581
10612
  const inNodeEnv = checkIfInNodeEnv();
10582
10613
  const globalScope = inNodeEnv ? process : window;
package/dist/fdc3.umd.js CHANGED
@@ -4993,7 +4993,7 @@
4993
4993
  /** See `Decoder.succeed` */
4994
4994
  Decoder$1.succeed;
4995
4995
  /** See `Decoder.fail` */
4996
- Decoder$1.fail;
4996
+ var fail = Decoder$1.fail;
4997
4997
  /** See `Decoder.lazy` */
4998
4998
  Decoder$1.lazy;
4999
4999
 
@@ -5004,11 +5004,15 @@
5004
5004
  });
5005
5005
  const urlDecoder = nonEmptyStringDecoder$1.andThen((url) => {
5006
5006
  try {
5007
- new URL(url);
5007
+ const { protocol } = new URL(url);
5008
+ const disallowedProtocols = ["data:", "javascript:", "vbscript:"];
5009
+ if (disallowedProtocols.includes(protocol)) {
5010
+ return fail(`Expected a URL with a safe protocol, got: ${protocol} (disallowed protocols: ${disallowedProtocols.join(", ")})`);
5011
+ }
5008
5012
  return nonEmptyStringDecoder$1;
5009
5013
  }
5010
5014
  catch {
5011
- return fail("Should be a valid URL");
5015
+ return fail("Expected a valid URL");
5012
5016
  }
5013
5017
  });
5014
5018
 
@@ -5020,7 +5024,7 @@
5020
5024
  });
5021
5025
  const v2TypeDecoder = oneOf$1(constant$1("web"), constant$1("native"), constant$1("citrix"), constant$1("onlineNative"), constant$1("other"));
5022
5026
  const v2DetailsDecoder = object$1({
5023
- url: nonEmptyStringDecoder$1
5027
+ url: urlDecoder
5024
5028
  });
5025
5029
  const v2IconDecoder = object$1({
5026
5030
  src: nonEmptyStringDecoder$1,
@@ -5048,18 +5052,19 @@
5048
5052
  listensFor: optional$1(array$1(nonEmptyStringDecoder$1))
5049
5053
  });
5050
5054
  const v2AppChannelDecoder = object$1({
5051
- name: nonEmptyStringDecoder$1,
5055
+ name: optional$1(nonEmptyStringDecoder$1),
5056
+ id: optional$1(nonEmptyStringDecoder$1),
5052
5057
  description: optional$1(nonEmptyStringDecoder$1),
5053
5058
  broadcasts: optional$1(array$1(nonEmptyStringDecoder$1)),
5054
5059
  listensFor: optional$1(array$1(nonEmptyStringDecoder$1))
5055
- });
5060
+ }).where((appChannel) => Boolean(appChannel.name || appChannel.id), "Expected at least a name or an id property to be present in the app channel definition");
5056
5061
  const v2InteropDecoder = object$1({
5057
5062
  intents: optional$1(v2IntentsDecoder),
5058
5063
  userChannels: optional$1(v2UserChannelDecoder),
5059
5064
  appChannels: optional$1(array$1(v2AppChannelDecoder))
5060
5065
  });
5061
5066
  const glue42ApplicationDetailsDecoder = object$1({
5062
- url: optional$1(nonEmptyStringDecoder$1),
5067
+ url: optional$1(urlDecoder),
5063
5068
  top: optional$1(number$1()),
5064
5069
  left: optional$1(number$1()),
5065
5070
  width: optional$1(nonNegativeNumberDecoder),
@@ -7048,6 +7053,7 @@
7048
7053
  { json: 'details', js: 'details', typ: u$2(undefined, r$2('PurpleOrderDetails')) },
7049
7054
  { json: 'id', js: 'id', typ: m$2('') },
7050
7055
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7056
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7051
7057
  { json: 'type', js: 'type', typ: r$2('OrderType') },
7052
7058
  ], 'any'),
7053
7059
  PurpleOrderDetails: o$2([{ json: 'product', js: 'product', typ: u$2(undefined, r$2('ProductObject')) }], 'any'),
@@ -7055,6 +7061,7 @@
7055
7061
  { json: 'id', js: 'id', typ: m$2('') },
7056
7062
  { json: 'instrument', js: 'instrument', typ: u$2(undefined, r$2('InstrumentElement')) },
7057
7063
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7064
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7058
7065
  { json: 'type', js: 'type', typ: r$2('ProductType') },
7059
7066
  ], 'any'),
7060
7067
  OrderList: o$2([
@@ -7067,6 +7074,7 @@
7067
7074
  { json: 'details', js: 'details', typ: u$2(undefined, r$2('FluffyOrderDetails')) },
7068
7075
  { json: 'id', js: 'id', typ: m$2('') },
7069
7076
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7077
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7070
7078
  { json: 'type', js: 'type', typ: r$2('OrderType') },
7071
7079
  ], 'any'),
7072
7080
  FluffyOrderDetails: o$2([{ json: 'product', js: 'product', typ: u$2(undefined, r$2('ProductObject')) }], 'any'),
@@ -7104,6 +7112,7 @@
7104
7112
  { json: 'id', js: 'id', typ: m$2('') },
7105
7113
  { json: 'instrument', js: 'instrument', typ: u$2(undefined, r$2('InstrumentElement')) },
7106
7114
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7115
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7107
7116
  { json: 'type', js: 'type', typ: r$2('ProductType') },
7108
7117
  ], 'any'),
7109
7118
  TimeRange: o$2([
@@ -7116,6 +7125,7 @@
7116
7125
  Trade: o$2([
7117
7126
  { json: 'id', js: 'id', typ: m$2('') },
7118
7127
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7128
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7119
7129
  { json: 'product', js: 'product', typ: r$2('ProductObject') },
7120
7130
  { json: 'type', js: 'type', typ: r$2('TradeType') },
7121
7131
  ], 'any'),
@@ -7128,6 +7138,7 @@
7128
7138
  TradeElement: o$2([
7129
7139
  { json: 'id', js: 'id', typ: m$2('') },
7130
7140
  { json: 'name', js: 'name', typ: u$2(undefined, '') },
7141
+ { json: 'notes', js: 'notes', typ: u$2(undefined, '') },
7131
7142
  { json: 'product', js: 'product', typ: r$2('ProductObject') },
7132
7143
  { json: 'type', js: 'type', typ: r$2('TradeType') },
7133
7144
  ], 'any'),
@@ -7266,7 +7277,7 @@
7266
7277
  { json: 'fdc3Version', js: 'fdc3Version', typ: '' },
7267
7278
  { json: 'identityUrl', js: 'identityUrl', typ: '' },
7268
7279
  { json: 'intentResolver', js: 'intentResolver', typ: u$1(undefined, true) },
7269
- ], 'any'),
7280
+ ], false),
7270
7281
  WebConnectionProtocol3HandshakePayload: o$1([
7271
7282
  { json: 'appLaunchTimeout', js: 'appLaunchTimeout', typ: u$1(undefined, 3.14) },
7272
7283
  { json: 'channelSelectorUrl', js: 'channelSelectorUrl', typ: u$1(true, '') },
@@ -7378,7 +7389,10 @@
7378
7389
  { json: 'type', js: 'type', typ: '' },
7379
7390
  ], 'any'),
7380
7391
  BroadcastResponseResponsePayload: o$1([{ json: 'error', js: 'error', typ: u$1(undefined, r$1('ResponsePayloadError')) }], 'any'),
7381
- ChannelChangedEventPayload: o$1([{ json: 'newChannelId', js: 'newChannelId', typ: u$1(null, '') }], false),
7392
+ ChannelChangedEventPayload: o$1([
7393
+ { json: 'newChannelId', js: 'newChannelId', typ: u$1(undefined, u$1(null, '')) },
7394
+ { json: 'currentChannelId', js: 'currentChannelId', typ: u$1(undefined, u$1(null, '')) },
7395
+ ], false),
7382
7396
  CreatePrivateChannelResponsePayload: o$1([
7383
7397
  { json: 'error', js: 'error', typ: u$1(undefined, r$1('PurpleError')) },
7384
7398
  { json: 'privateChannel', js: 'privateChannel', typ: u$1(undefined, r$1('Channel')) },
@@ -8065,6 +8079,8 @@
8065
8079
  OpenError["DesktopAgentNotFound"] = "DesktopAgentNotFound";
8066
8080
  /** Returned if a timeout occurs before a call to open is resolved for any reason other than the not adding its context listener in time.*/
8067
8081
  OpenError["ApiTimeout"] = "ApiTimeout";
8082
+ /** Returned when incorrect arguments are passed to API calls.*/
8083
+ OpenError["InvalidArguments"] = "InvalidArguments";
8068
8084
  })(OpenError || (OpenError = {}));
8069
8085
  /** Constants representing the errors that can be encountered when calling the `findIntent`, `findIntentsByContext`, `raiseIntent` or `raiseIntentForContext` methods on the DesktopAgent (`fdc3`). */
8070
8086
  var ResolveError;
@@ -8085,10 +8101,14 @@
8085
8101
  ResolveError["IntentDeliveryFailed"] = "IntentDeliveryFailed";
8086
8102
  /** Returned if a call to one of the `raiseIntent` functions is made with an invalid context argument. Contexts should be Objects with at least a `type` field that has a `string` value.*/
8087
8103
  ResolveError["MalformedContext"] = "MalformedContext";
8104
+ /** Returned if `fdc3.addIntentListener` is called for a specified intent that the application has already added a listener for and has not subsequently removed it. */
8105
+ ResolveError["IntentListenerConflict"] = "IntentListenerConflict";
8088
8106
  /** @experimental Returned if the specified Desktop Agent is not found, via a connected Desktop Agent Bridge.*/
8089
8107
  ResolveError["DesktopAgentNotFound"] = "DesktopAgentNotFound";
8090
8108
  /** Returned if a timeout occurs before the API call is resolved for any reason other than the resolver timing out (use ResolverTimeout) or an app launched by a raiseIntent function doesn't add its intent listener in time (use IntentDeliveryFailed).*/
8091
8109
  ResolveError["ApiTimeout"] = "ApiTimeout";
8110
+ /** Returned when incorrect arguments are passed to API calls.*/
8111
+ ResolveError["InvalidArguments"] = "InvalidArguments";
8092
8112
  })(ResolveError || (ResolveError = {}));
8093
8113
  var ResultError;
8094
8114
  (function (ResultError) {
@@ -8111,6 +8131,8 @@
8111
8131
  ChannelError["MalformedContext"] = "MalformedContext";
8112
8132
  /** Returned if a timeout occurs before any Channel related API call is resolved.*/
8113
8133
  ChannelError["ApiTimeout"] = "ApiTimeout";
8134
+ /** Returned when incorrect arguments are passed to API calls.*/
8135
+ ChannelError["InvalidArguments"] = "InvalidArguments";
8114
8136
  })(ChannelError || (ChannelError = {}));
8115
8137
  var BridgingError;
8116
8138
  (function (BridgingError) {
@@ -8163,7 +8185,7 @@
8163
8185
  */
8164
8186
  const exhaustiveStringTuple = () => (...tuple) => tuple;
8165
8187
 
8166
- const STANDARD_CONTEXT_TYPES = exhaustiveStringTuple()('fdc3.action', 'fdc3.chart', 'fdc3.chat.initSettings', 'fdc3.chat.message', 'fdc3.chat.room', 'fdc3.chat.searchCriteria', 'fdc3.contact', 'fdc3.contactList', 'fdc3.country', 'fdc3.currency', 'fdc3.email', 'fdc3.instrument', 'fdc3.instrumentList', 'fdc3.interaction', 'fdc3.message', 'fdc3.organization', 'fdc3.portfolio', 'fdc3.position', 'fdc3.nothing', 'fdc3.timeRange', 'fdc3.transactionResult', 'fdc3.valuation');
8188
+ const STANDARD_CONTEXT_TYPES = exhaustiveStringTuple()('fdc3.action', 'fdc3.chart', 'fdc3.chat.initSettings', 'fdc3.chat.message', 'fdc3.chat.room', 'fdc3.chat.searchCriteria', 'fdc3.contact', 'fdc3.contactList', 'fdc3.country', 'fdc3.currency', 'fdc3.email', 'fdc3.fileAttachment', 'fdc3.instrument', 'fdc3.instrumentList', 'fdc3.interaction', 'fdc3.message', 'fdc3.nothing', 'fdc3.organization', 'fdc3.portfolio', 'fdc3.position', 'fdc3.timeRange', 'fdc3.transactionResult', 'fdc3.valuation');
8167
8189
  // used internally to check if a given intent/context is a standard one
8168
8190
  new Set(STANDARD_CONTEXT_TYPES);
8169
8191
 
@@ -8180,23 +8202,32 @@
8180
8202
  */
8181
8203
  var ContextTypes;
8182
8204
  (function (ContextTypes) {
8205
+ ContextTypes["Action"] = "fdc3.action";
8183
8206
  ContextTypes["Chart"] = "fdc3.chart";
8184
8207
  ContextTypes["ChatInitSettings"] = "fdc3.chat.initSettings";
8208
+ ContextTypes["ChatMessage"] = "fdc3.chat.message";
8185
8209
  ContextTypes["ChatRoom"] = "fdc3.chat.room";
8210
+ ContextTypes["ChatSearchCriteria"] = "fdc3.chat.searchCriteria";
8186
8211
  ContextTypes["Contact"] = "fdc3.contact";
8187
8212
  ContextTypes["ContactList"] = "fdc3.contactList";
8188
8213
  ContextTypes["Country"] = "fdc3.country";
8189
8214
  ContextTypes["Currency"] = "fdc3.currency";
8190
8215
  ContextTypes["Email"] = "fdc3.email";
8216
+ ContextTypes["FileAttachment"] = "fdc3.fileAttachment";
8191
8217
  ContextTypes["Instrument"] = "fdc3.instrument";
8192
8218
  ContextTypes["InstrumentList"] = "fdc3.instrumentList";
8193
8219
  ContextTypes["Interaction"] = "fdc3.interaction";
8220
+ ContextTypes["Message"] = "fdc3.message";
8194
8221
  ContextTypes["Nothing"] = "fdc3.nothing";
8222
+ ContextTypes["Order"] = "fdc3.order";
8223
+ ContextTypes["OrderList"] = "fdc3.orderList";
8195
8224
  ContextTypes["Organization"] = "fdc3.organization";
8196
8225
  ContextTypes["Portfolio"] = "fdc3.portfolio";
8197
8226
  ContextTypes["Position"] = "fdc3.position";
8198
- ContextTypes["ChatSearchCriteria"] = "fdc3.chat.searchCriteria";
8227
+ ContextTypes["Product"] = "fdc3.product";
8199
8228
  ContextTypes["TimeRange"] = "fdc3.timeRange";
8229
+ ContextTypes["Trade"] = "fdc3.trade";
8230
+ ContextTypes["TradeList"] = "fdc3.tradeList";
8200
8231
  ContextTypes["TransactionResult"] = "fdc3.transactionResult";
8201
8232
  ContextTypes["Valuation"] = "fdc3.valuation";
8202
8233
  })(ContextTypes || (ContextTypes = {}));
@@ -10359,7 +10390,7 @@
10359
10390
  if (!contextType) {
10360
10391
  return ioChannel.data.fdc3 || null;
10361
10392
  }
10362
- if (contextType && ioChannel.data.fdc3?.type === contextType) {
10393
+ if (ioChannel.data.fdc3?.type === contextType) {
10363
10394
  return ioChannel.data.fdc3;
10364
10395
  }
10365
10396
  const ioChannelContextName = this.parser.mapChannelNameToContextName(ioChannelName);
@@ -10582,7 +10613,7 @@
10582
10613
  return ioc.fdc3;
10583
10614
  };
10584
10615
 
10585
- var version = "2.9.0";
10616
+ var version = "2.11.0-beta.0";
10586
10617
 
10587
10618
  const inNodeEnv = checkIfInNodeEnv();
10588
10619
  const globalScope = inNodeEnv ? process : window;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interopio/fdc3",
3
- "version": "2.9.0",
3
+ "version": "2.11.0-beta.0",
4
4
  "description": "IO Connect implementation of the FDC3 standard",
5
5
  "main": "dist/fdc3.umd.js",
6
6
  "module": "dist/fdc3.es.js",
@@ -31,15 +31,15 @@
31
31
  },
32
32
  "license": "MIT",
33
33
  "devDependencies": {
34
- "@interopio/browser": "^4.3.0",
35
- "@interopio/utils": "^2.3.0"
34
+ "@interopio/browser": "^4.5.0-beta.0",
35
+ "@interopio/utils": "^2.5.0-beta.0"
36
36
  },
37
37
  "dependencies": {
38
- "@finos/fdc3": "^2.2.0"
38
+ "@finos/fdc3": "^2.2.3"
39
39
  },
40
40
  "publishConfig": {
41
41
  "@interopio:registry": "https://registry.npmjs.org",
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "41c6ecb07b59a228eecc8597d7bd4862a0c1dfa0"
44
+ "gitHead": "3d731cc0a6305927219d5f180a808da731e3e95b"
45
45
  }