ember-arcgis-portal-services
Advanced tools
Comparing version 1.5.1 to 1.5.2
@@ -179,13 +179,21 @@ import { debug } from '@ember/debug'; | ||
addOptions (args, portalOpts) { | ||
// use ember-fetch | ||
// always use ember-fetch | ||
args.fetch = fetch; | ||
// if portal options are present, they're preferred | ||
// portal options are preferred over a normal auth session | ||
if (portalOpts && portalOpts.portalHostname) { | ||
args.portal = `https://${portalOpts.portalHostname}/sharing/rest`; | ||
if (!args.params) { | ||
args.params = {}; | ||
// sometimes the protocol will be present, other times it wont | ||
if (!/https?:\/\//.test(portalOpts.portalHostname)) { | ||
args.portal = `https://${portalOpts.portalHostname}/sharing/rest`; | ||
} else { | ||
args.portal = `${portalOpts.portalHostname}/sharing/rest`; | ||
} | ||
args.params.token = portalOpts.token; | ||
// append a token, dont overwrite existing params if they exist | ||
if (portalOpts.token) { | ||
if (!args.params) { | ||
args.params = {}; | ||
} | ||
args.params.token = portalOpts.token; | ||
} | ||
} else { | ||
// pass through auth info from the session | ||
// otherwise pass through auth info from the session | ||
args.authentication = this.get('session.authMgr'); | ||
@@ -192,0 +200,0 @@ } |
@@ -185,4 +185,4 @@ import { deprecate } from '@ember/application/deprecations'; | ||
return this.request(urlPath, options, portalOpts); | ||
}, | ||
} | ||
}); |
@@ -7,2 +7,5 @@ # Change Log | ||
## [1.5.2] | ||
- handle portalOpts urls appropriately whether they supply a protocol or not | ||
## [1.5.1] | ||
@@ -390,3 +393,4 @@ ### Changed | ||
[Unreleased]: https://github.com/Esri/ember-arcgis-portal-services/compare/v1.5.1...HEAD | ||
[Unreleased]: https://github.com/Esri/ember-arcgis-portal-services/compare/v1.5.2...HEAD | ||
[1.5.1]: https://github.com/Esri/ember-arcgis-portal-services/compare/v1.5.1...v1.5.2 | ||
[1.5.1]: https://github.com/Esri/ember-arcgis-portal-services/compare/v1.5.0...v1.5.1 |
{ | ||
"name": "ember-arcgis-portal-services", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "A set of promise-based Ember Services for working with the ArcGIS Portal API.", | ||
@@ -73,2 +73,3 @@ "keywords": [ | ||
"eslint-plugin-standard": "^2.0.0", | ||
"husky": "^1.0.0-rc.13", | ||
"jsoneditor": "5.5.6", | ||
@@ -92,3 +93,8 @@ "loader.js": "^4.2.3", | ||
}, | ||
"homepage": "https://github.com/Esri/ember-arcgis-portal-services#readme" | ||
"homepage": "https://github.com/Esri/ember-arcgis-portal-services#readme", | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "npm run lint:js" | ||
} | ||
} | ||
} |
@@ -40,3 +40,3 @@ # ember-arcgis-portal-services | ||
``` | ||
```js | ||
{ | ||
@@ -46,2 +46,7 @@ portalHostname: 'some.portal.com', | ||
} | ||
// it might also look like this | ||
{ | ||
portalHostname: 'https://some.portal.com', | ||
token: 'BZSOMETOKENQJ' | ||
} | ||
``` | ||
@@ -233,3 +238,3 @@ | ||
Copyright 2017 Esri | ||
Copyright © 2016-2018 Esri | ||
@@ -236,0 +241,0 @@ Licensed under the Apache License, Version 2.0 (the "License"); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
251
91359
35
41
1572
6