Skip to content
This repository was archived by the owner on Jan 27, 2024. It is now read-only.

Commit a78a23f

Browse files
committed
update to api 46
update copyright year update jsforce and penpal format json files
1 parent 99ea41e commit a78a23f

22 files changed

+69
-69
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2018, Doug Ayers, douglascayers.com
3+
Copyright (c) 2018-2019, Doug Ayers, douglascayers.com
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Call REST API from Lightning Components without Named Credentials
1+
# Call REST API from Lightning Aura Components without Named Credentials
22

33
A simple [promise-based](https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/js_promises.htm)
44
[service component](https://developer.salesforce.com/blogs/2018/08/implement-and-use-lightning-service-components.html)
55
for working with Salesforce REST API and JavaScript Fetch API
6-
directly from your component's JavaScript without you needing to
6+
directly from your aura component's JavaScript without you needing to
77
write Apex or configure Named Credentials. Just install and use.
88

99
## 📝 Table of Contents
@@ -61,7 +61,7 @@ which is my primary app that uses this component.
6161
6262
## 📘 Example Usage
6363
64-
Add the `<c:lc_api>` to your component and give it an `aura:id` for reference.
64+
Add the `<c:lc_api>` to your aura component and give it an `aura:id` for reference.
6565
6666
```xml
6767
<!-- YourComponent.cmp -->

config/project-scratch-def.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"orgName" : "Lightning API",
3-
"edition" : "Developer",
4-
"features" : [],
5-
"settings" : {
6-
"orgPreferenceSettings" : {
7-
"s1EncryptedStoragePref2" : false
2+
"orgName" : "Lightning API",
3+
"edition" : "Developer",
4+
"features" : [],
5+
"settings" : {
6+
"orgPreferenceSettings" : {
7+
"s1EncryptedStoragePref2" : false
8+
}
89
}
9-
}
1010
}

force-app/main/aura/LC_API/LC_API.cmp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ License: BSD 3-Clause License
102102
<!--
103103
BSD 3-Clause License
104104

105-
Copyright (c) 2018, Doug Ayers, douglascayers.com
105+
Copyright (c) 2018-2019, Doug Ayers, douglascayers.com
106106
All rights reserved.
107107

108108
Redistribution and use in source and binary forms, with or without

force-app/main/aura/LC_API/LC_APIController.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@ License: BSD 3-Clause License
6868
},
6969

7070
onRestRequest: function( component, event, helper ) {
71-
var params = event.getParam( 'arguments' );
71+
const params = event.getParam( 'arguments' );
7272
return helper.handleRestRequest( component, params.request );
7373
},
7474

7575
onFetchRequest: function( component, event, helper ) {
76-
var params = event.getParam( 'arguments' );
76+
const params = event.getParam( 'arguments' );
7777
return helper.handleFetchRequest( component, params.request );
7878
}
7979
})
8080
/*
8181
BSD 3-Clause License
8282
83-
Copyright (c) 2018, Doug Ayers, douglascayers.com
83+
Copyright (c) 2018-2019, Doug Ayers, douglascayers.com
8484
All rights reserved.
8585
8686
Redistribution and use in source and binary forms, with or without

force-app/main/aura/LC_API/LC_APIHelper.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ License: BSD 3-Clause License
77
({
88
handleRestRequest: function( component, request ) {
99

10-
var helper = this;
10+
const helper = this;
1111

12-
var defaultRequest = {
12+
const defaultRequest = {
1313
'method' : 'get'
1414
};
1515

16-
var defaultHeaders = {
16+
const defaultHeaders = {
1717
'Content-Type': 'application/json'
1818
};
1919

@@ -28,7 +28,7 @@ License: BSD 3-Clause License
2828

2929
handleFetchRequest: function( component, request ) {
3030

31-
var helper = this;
31+
const helper = this;
3232

3333
return helper.getPenpalChild().then( $A.getCallback( function( child ) {
3434
return helper.makePenpalRequest( 'fetch', child, request );
@@ -45,11 +45,11 @@ License: BSD 3-Clause License
4545
*/
4646
getPenpalChild: function() {
4747

48-
var helper = this;
48+
const helper = this;
4949

5050
return new Promise( function( resolve, reject ) {
5151

52-
var child = helper._penpal.child;
52+
let child = helper._penpal.child;
5353

5454
if ( child ) {
5555

@@ -58,12 +58,12 @@ License: BSD 3-Clause License
5858
} else {
5959

6060
// all time values in milliseconds
61-
var timeout = 10000; // ten seconds
62-
var pollFrequency = 500; // half a second
63-
var startTime = new Date().getTime();
64-
var endTime = startTime + timeout;
61+
const timeout = 10000; // ten seconds
62+
const pollFrequency = 500; // half a second
63+
const startTime = new Date().getTime();
64+
const endTime = startTime + timeout;
6565

66-
var timerId = setInterval( $A.getCallback( function() {
66+
const timerId = setInterval( $A.getCallback( function() {
6767

6868
child = helper._penpal.child;
6969

@@ -76,7 +76,7 @@ License: BSD 3-Clause License
7676
} else {
7777

7878
// check if we have exceeded our timeout
79-
var currentTime = new Date().getTime();
79+
const currentTime = new Date().getTime();
8080
if ( currentTime > endTime ) {
8181
clearInterval( timerId );
8282
reject( 'LC_API: Timeout trying to establish connection to iframe' );
@@ -141,11 +141,11 @@ License: BSD 3-Clause License
141141
*/
142142
makeApexRequest: function( component, actionName, params, options ) {
143143

144-
var helper = this;
144+
const helper = this;
145145

146146
return new Promise( function( resolve, reject ) {
147147

148-
var action = component.get( actionName );
148+
const action = component.get( actionName );
149149

150150
if ( params ) {
151151
action.setParams( params );
@@ -201,7 +201,7 @@ License: BSD 3-Clause License
201201
/*
202202
BSD 3-Clause License
203203
204-
Copyright (c) 2018, Doug Ayers, douglascayers.com
204+
Copyright (c) 2018-2019, Doug Ayers, douglascayers.com
205205
All rights reserved.
206206
207207
Redistribution and use in source and binary forms, with or without

force-app/main/aura/LC_API/LC_APIRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ License: BSD 3-Clause License
2222
/*
2323
BSD 3-Clause License
2424
25-
Copyright (c) 2018, Doug Ayers, douglascayers.com
25+
Copyright (c) 2018-2019, Doug Ayers, douglascayers.com
2626
All rights reserved.
2727
2828
Redistribution and use in source and binary forms, with or without

force-app/main/classes/LC_VisualforceDomainController.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public with sharing class LC_VisualforceDomainController {
2727
/*
2828
BSD 3-Clause License
2929
30-
Copyright (c) 2018, Doug Ayers, douglascayers.com
30+
Copyright (c) 2018-2019, Doug Ayers, douglascayers.com
3131
All rights reserved.
3232
3333
Redistribution and use in source and binary forms, with or without

force-app/main/pages/LC_APIPage.page

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ License: BSD 3-Clause License
136136
<!--
137137
BSD 3-Clause License
138138

139-
Copyright (c) 2018, Doug Ayers, douglascayers.com
139+
Copyright (c) 2018-2019, Doug Ayers, douglascayers.com
140140
All rights reserved.
141141

142142
Redistribution and use in source and binary forms, with or without

force-app/main/pages/LC_VisualforceDomainPage.page

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ License: BSD 3-Clause License
1414
<!--
1515
BSD 3-Clause License
1616

17-
Copyright (c) 2018, Doug Ayers, douglascayers.com
17+
Copyright (c) 2018-2019, Doug Ayers, douglascayers.com
1818
All rights reserved.
1919

2020
Redistribution and use in source and binary forms, with or without

0 commit comments

Comments
 (0)