Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-arcgis-portal-services

Package Overview
Dependencies
Maintainers
3
Versions
119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-arcgis-portal-services

A set of promise-based Ember Services for working with the ArcGIS Portal API.

  • 0.8.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by11.11%
Maintainers
3
Weekly downloads
 
Created
Source

ember-arcgis-portal-services

Ember Services for working with ArcGIS Portal/Online

Note This is still a very nascent project, and things will change.

If you use this project, be sure to lock to a specific version in your package.json.

We expect this project to have many releases before the 1.0.0 "Public API" stablization.

Portal Services

After adding this to your project, you will have a number of services available for injection into your routes/controllers/services.

Dependencies

This project is now using ember-network/fetch to enable fastboot compatibility. Please also ember install ember-network

  • torii-provider-arcgis install via npm i torii-provider-arcgis

Shared Methods

All the services expose a set of shared helper properties and methods:

PropertyReturnsDescription
portalRestUrlstringReturn the ArcGIS Portal Rest base url
portalUrlstringReturn the ArcGIS Portal base url (for visiting pages etc)
MethodReturnsDescription
encodeFormstringThis is used internally. Formats an object into a html form. In most cases, not necessary to call this.
request (url, options)promiseThis is used internally. Promisified xhr that does not basic handling of Portal's 400-in-a-200 errors

Items Service

MethodReturnsDescription
search(form)promiseExecutes via /sharing/rest/search. The form is an object properties matching the search params
getById(id)promiseReturns the Item.
getDataById(id)promiseReturns the Item-Data (/data).
update(item)promiseUpdates an existing item. The .owner property must be set.
create(item)promiseCreates an item. The .owner property must be set.
destroy(itemId, owner)promiseDelete the item.

Groups Service

MethodReturnsDescription
search(form)promiseExecutes via /sharing/rest/community/groups. The form is an object properties matching the search params
getById(id)promiseReturns the Group.
getItemsById(id)promiseReturns Items in the group. Note: Does not currently support paging.
save(group)promiseCreates or Updates a group.
update(group)promiseUpdates an existing group.
create(group)promiseCreates an item. The .owner property must be set.
destroy(id)promiseDelete the Group.
users(id)promiseReturn array of users that are members of the Group. Documentation
addUsers(id, users)promiseAdds users to the Group. Expects an array of usernames.
reassign(id, username)promiseReassign ownership of the group

Sharing Service

MethodReturnsDescription
shareItemWithEveryone(owner, itemId)promiseShares an item with everyone
shareItemWithOrg(owner, itemId)promiseShares an item with the Organization
shareItemsWithGroups(owner, items, groups)promiseShares a list of items with a list of groups. Both are arrays of ids. Owner must own all items
shareItemsWithControl(owner, items, groups)promiseSimilar to shareItemsWithGroups except it confirms itemControl (aka edit permission conferred via group membership)
shareItems(options)promiseUsed internally by the other methods, but could be useful in some cases

User Service

MethodReturnsDescription
search(form)promiseExecutes via /sharing/rest/community/users. The form is an object properties matching the search params
getByName(username)promiseGet a user object by name.

OAuth Service

Note: This is not used for authentication - rather its purpose is to allow Application Items to be programatically manipulated.

MethodReturnsDescription
registerApp (itemId, redirectUris, appType = 'browser')promiseRegisters an App item as an actual AGO Application. Returning clientId, client secret etc
updateApp(clientId, redirectUris)promiseCurrently just supports changing the set of valid redirect uris. PR's accepted to expand this

environment.js

Configuration for how to connect to the portal is managed in the torii section. If you are using ArcGIS Online, the portalUrl property is not needed.

// environment.js
...
torii: {
  sessionServiceName: 'session',
  providers: {
    'arcgis-oauth-bearer': {
      apiKey: 'SECRET-KEY-FOR-YOUR-APP',
      portalUrl: 'https://yourawesomeportal.com'
    }
  }
}
...

Installation

  • ember install ember-arcgis-portal-services
  • npm install
  • bower install

Running Tests

Note: Currently there are no automated tests for this addon. PR's welcomed :)

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Keywords

FAQs

Package last updated on 08 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc