@openfin/salesforce-lwc 1.1.0 → 1.1.2

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/LICENSE.md CHANGED
@@ -1,21 +1 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 OpenFin Ltd
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ Please refer to the [Developer License](https://www.here.io/developer-agreement/).
package/README.md CHANGED
@@ -1,50 +1,20 @@
1
1
  # Salesforce Integration for Lightning Web Components
2
2
 
3
- ## Overview
3
+ Access [HERE Core](https://resources.here.io/docs/core/) APIs 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 HERE Core 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';
24
-
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
- }
32
-
33
- // Initialize window.fin for use
34
- window.fin.salesforce.initFinApiInLwc();
35
-
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
- }
41
-
42
- // Output the current OpenFin runtime info to the console
43
- console.log(await window.fin.System.getRuntimeInfo());
44
- }
45
- }
46
- ```
47
-
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.
19
+ - [Developer guide](https://resources.here.io/docs/core/integrations/salesforce/)
20
+ - [API reference](https://resources.here.io/docs/integrations/salesforce/)
@@ -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,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define("fin",[],o):"object"==typeof exports?exports.fin=o():(e.fin=e.fin||{},e.fin.salesforce=o())}(self,()=>(()=>{"use strict";const e={d:(o,n)=>{for(var t in n)e.o(n,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:n[t]})},o:(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r:e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let o={};e.r(o),e.d(o,{initFinApiInLwc:()=>t,prepareFinApiInPreload:()=>n});const n=()=>{void 0!==window.fin&&(CustomEvent.prototype.fin=window.fin,CustomEvent.prototype.fdc3=window.fdc3)},t=()=>{const{fdc3:e,fin:o}=new CustomEvent("");void 0!==o&&(void 0!==window.fin?Object.assign(window.fin,o):window.fin=o,void 0!==window.fdc3?Object.assign(window.fdc3,e):window.fdc3=e)};return o})());
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "@openfin/salesforce-lwc",
3
- "description": "Connect custom Salesforce components with OpenFin Container",
4
- "version": "1.1.0",
5
- "author": "OpenFin Inc.",
6
- "homepage": "https://www.openfin.co/",
7
- "license": "MIT",
8
- "main": "openfin.salesforce-lwc.js",
9
- "types": "types/index.d.ts"
3
+ "description": "Access HERE Core APIs from custom Salesforce components",
4
+ "version": "1.1.2",
5
+ "author": "Here Enterprise Inc.",
6
+ "homepage": "https://www.here.io/",
7
+ "keywords": [
8
+ "openfin",
9
+ "salesforce"
10
+ ],
11
+ "license": "SEE LICENSE IN LICENSE.MD",
12
+ "main": "dist/openfin.salesforce-lwc.js",
13
+ "types": "dist/types/index.d.ts"
10
14
  }
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)})();
package/types/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- /**
2
- * Connect custom [Salesforce](https://www.salesforce.com/) components with [OpenFin Container](https://www.openfin.co/container/).
3
- *
4
- * @module @openfin/salesforce-lwc
5
- */
6
- export * from './lwc/lwc';
1
+ /**
2
+ * @module @openfin/salesforce-lwc
3
+ *
4
+ * Please refer to the {@link https://developers.openfin.co/of-docs/docs/salesforce-integration | developer documentation} for additional information and code examples.
5
+ */
6
+ export * from './lwc/lwc';
@@ -1,23 +1,10 @@
1
- /// <reference types="openfin" />
2
- declare global {
3
- interface Window {
4
- fdc3: typeof fdc3;
5
- }
6
- }
7
- /**
8
- * @hidden
9
- */
10
- export declare type CustomFinEvent = CustomEvent & {
11
- fin: typeof fin;
12
- fdc3: typeof fdc3;
13
- };
14
- /**
15
- * Prepares the OpenFin API for use in custom Salesforce components.
16
- *
17
- * Note: This function must be run in a preload script before any Salesforce content is loaded.
18
- */
19
- export declare const prepareFinApiInPreload: () => void;
20
- /**
21
- * Initializes the OpenFin API for use in custom Salesforce components.
22
- */
23
- export declare const initFinApiInLwc: () => void;
1
+ /**
2
+ * Prepares the OpenFin API for use in custom Salesforce components.
3
+ *
4
+ * Note: This function must be run in a preload script before any Salesforce content is loaded.
5
+ */
6
+ export declare const prepareFinApiInPreload: () => void;
7
+ /**
8
+ * Initializes the OpenFin API for use in custom Salesforce components.
9
+ */
10
+ export declare const initFinApiInLwc: () => void;
@@ -0,0 +1,15 @@
1
+ import type { fin } from '@openfin/core';
2
+ /**
3
+ * @internal
4
+ */
5
+ export type CustomFinEvent = CustomEvent & {
6
+ fin: typeof fin;
7
+ fdc3: any;
8
+ };
9
+ /**
10
+ * @internal
11
+ */
12
+ export type FinWindow = typeof window & {
13
+ fdc3?: any;
14
+ fin: typeof fin;
15
+ };
@@ -1 +1 @@
1
- export {};
1
+ export {};
Binary file
package/version.txt DELETED
@@ -1 +0,0 @@
1
- 1.1.0