ember-arcgis-portal-services
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -0,1 +1,2 @@ | ||
import getServiceAdminUrl from 'ember-arcgis-portal-services/utils/get-service-admin-url'; | ||
import Service from '@ember/service'; | ||
@@ -53,7 +54,3 @@ import serviceMixin from '../mixins/service-mixin'; | ||
addToDefinition (featureServiceUrl, definition, layerId, portalOpts) { | ||
let adminUrl = featureServiceUrl.replace(/\/arcgis\/rest\/services\//i, '/arcgis/rest/admin/services/'); | ||
let url = `${adminUrl}/addToDefinition?f=json`; | ||
if (layerId || layerId === 0) { | ||
url = `${adminUrl}/${layerId}/addToDefinition?f=json`; | ||
} | ||
const url = getServiceAdminUrl(featureServiceUrl, 'addToDefinition', layerId); | ||
// since the fs has it's own url we use the requestUrl method | ||
@@ -72,7 +69,3 @@ return this.requestUrl(url, { | ||
updateDefinition (featureServiceUrl, definition, layerId, portalOpts) { | ||
let adminUrl = featureServiceUrl.replace(/\/arcgis\/rest\/services\//i, '/arcgis/rest/admin/services/'); | ||
let url = `${adminUrl}/updateDefinition?f=json`; | ||
if (layerId || layerId === 0) { | ||
url = `${adminUrl}/${layerId}/updateDefinition?f=json`; | ||
} | ||
const url = getServiceAdminUrl(featureServiceUrl, 'updateDefinition', layerId); | ||
// since the fs has it's own url we use the requestUrl method | ||
@@ -88,2 +81,16 @@ return this.requestUrl(url, { | ||
/** | ||
* Delete from the service definition | ||
*/ | ||
deleteFromDefinition (featureServiceUrl, definition, layerId, portalOpts) { | ||
const url = getServiceAdminUrl(featureServiceUrl, 'deleteFromDefinition', layerId); | ||
// since the fs has it's own url we use the requestUrl method | ||
return this.requestUrl(url, { | ||
method: 'POST', | ||
data: { | ||
deleteFromDefinition: JSON.stringify(definition) | ||
} | ||
}, portalOpts); | ||
}, | ||
/** | ||
* Shared logic for POST operations | ||
@@ -90,0 +97,0 @@ */ |
@@ -5,2 +5,6 @@ # Change Log | ||
## Unreleased | ||
### Added | ||
- `hosted-service:deleteFromDefinition` method | ||
## 1.4.0 | ||
@@ -7,0 +11,0 @@ ### Added |
{ | ||
"name": "ember-arcgis-portal-services", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "A set of promise-based Ember Services for working with the ArcGIS Portal API.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -175,2 +175,3 @@ # ember-arcgis-portal-services | ||
| `updateDefinition (fsUrl, definition, layerId, portalOpts)` | `promise` | Update a service/layer's definition | | ||
| `deleteFromDefinition (fsUrl, definition, layerId, portalOpts)` | `promise` | Delete from a service/layer's definition | | ||
@@ -177,0 +178,0 @@ ### environment.js |
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
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
663129
38
18250
246
3