@smartcar/auth 2.9.0 → 2.10.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 +2 -2
- package/dist/npm/sdk.js +7 -2
- package/doc/README.md +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ npm install @smartcar/auth
|
|
|
24
24
|
### Smartcar CDN
|
|
25
25
|
|
|
26
26
|
```html
|
|
27
|
-
<script src="https://javascript-sdk.smartcar.com/2.
|
|
27
|
+
<script src="https://javascript-sdk.smartcar.com/2.10.0/sdk.js"></script>
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
## SDK reference
|
|
@@ -178,4 +178,4 @@ https://application-backend.com/page?error=access_denied&error_description=User+
|
|
|
178
178
|
[tag-image]: https://img.shields.io/github/tag/smartcar/javascript-sdk.svg
|
|
179
179
|
|
|
180
180
|
<!-- Please do not modify or remove this, it is used by the build process -->
|
|
181
|
-
[version]: 2.
|
|
181
|
+
[version]: 2.10.0
|
package/dist/npm/sdk.js
CHANGED
|
@@ -73,6 +73,10 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
73
73
|
* backend sever for an access token
|
|
74
74
|
* @param {Object} [state] - contains state if it was set on the initial
|
|
75
75
|
* authorization request
|
|
76
|
+
* @param {String} [virtualKeyUrl] - virtual key URL used by Tesla to register
|
|
77
|
+
* Smartcar's virtual key on a vehicle. This registration will be required in order to use
|
|
78
|
+
* any commands on a Tesla vehicle. It is an optional argument as it is only included in
|
|
79
|
+
* specific cases.
|
|
76
80
|
*/
|
|
77
81
|
|
|
78
82
|
/**
|
|
@@ -204,6 +208,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
204
208
|
};
|
|
205
209
|
|
|
206
210
|
var err = generateError(message.error, message.errorDescription);
|
|
211
|
+
var virtualKeyUrl = message.virtualKeyUrl;
|
|
207
212
|
/**
|
|
208
213
|
* Call `onComplete` with parameters even if developer is not using
|
|
209
214
|
* a Smartcar-hosted redirect. Regardless of if they are using a
|
|
@@ -217,7 +222,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
217
222
|
* parameters in their redirect uri.
|
|
218
223
|
*/
|
|
219
224
|
|
|
220
|
-
_this.onComplete(err, message.code, originalState);
|
|
225
|
+
_this.onComplete(err, message.code, originalState, virtualKeyUrl);
|
|
221
226
|
}
|
|
222
227
|
}; // add handler for postMessage event on completion of Smartcar Connect
|
|
223
228
|
|
|
@@ -525,7 +530,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
525
530
|
|
|
526
531
|
if (usesOldUriScheme) {
|
|
527
532
|
// eslint-disable-next-line no-console
|
|
528
|
-
console.warn("\nThe Smartcar redirect URI you're using is outdated! To update it, please see:\nhttps://
|
|
533
|
+
console.warn("\nThe Smartcar redirect URI you're using is outdated! To update it, please see:\nhttps://github.com/smartcar/javascript-sdk#1-register-a-javascript-sdk-redirect-uri\n");
|
|
529
534
|
}
|
|
530
535
|
}
|
|
531
536
|
}
|
package/doc/README.md
CHANGED
|
@@ -203,6 +203,7 @@ Invalid subscription error returned by Connect.
|
|
|
203
203
|
| error | <code>Error</code> | something went wrong in Connect; this normally indicates that the user denied access to your application or does not have a connected vehicle |
|
|
204
204
|
| code | <code>String</code> | the authorization code to be exchanged from a backend sever for an access token |
|
|
205
205
|
| [state] | <code>Object</code> | contains state if it was set on the initial authorization request |
|
|
206
|
+
| [virtualKeyUrl] | <code>String</code> | virtual key URL used by Tesla to register Smartcar's virtual key on a vehicle. This registration will be required in order to use any commands on a Tesla vehicle. It is an optional argument as it is only included in specific cases. |
|
|
206
207
|
|
|
207
208
|
<a name="WindowOptions"></a>
|
|
208
209
|
|