@openfin/salesforce-lwc 1.1.0 → 1.1.1

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,50 +1,31 @@
1
1
  # Salesforce Integration for Lightning Web Components
2
2
 
3
- ## Overview
3
+ Access OpenFin’s [Container APIs](https://developers.openfin.co/of-docs/docs/container-overview) from custom [Salesforce components](https://developer.salesforce.com/docs/component-library/documentation/en/lwc).
4
4
 
5
- OpenFin’s Salesforce integration enables developers to create a two-way connection between [OpenFin Container](https://developers.openfin.co/of-docs/docs/container-overview) and [Salesforce](https://www.salesforce.com/). The integration consists of the following NPM packages:
5
+ _Alternatively, when calling Salesforce’s REST APIs directly from OpenFin apps, use the [@openfin/salesforce](https://www.npmjs.com/package/@openfin/salesforce) package._
6
6
 
7
- - [@openfin/salesforce-lwc](https://www.npmjs.com/package/@openfin/salesforce-lwc): Connect custom Salesforce components with OpenFin Container (this package)
8
- - [@openfin/salesforce](https://www.npmjs.com/package/@openfin/salesforce): Connect OpenFin Container with Salesforce
7
+ ## Install
9
8
 
10
- Running Salesforce in OpenFin is a popular requirement, with developers naturally wanting to take advantage of the extensive APIs provided by both Salesforce and OpenFin. However, Salesforce’s [Lightning Locker](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/security_code.htm) security feature restricts access to all non-core web APIs including those provided by [OpenFin Container](https://developers.openfin.co/of-docs/docs/container-overview).
9
+ With npm:
11
10
 
12
- To enable interoperability, OpenFin and Salesforce worked together to find a solution that enables custom Salesforce components to access OpenFin APIs and use them just like any other app. The result of this collaboration is the Salesforce integration for Lightning web components, which is supported by Salesforce for current and future versions of Lightning Locker.
11
+ > npm -i @openfin/salesforce-lwc
13
12
 
14
- ## Code example
13
+ With yarn:
15
14
 
16
- Below is an example of a custom Lightning web component loading the Salesforce integration for Lightning web components as a static resource in order to access the OpenFin API:
15
+ > yarn add @openfin/salesforce-lwc
17
16
 
18
- ```ts
19
- // myComponent.js
17
+ ## Usage and more information
20
18
 
21
- import api from '@salesforce/resourceUrl/openfin_salesforce_lwc';
22
- import { loadScript } from 'lightning/platformResourceLoader';
23
- import { LightningElement } from 'lwc';
19
+ - [Developer guide](https://developers.openfin.co/of-docs/docs/salesforce-integration)
20
+ - [API reference](https://cdn.openfin.co/docs/integrations/salesforce)
24
21
 
25
- export default class OpenfinIntegrationTest extends LightningElement {
26
- async connectedCallback() {
27
- try {
28
- await loadScript(this, finApi);
29
- } catch (err) {
30
- console.warn('Failed to load static resource, has it been added in Salesforce org settings?');
31
- }
22
+ ## License
32
23
 
33
- // Initialize window.fin for use
34
- window.fin.salesforce.initFinApiInLwc();
24
+ Copyright 2021-2022 OpenFin
35
25
 
36
- // Check that the OpenFin API is available before continuing
37
- if (!window.fin.System?.isOpenFinEnvironment()) {
38
- console.warn('OpenFin API not available, exiting');
39
- return;
40
- }
26
+ The code in this package is distributed under the MIT license.
41
27
 
42
- // Output the current OpenFin runtime info to the console
43
- console.log(await window.fin.System.getRuntimeInfo());
44
- }
45
- }
46
- ```
28
+ However, if you run this code, it may call on the OpenFin RVM or OpenFin Runtime, which are covered by OpenFin's Developer, Community, and Enterprise licenses. You can learn more about OpenFin licensing at the links listed below or email us at support@openfin.co with questions.
47
29
 
48
- ## Getting started
49
-
50
- Refer to the [developer documentation](https://developers.openfin.co/of-docs/docs/salesforce-integration) in order to begin using the Salesforce integration, where you will also find additional code examples and the full API reference.
30
+ - [Licensing](https://www.openfin.co/licensing/)
31
+ - [Developer agreement](https://openfin.co/developer-agreement/)
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.fin=n():(e.fin=e.fin||{},e.fin.salesforce=n())}(self,(function(){return(()=>{"use strict";var e={d:(n,o)=>{for(var i in o)e.o(o,i)&&!e.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:o[i]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{initFinApiInLwc:()=>i,prepareFinApiInPreload:()=>o});const o=()=>{void 0!==window.fin&&(CustomEvent.prototype.fin=window.fin,CustomEvent.prototype.fdc3=window.fdc3)},i=()=>{const e=new CustomEvent(""),n=e.fin;if(void 0===n)return void console.warn("Unable to locate fin API. Ensure Salesforce is running in OpenFin and 'prepareFinApiInPreload' is run in a preload script before attempting to call 'initFinApiInLwc'.");void 0!==window.fin?Object.assign(window.fin,n):window.fin=n;const o=e.fdc3;void 0!==window.fdc3?Object.assign(window.fdc3,o):window.fdc3=o};return n})()}));
1
+ !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("fin",[],n):"object"==typeof exports?exports.fin=n():(e.fin=e.fin||{},e.fin.salesforce=n())}(self,(function(){return(()=>{"use strict";var e={d:(n,o)=>{for(var i in o)e.o(o,i)&&!e.o(n,i)&&Object.defineProperty(n,i,{enumerable:!0,get:o[i]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{initFinApiInLwc:()=>i,prepareFinApiInPreload:()=>o});const o=()=>{void 0!==window.fin&&(CustomEvent.prototype.fin=window.fin,CustomEvent.prototype.fdc3=window.fdc3)},i=()=>{const e=new CustomEvent(""),n=e.fin;if(void 0===n)return void console.warn("Unable to locate fin API. Ensure Salesforce is running in OpenFin and 'prepareFinApiInPreload' is run in a preload script before attempting to call 'initFinApiInLwc'.");void 0!==window.fin?Object.assign(window.fin,n):window.fin=n;const o=e.fdc3;void 0!==window.fdc3?Object.assign(window.fdc3,o):window.fdc3=o};return n})()}));
package/package.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
2
  "name": "@openfin/salesforce-lwc",
3
3
  "description": "Connect custom Salesforce components with OpenFin Container",
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "author": "OpenFin Inc.",
6
6
  "homepage": "https://www.openfin.co/",
7
+ "keywords": [
8
+ "openfin",
9
+ "salesforce"
10
+ ],
7
11
  "license": "MIT",
8
12
  "main": "openfin.salesforce-lwc.js",
9
13
  "types": "types/index.d.ts"
package/preload.js CHANGED
@@ -1 +1 @@
1
- !function(e,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.fin=o():(e.fin=e.fin||{},e.fin.salesforce=o())}(self,(function(){return(()=>{"use strict";var e={};return(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e),void 0!==window.fin&&(CustomEvent.prototype.fin=window.fin,CustomEvent.prototype.fdc3=window.fdc3),e})()}));
1
+ (()=>{"use strict";void 0!==window.fin&&(CustomEvent.prototype.fin=window.fin,CustomEvent.prototype.fdc3=window.fdc3)})();
Binary file
package/version.txt DELETED
@@ -1 +0,0 @@
1
- 1.1.0