@interopio/fdc3 2.8.5 → 2.10.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/README.md CHANGED
@@ -1,13 +1,93 @@
1
- # IO Connect FDC3
1
+ # @interopio/fdc3
2
2
 
3
- IO Connect FDC3 is a JavaScript implementation of the [FDC3](https://fdc3.finos.org/docs/1.1/fdc3-intro) standard for [IO Connect Browser](https://core-docs.glue42.com/getting-started/what-is-glue42-core/index.html) and [IO Connect Desktop](https://docs.glue42.com/getting-started/what-is-glue42/general-overview/index.html).
3
+ ## Overview
4
4
 
5
- ## What is FDC3?
5
+ The [`@interopio/fdc3`](https://www.npmjs.com/package/@interopio/fdc3) library is a JavaScript implementation of the [FDC3](https://fdc3.finos.org/docs/fdc3-intro) standard that is designed to be used by client apps running in **io.Connect Desktop** and **io.Connect Browser Platform**/**io.Connect Browser Client** projects.
6
6
 
7
- The mission of FDC3 is to develop specific protocols and classifications to advance the ability of desktop applications in financial workflows to interoperate in a plug-and-play fashion without prior bilateral agreements.
7
+ ## Installation
8
8
 
9
- ## Useful Links
9
+ To install the library, execute the following command:
10
10
 
11
- You can find the FDC3 specification [here](https://fdc3.finos.org/).
11
+ ```cmd
12
+ npm install @interopio/fdc3
13
+ ```
12
14
 
13
- You can find more information on the IO Connect FDC3 library [here](https://core-docs.glue42.com/getting-started/fdc3-compliance/index.html).
15
+ ## Usage
16
+
17
+ The following examples demonstrate how to initialize the `@interopio/fdc3` library in **io.Connect Desktop** and **io.Connect Browser** projects.
18
+
19
+ > ℹ️ *For more details on the specifics of using the `@interopio/fdc3` library in your interop-enabled apps, see the **io.Connect Desktop** [official documentation](https://docs.interop.io/desktop/getting-started/fdc3-compliance/index.html) and the **io.Connect Browser** [official documentation](https://docs.interop.io/browser/getting-started/fdc3-compliance/index.html).*
20
+
21
+ > ℹ️ *For more details on the FDC3 standard and using the FDC3 API, see the [official FDC3 documentation](https://fdc3.finos.org/docs/fdc3-intro).*
22
+
23
+ ### io.Connect Desktop
24
+
25
+ Initializing the `@interopio/fdc3` library in a client app of an **io.Connect Desktop** project:
26
+
27
+ ```javascript
28
+ import IODesktop from "@interopio/desktop";
29
+ import "@interopio/fdc3";
30
+
31
+ const config = {
32
+ // This is necessary in order to use the FDC3 User Channels.
33
+ channels: true
34
+ };
35
+
36
+ const io = await IODesktop(config);
37
+ ```
38
+
39
+ ### io.Connect Browser
40
+
41
+ Initializing the `@interopio/fdc3` library of an **io.Connect Browser Platform** project:
42
+
43
+ ```javascript
44
+ import IOBrowserPlatform from "@interopio/browser-platform";
45
+ import "@interopio/fdc3";
46
+
47
+ // Defining io.Connect Channels and mapping them to the FDC3 User Channels.
48
+ // You can define as many io.Connect Channels as you need and map them
49
+ // to the default FDC3 User Channels if you want to use them as such.
50
+ const channels = {
51
+ definitions: [
52
+     {
53
+         name: "Red",
54
+         meta: {
55
+             color: "red",
56
+             fdc3: {
57
+                 id: "fdc3.channel.1",
58
+                 displayMetadata: {
59
+                   name: "Channel 1",
60
+                   glyph: "1"
61
+                 }
62
+             }
63
+         }
64
+     }
65
+ ]
66
+ };
67
+
68
+ const config = {
69
+ licenseKey: "my-license-key",
70
+ channels
71
+ };
72
+
73
+ const { io } = await IOBrowserPlatform(config);
74
+
75
+ // The FDC3 API will now be available as an `fdc3` object injected in the global `window` object.
76
+ const info = await fdc3.getInfo();
77
+
78
+ console.log(`FDC3 provider: ${info.provider}, FDC3 version: ${info.fdc3Version}`);
79
+ ```
80
+
81
+ Initializing the `@interopio/fdc3` library in a Browser Client app of an **io.Connect Browser** project:
82
+
83
+ ```javascript
84
+ import IOBrowser from "@interopio/browser";
85
+ import "@interopio/fdc3";
86
+
87
+ const io = await IOBrowser();
88
+
89
+ // The FDC3 API will now be available as an `fdc3` object injected in the global `window` object.
90
+ const info = await fdc3.getInfo();
91
+
92
+ console.log(`FDC3 provider: ${info.provider}, FDC3 version: ${info.fdc3Version}`);
93
+ ```
package/changelog.md CHANGED
@@ -1,3 +1,7 @@
1
+ 2.10.0
2
+ feat: io.Connect Browser 4.4
3
+ 2.9.0
4
+ feat: io.Connect Browser 4.3
1
5
  2.8.3
2
6
  fix: G4E-10370 fix FDC3 environment check for running in node or web
3
7
  2.8.0
@@ -5007,6 +5007,15 @@ const nonNegativeNumberDecoder = number$1().where((num) => num >= 0, "Expected a
5007
5007
  const regexDecoder = anyJson$1().andThen((value) => {
5008
5008
  return value instanceof RegExp ? anyJson$1() : fail(`expected a regex, got a ${typeof value}`);
5009
5009
  });
5010
+ const urlDecoder = nonEmptyStringDecoder$1.andThen((url) => {
5011
+ try {
5012
+ new URL(url);
5013
+ return nonEmptyStringDecoder$1;
5014
+ }
5015
+ catch {
5016
+ return fail("Should be a valid URL");
5017
+ }
5018
+ });
5010
5019
 
5011
5020
  const intentDefinitionDecoder = object$1({
5012
5021
  name: nonEmptyStringDecoder$1,
@@ -5334,7 +5343,8 @@ const decoders$1 = {
5334
5343
  common: {
5335
5344
  nonEmptyStringDecoder: nonEmptyStringDecoder$1,
5336
5345
  nonNegativeNumberDecoder,
5337
- regexDecoder
5346
+ regexDecoder,
5347
+ urlDecoder
5338
5348
  },
5339
5349
  fdc3: {
5340
5350
  allDefinitionsDecoder,
@@ -8731,7 +8741,7 @@ class IntentsController {
8731
8741
  if (!appHandlersWithAppId.length) {
8732
8742
  throw new Error(ResolveError.TargetAppUnavailable);
8733
8743
  }
8734
- const appHandlersWithContextType = appHandlersWithAppId.filter((handler) => !handler.instanceId && handler.contextTypes?.includes(context.type));
8744
+ const appHandlersWithContextType = this.getGlueIntentWithFilteredHandlers({ name: searchedGlueIntent.name, handlers: appHandlersWithAppId }, { contextType: glueContext.type }).handlers;
8735
8745
  if (!appHandlersWithContextType.length) {
8736
8746
  throw new Error(ResolveError.NoAppsFound);
8737
8747
  }
@@ -10354,7 +10364,7 @@ class NewDataWrappingChannelsController {
10354
10364
  if (!contextType) {
10355
10365
  return ioChannel.data.fdc3 || null;
10356
10366
  }
10357
- if (contextType && ioChannel.data.fdc3?.type === contextType) {
10367
+ if (ioChannel.data.fdc3?.type === contextType) {
10358
10368
  return ioChannel.data.fdc3;
10359
10369
  }
10360
10370
  const ioChannelContextName = this.parser.mapChannelNameToContextName(ioChannelName);
@@ -10577,7 +10587,7 @@ const fdc3Factory = () => {
10577
10587
  return ioc.fdc3;
10578
10588
  };
10579
10589
 
10580
- var version = "2.8.5";
10590
+ var version = "2.10.0";
10581
10591
 
10582
10592
  const inNodeEnv = checkIfInNodeEnv();
10583
10593
  const globalScope = inNodeEnv ? process : window;
@@ -10595,7 +10605,7 @@ if (typeof globalFdc3 === "undefined") {
10595
10605
  else {
10596
10606
  console.warn("Defaulting to using the auto-injected fdc3.");
10597
10607
  }
10598
- var globalFdc3$1 = globalFdc3;
10608
+ var globalFdc3_default = globalFdc3;
10599
10609
 
10600
- export { globalFdc3$1 as default };
10610
+ export { globalFdc3_default as default };
10601
10611
  //# sourceMappingURL=fdc3.electron.es.js.map
@@ -4156,11 +4156,11 @@
4156
4156
  return true;
4157
4157
  }
4158
4158
 
4159
- var deepEqual = function deepEqual(a, b, opts) {
4159
+ var deepEqual$1 = function deepEqual(a, b, opts) {
4160
4160
  return internalDeepEqual(a, b, opts, getSideChannel());
4161
4161
  };
4162
4162
 
4163
- var deepEqual$1 = /*@__PURE__*/getDefaultExportFromCjs(deepEqual);
4163
+ var deepEqual = /*@__PURE__*/getDefaultExportFromCjs(deepEqual$1);
4164
4164
 
4165
4165
  /* @ts-self-types="./index.d.ts" */
4166
4166
  let urlAlphabet =
@@ -5013,6 +5013,15 @@
5013
5013
  const regexDecoder = anyJson$1().andThen((value) => {
5014
5014
  return value instanceof RegExp ? anyJson$1() : fail(`expected a regex, got a ${typeof value}`);
5015
5015
  });
5016
+ const urlDecoder = nonEmptyStringDecoder$1.andThen((url) => {
5017
+ try {
5018
+ new URL(url);
5019
+ return nonEmptyStringDecoder$1;
5020
+ }
5021
+ catch {
5022
+ return fail("Should be a valid URL");
5023
+ }
5024
+ });
5016
5025
 
5017
5026
  const intentDefinitionDecoder = object$1({
5018
5027
  name: nonEmptyStringDecoder$1,
@@ -5340,7 +5349,8 @@
5340
5349
  common: {
5341
5350
  nonEmptyStringDecoder: nonEmptyStringDecoder$1,
5342
5351
  nonNegativeNumberDecoder,
5343
- regexDecoder
5352
+ regexDecoder,
5353
+ urlDecoder
5344
5354
  },
5345
5355
  fdc3: {
5346
5356
  allDefinitionsDecoder,
@@ -6554,7 +6564,7 @@
6554
6564
  prevContext = data.fdc3;
6555
6565
  return;
6556
6566
  }
6557
- if (prevContext && deepEqual$1(prevContext, data.fdc3, { strict: true })) {
6567
+ if (prevContext && deepEqual(prevContext, data.fdc3, { strict: true })) {
6558
6568
  return;
6559
6569
  }
6560
6570
  callback(data.fdc3, this.getContextMetadata(updaterId), channelId);
@@ -8737,7 +8747,7 @@
8737
8747
  if (!appHandlersWithAppId.length) {
8738
8748
  throw new Error(ResolveError.TargetAppUnavailable);
8739
8749
  }
8740
- const appHandlersWithContextType = appHandlersWithAppId.filter((handler) => !handler.instanceId && handler.contextTypes?.includes(context.type));
8750
+ const appHandlersWithContextType = this.getGlueIntentWithFilteredHandlers({ name: searchedGlueIntent.name, handlers: appHandlersWithAppId }, { contextType: glueContext.type }).handlers;
8741
8751
  if (!appHandlersWithContextType.length) {
8742
8752
  throw new Error(ResolveError.NoAppsFound);
8743
8753
  }
@@ -10360,7 +10370,7 @@
10360
10370
  if (!contextType) {
10361
10371
  return ioChannel.data.fdc3 || null;
10362
10372
  }
10363
- if (contextType && ioChannel.data.fdc3?.type === contextType) {
10373
+ if (ioChannel.data.fdc3?.type === contextType) {
10364
10374
  return ioChannel.data.fdc3;
10365
10375
  }
10366
10376
  const ioChannelContextName = this.parser.mapChannelNameToContextName(ioChannelName);
@@ -10583,7 +10593,7 @@
10583
10593
  return ioc.fdc3;
10584
10594
  };
10585
10595
 
10586
- var version = "2.8.5";
10596
+ var version = "2.10.0";
10587
10597
 
10588
10598
  const inNodeEnv = checkIfInNodeEnv();
10589
10599
  const globalScope = inNodeEnv ? process : window;
@@ -10601,9 +10611,9 @@
10601
10611
  else {
10602
10612
  console.warn("Defaulting to using the auto-injected fdc3.");
10603
10613
  }
10604
- var globalFdc3$1 = globalFdc3;
10614
+ var globalFdc3_default = globalFdc3;
10605
10615
 
10606
- return globalFdc3$1;
10616
+ return globalFdc3_default;
10607
10617
 
10608
10618
  }));
10609
10619
  //# sourceMappingURL=fdc3.electron.umd.js.map
package/dist/fdc3.es.js CHANGED
@@ -4150,11 +4150,11 @@ function objEquiv(a, b, opts, channel) {
4150
4150
  return true;
4151
4151
  }
4152
4152
 
4153
- var deepEqual = function deepEqual(a, b, opts) {
4153
+ var deepEqual$1 = function deepEqual(a, b, opts) {
4154
4154
  return internalDeepEqual(a, b, opts, getSideChannel());
4155
4155
  };
4156
4156
 
4157
- var deepEqual$1 = /*@__PURE__*/getDefaultExportFromCjs(deepEqual);
4157
+ var deepEqual = /*@__PURE__*/getDefaultExportFromCjs(deepEqual$1);
4158
4158
 
4159
4159
  /* @ts-self-types="./index.d.ts" */
4160
4160
  let urlAlphabet =
@@ -4996,6 +4996,15 @@ const nonNegativeNumberDecoder = number$1().where((num) => num >= 0, "Expected a
4996
4996
  const regexDecoder = anyJson$1().andThen((value) => {
4997
4997
  return value instanceof RegExp ? anyJson$1() : fail(`expected a regex, got a ${typeof value}`);
4998
4998
  });
4999
+ const urlDecoder = nonEmptyStringDecoder$1.andThen((url) => {
5000
+ try {
5001
+ new URL(url);
5002
+ return nonEmptyStringDecoder$1;
5003
+ }
5004
+ catch {
5005
+ return fail("Should be a valid URL");
5006
+ }
5007
+ });
4999
5008
 
5000
5009
  const intentDefinitionDecoder = object$1({
5001
5010
  name: nonEmptyStringDecoder$1,
@@ -5323,7 +5332,8 @@ const decoders$1 = {
5323
5332
  common: {
5324
5333
  nonEmptyStringDecoder: nonEmptyStringDecoder$1,
5325
5334
  nonNegativeNumberDecoder,
5326
- regexDecoder
5335
+ regexDecoder,
5336
+ urlDecoder
5327
5337
  },
5328
5338
  fdc3: {
5329
5339
  allDefinitionsDecoder,
@@ -6537,7 +6547,7 @@ class GlueController {
6537
6547
  prevContext = data.fdc3;
6538
6548
  return;
6539
6549
  }
6540
- if (prevContext && deepEqual$1(prevContext, data.fdc3, { strict: true })) {
6550
+ if (prevContext && deepEqual(prevContext, data.fdc3, { strict: true })) {
6541
6551
  return;
6542
6552
  }
6543
6553
  callback(data.fdc3, this.getContextMetadata(updaterId), channelId);
@@ -8720,7 +8730,7 @@ class IntentsController {
8720
8730
  if (!appHandlersWithAppId.length) {
8721
8731
  throw new Error(ResolveError.TargetAppUnavailable);
8722
8732
  }
8723
- const appHandlersWithContextType = appHandlersWithAppId.filter((handler) => !handler.instanceId && handler.contextTypes?.includes(context.type));
8733
+ const appHandlersWithContextType = this.getGlueIntentWithFilteredHandlers({ name: searchedGlueIntent.name, handlers: appHandlersWithAppId }, { contextType: glueContext.type }).handlers;
8724
8734
  if (!appHandlersWithContextType.length) {
8725
8735
  throw new Error(ResolveError.NoAppsFound);
8726
8736
  }
@@ -10343,7 +10353,7 @@ class NewDataWrappingChannelsController {
10343
10353
  if (!contextType) {
10344
10354
  return ioChannel.data.fdc3 || null;
10345
10355
  }
10346
- if (contextType && ioChannel.data.fdc3?.type === contextType) {
10356
+ if (ioChannel.data.fdc3?.type === contextType) {
10347
10357
  return ioChannel.data.fdc3;
10348
10358
  }
10349
10359
  const ioChannelContextName = this.parser.mapChannelNameToContextName(ioChannelName);
@@ -10566,7 +10576,7 @@ const fdc3Factory = () => {
10566
10576
  return ioc.fdc3;
10567
10577
  };
10568
10578
 
10569
- var version = "2.8.5";
10579
+ var version = "2.10.0";
10570
10580
 
10571
10581
  const inNodeEnv = checkIfInNodeEnv();
10572
10582
  const globalScope = inNodeEnv ? process : window;
@@ -10583,7 +10593,7 @@ if (typeof globalFdc3 === "undefined") {
10583
10593
  else {
10584
10594
  console.warn("Defaulting to using the auto-injected fdc3.");
10585
10595
  }
10586
- var globalFdc3$1 = globalFdc3;
10596
+ var globalFdc3_default = globalFdc3;
10587
10597
 
10588
- export { globalFdc3$1 as default };
10598
+ export { globalFdc3_default as default };
10589
10599
  //# sourceMappingURL=fdc3.es.js.map
package/dist/fdc3.umd.js CHANGED
@@ -5002,6 +5002,15 @@
5002
5002
  const regexDecoder = anyJson$1().andThen((value) => {
5003
5003
  return value instanceof RegExp ? anyJson$1() : fail(`expected a regex, got a ${typeof value}`);
5004
5004
  });
5005
+ const urlDecoder = nonEmptyStringDecoder$1.andThen((url) => {
5006
+ try {
5007
+ new URL(url);
5008
+ return nonEmptyStringDecoder$1;
5009
+ }
5010
+ catch {
5011
+ return fail("Should be a valid URL");
5012
+ }
5013
+ });
5005
5014
 
5006
5015
  const intentDefinitionDecoder = object$1({
5007
5016
  name: nonEmptyStringDecoder$1,
@@ -5329,7 +5338,8 @@
5329
5338
  common: {
5330
5339
  nonEmptyStringDecoder: nonEmptyStringDecoder$1,
5331
5340
  nonNegativeNumberDecoder,
5332
- regexDecoder
5341
+ regexDecoder,
5342
+ urlDecoder
5333
5343
  },
5334
5344
  fdc3: {
5335
5345
  allDefinitionsDecoder,
@@ -8726,7 +8736,7 @@
8726
8736
  if (!appHandlersWithAppId.length) {
8727
8737
  throw new Error(ResolveError.TargetAppUnavailable);
8728
8738
  }
8729
- const appHandlersWithContextType = appHandlersWithAppId.filter((handler) => !handler.instanceId && handler.contextTypes?.includes(context.type));
8739
+ const appHandlersWithContextType = this.getGlueIntentWithFilteredHandlers({ name: searchedGlueIntent.name, handlers: appHandlersWithAppId }, { contextType: glueContext.type }).handlers;
8730
8740
  if (!appHandlersWithContextType.length) {
8731
8741
  throw new Error(ResolveError.NoAppsFound);
8732
8742
  }
@@ -10349,7 +10359,7 @@
10349
10359
  if (!contextType) {
10350
10360
  return ioChannel.data.fdc3 || null;
10351
10361
  }
10352
- if (contextType && ioChannel.data.fdc3?.type === contextType) {
10362
+ if (ioChannel.data.fdc3?.type === contextType) {
10353
10363
  return ioChannel.data.fdc3;
10354
10364
  }
10355
10365
  const ioChannelContextName = this.parser.mapChannelNameToContextName(ioChannelName);
@@ -10572,7 +10582,7 @@
10572
10582
  return ioc.fdc3;
10573
10583
  };
10574
10584
 
10575
- var version = "2.8.5";
10585
+ var version = "2.10.0";
10576
10586
 
10577
10587
  const inNodeEnv = checkIfInNodeEnv();
10578
10588
  const globalScope = inNodeEnv ? process : window;
@@ -10589,9 +10599,9 @@
10589
10599
  else {
10590
10600
  console.warn("Defaulting to using the auto-injected fdc3.");
10591
10601
  }
10592
- var globalFdc3$1 = globalFdc3;
10602
+ var globalFdc3_default = globalFdc3;
10593
10603
 
10594
- return globalFdc3$1;
10604
+ return globalFdc3_default;
10595
10605
 
10596
10606
  }));
10597
10607
  //# sourceMappingURL=fdc3.umd.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interopio/fdc3",
3
- "version": "2.8.5",
3
+ "version": "2.10.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,9 +31,8 @@
31
31
  },
32
32
  "license": "MIT",
33
33
  "devDependencies": {
34
- "@interopio/browser": "^4.2.5",
35
- "@interopio/desktop": "^6.14.0",
36
- "@interopio/utils": "^2.2.0"
34
+ "@interopio/browser": "^4.4.0",
35
+ "@interopio/utils": "^2.4.0"
37
36
  },
38
37
  "dependencies": {
39
38
  "@finos/fdc3": "^2.2.0"
@@ -42,5 +41,5 @@
42
41
  "@interopio:registry": "https://registry.npmjs.org",
43
42
  "access": "public"
44
43
  },
45
- "gitHead": "efe6743dec87ecae29c638a193031e0520dac1f4"
44
+ "gitHead": "d67c6f498b27f4a11622fa6bc2ff26bf4077af3a"
46
45
  }