@interopio/desktop 6.0.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/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@interopio/desktop",
3
+ "description": "JavaScript library for io.Connect Desktop clients.",
4
+ "version": "6.0.0",
5
+ "main": "dist/desktop.umd.js",
6
+ "module": "dist/desktop.es.js",
7
+ "browser": "dist/desktop.browser.js",
8
+ "types": "./desktop.d.ts",
9
+ "homepage": "https://interop.io/",
10
+ "keywords": [
11
+ "glue",
12
+ "glue42",
13
+ "desktop",
14
+ "interop",
15
+ "context"
16
+ ],
17
+ "scripts": {
18
+ "eslint": "eslint -c .eslintrc.js ./src/**/*.ts ./desktop.d.ts",
19
+ "eslint:fix": "eslint --fix -c .eslintrc.js ./src/**/*.ts",
20
+ "validate-changelog": "node ./build/validate-config.js",
21
+ "docs": "typedoc --options typedoc.json ./src",
22
+ "auditPackage": "npm audit --registry=https://registry.npmjs.com",
23
+ "postinstall": "npm i @interopio/workspaces-api@latest",
24
+ "prepublishOnly": "npm i && npm run validate-changelog && npm run auditPackage && npm run test && npm run build",
25
+ "test": "npm run build:tests && mocha ./tests/ --recursive --exit",
26
+ "test:only": "mocha ./tests/ --recursive --exit",
27
+ "publish:beta": "npm publish --tag beta",
28
+ "prebuild": "npm run eslint && tsc -p ./tsconfig.json",
29
+ "build": "npm run prebuild && rollup -c",
30
+ "build:gd": "npm run prebuild && rollup --config rollup.config.gd.js",
31
+ "build:tests": "tsc -p ./tsconfig.test.json"
32
+ },
33
+ "author": {
34
+ "name": "interop.io",
35
+ "url": "https://interop.io/"
36
+ },
37
+ "license": "MIT",
38
+ "dependencies": {
39
+ "@glue42/schemas": "^3.22.0",
40
+ "@interopio/core": "^6.0.2",
41
+ "@interopio/workspaces-api": "^3.0.2",
42
+ "callback-registry": "^2.7.1",
43
+ "shortid": "2.2.8"
44
+ },
45
+ "devDependencies": {
46
+ "@glue42/gateway-ws": "^3.0.13-beta.3",
47
+ "@rollup/plugin-replace": "^2.3.4",
48
+ "@types/chai": "^4.2.9",
49
+ "@types/json-stable-stringify": "1.0.32",
50
+ "@types/mocha": "5.2.7",
51
+ "@types/node": "12.11.1",
52
+ "@types/shortid": "0.0.29",
53
+ "@typescript-eslint/eslint-plugin": "^5.60.1",
54
+ "@typescript-eslint/parser": "^5.60.1",
55
+ "chai": "4.1.0",
56
+ "eslint": "^8.43.0",
57
+ "eslint-plugin-jsdoc": "^46.4.0",
58
+ "eslint-plugin-prefer-arrow": "^1.2.3",
59
+ "husky": "^8.0.3",
60
+ "mocha": "^9.1.3",
61
+ "rollup": "^2.79.1",
62
+ "rollup-plugin-commonjs": "^10.1.0",
63
+ "rollup-plugin-json": "^4.0.0",
64
+ "rollup-plugin-node-resolve": "^5.2.0",
65
+ "rollup-plugin-terser": "^7.0.2",
66
+ "rollup-plugin-typescript2": "^0.23.0",
67
+ "typescript": "^4.9.5"
68
+ },
69
+ "husky": {
70
+ "hooks": {
71
+ "pre-commit": "npm run build"
72
+ }
73
+ }
74
+ }
package/readme.md ADDED
@@ -0,0 +1,56 @@
1
+ # io.Connect Desktop JavaScript Library
2
+
3
+ The [`@interopio/desktop`](https://www.npmjs.com/package/@interopio/desktop)` library enables web apps to participate in **io.Connect Desktop** and use io.Connect functionalities via a set of APIs.
4
+
5
+ ## Features
6
+
7
+ The io.Connect Desktop library includes the following APIs:
8
+
9
+ - App Management API - manage and monitor interop-enabled apps and their instances;
10
+ - App Preferences API - store custom user-specific data and retrieve it when necessary;
11
+ - Intents API - raise requests for other apps to handle predefined actions (Intents), register apps as Intent handlers, provide users programmatically with options for handling raised Intents via the Intents Resolver UI app;
12
+ - Data sharing:
13
+ - Shared Contexts API - create, update and track named data objects shared by all interop-enabled apps;
14
+ - Channels API - globally accessed named shared contexts that allow users to dynamically group apps from an UI, instructing them to work over the same shared data object;
15
+ - Interop API - offer and consume functionality from other interop-enabled apps by registering Interop methods and streams;
16
+ - Pub/Sub API - basic API that allows apps to publish and subscribe for messages on a specific topic;
17
+ - Windows:
18
+ - Window Management API - create and manipulate various types of io.Connect windows;
19
+ - Layouts API - save and restore the arrangement of any set of apps running in io.Connect Desktop;
20
+ - Themes API - control the available io.Connect themes programmatically;
21
+ - Notifications API - raise notifications, handle notification and action clicks via Interop methods, control the Notification Panel and subscribe for notification events;
22
+ - Metrics API - assess the life cycle of a certain process (app performance, business process, employee productivity, and more) by acquiring, recording and monitoring specific data over time;
23
+ - Hotkeys API - register key combinations and receive notifications when a key combination is pressed by the user, regardless of whether the app is on focus or not;
24
+ - Displays API - capture programmatically screenshots of the available monitors, of windows and window groups;
25
+ - Cookies API - enables web apps to manage cookies;
26
+
27
+ For more information, see the **io.Connect Desktop** [documentation](https://docs.interop.io/desktop/).
28
+
29
+ ## Usage
30
+
31
+ The [`@interopio/desktop`](https://www.npmjs.com/package/@interopio/desktop) library attaches a factory function called `IODesktop()` to the global `window` object. Call the factory function to initialize the library and access the io.Connect functionalities from the returned API object:
32
+
33
+ ```javascript
34
+ import IODesktop from "@interopio/desktop";
35
+
36
+ const io = await IODesktop();
37
+ ```
38
+
39
+ Optionally, provide a configuration object for the library initialization. The following example demonstrates enabling the Channels API, which is disabled by default, and additionally initializing the io.Connect Workspaces API:
40
+
41
+ ```javascript
42
+ import IODesktop from "@interopio/desktop";
43
+ import IOWorkspaces from "@interopio/workspaces-api";
44
+
45
+ const config = {
46
+ channels: true,
47
+ libraries: [IOWorkspaces]
48
+ };
49
+
50
+ const io = await IODesktop(config);
51
+
52
+ // Accessing the io.Connect APIs.
53
+ const allChannelNames = await io.channels.all();
54
+
55
+ await io.workspaces.restoreWorkspace("My Workspace");
56
+ ```