@interopio/fdc3 2.8.5 → 2.9.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 +87 -7
- package/changelog.md +2 -0
- package/dist/fdc3.electron.es.js +15 -5
- package/dist/fdc3.electron.umd.js +18 -8
- package/dist/fdc3.es.js +18 -8
- package/dist/fdc3.umd.js +15 -5
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -1,13 +1,93 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @interopio/fdc3
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Overview
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
To install the library, execute the following command:
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
```cmd
|
|
12
|
+
npm install @interopio/fdc3
|
|
13
|
+
```
|
|
12
14
|
|
|
13
|
-
|
|
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
package/dist/fdc3.electron.es.js
CHANGED
|
@@ -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 =
|
|
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
|
}
|
|
@@ -10577,7 +10587,7 @@ const fdc3Factory = () => {
|
|
|
10577
10587
|
return ioc.fdc3;
|
|
10578
10588
|
};
|
|
10579
10589
|
|
|
10580
|
-
var version = "2.
|
|
10590
|
+
var version = "2.9.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
|
|
10608
|
+
var globalFdc3_default = globalFdc3;
|
|
10599
10609
|
|
|
10600
|
-
export {
|
|
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
|
|
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
|
|
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 =
|
|
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
|
}
|
|
@@ -10583,7 +10593,7 @@
|
|
|
10583
10593
|
return ioc.fdc3;
|
|
10584
10594
|
};
|
|
10585
10595
|
|
|
10586
|
-
var version = "2.
|
|
10596
|
+
var version = "2.9.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
|
|
10614
|
+
var globalFdc3_default = globalFdc3;
|
|
10605
10615
|
|
|
10606
|
-
return
|
|
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
|
|
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
|
|
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 =
|
|
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
|
}
|
|
@@ -10566,7 +10576,7 @@ const fdc3Factory = () => {
|
|
|
10566
10576
|
return ioc.fdc3;
|
|
10567
10577
|
};
|
|
10568
10578
|
|
|
10569
|
-
var version = "2.
|
|
10579
|
+
var version = "2.9.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
|
|
10596
|
+
var globalFdc3_default = globalFdc3;
|
|
10587
10597
|
|
|
10588
|
-
export {
|
|
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 =
|
|
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
|
}
|
|
@@ -10572,7 +10582,7 @@
|
|
|
10572
10582
|
return ioc.fdc3;
|
|
10573
10583
|
};
|
|
10574
10584
|
|
|
10575
|
-
var version = "2.
|
|
10585
|
+
var version = "2.9.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
|
|
10602
|
+
var globalFdc3_default = globalFdc3;
|
|
10593
10603
|
|
|
10594
|
-
return
|
|
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.
|
|
3
|
+
"version": "2.9.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.
|
|
35
|
-
"@interopio/
|
|
36
|
-
"@interopio/utils": "^2.2.0"
|
|
34
|
+
"@interopio/browser": "^4.3.0",
|
|
35
|
+
"@interopio/utils": "^2.3.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": "
|
|
44
|
+
"gitHead": "41c6ecb07b59a228eecc8597d7bd4862a0c1dfa0"
|
|
46
45
|
}
|