IArcGISContext

Interface

Defines the properties of the ArcGISContext. Typically components or functions will get an instance of ArcGISContext from ArcGISContetManager.

ArcGISContext implements this interface, and uses getters to simplify the derivation of various complex properties.

Properties

Property Type Notes
communityOrgHostname string

Returns the Community Org Hostname, if defined

communityOrgId string

Return Hub Community Org Id, if defined

communityOrgUrl string

Returns the Hub Community Org url

currentUser IUser

Returns the current user

discussionsServiceUrl string

Returns the discussions API URL

domainServiceUrl string

Returns Hub Domain Service URL

enterpriseOrgId string

If we are in a community org with an associated e-org Return the Hub Enterprise Org Id, if defined

environment HubEnvironment

What environment is this running in?

eventsConfig any

Returns the Events configuration object from portal/self

featureFlags IFeatureFlags

Hash of feature flags

helperServices any

Returns the hash of helper services from portal self

history IHubHistory

Return the user's history

hubEnabled boolean

Returns boolean indicating if the current user belongs to an organization that has licensed ArcGIS Hub

hubHomeUrl string

Returns the current user's hub-home url. If not authenticated, returns the Hub Url. If portal, returns undefined

hubLicense HubLicense

What is the current user's hub license level?

hubRequestOptions IHubRequestOptions

Return a IHubRequestOptions object

hubSearchServiceUrl string

Returns the Hub Search API URL

hubUrl string

Returns the Hub url, based on the portalUrl

id number

Unique id from the ArcGISContextManager that created this instance. Primarily useful for debugging possible race-conditions that can result in multiple ArcGISContextManager instances being created.

isAlphaOrg boolean

Is this user in a Hub Alpha org? Derived from properties.alphaOrgs

isAuthenticated boolean

Return boolean indicating if authenticatio is present

isBetaOrg boolean

Is this user in a Hub Beta org? Derived from properties.betaOrgs

isCommunityOrg boolean

Is the current users org type a community org?

isOrgAdmin boolean

Is the current user an org admin and not in a custom role?

isPortal boolean

Returns boolean indicating if the backing system is ArcGIS Enterprise (formerly ArcGIS Portal) or not

ogcApiUrl string

Url for the Hub OGC API

orgThumbnailUrl string

Return the portal thumbnail url

portal IPortal

Returns the portal object

portalUrl string

Return the portal url.

properties Record<stringany>

Additional app-specific context

requestOptions IRequestOptions

Return IRequestOptions, which is used by REST-JS functions which may use authentication information if provided.

resourceGroupIDs string[]

Groups that contain Hub Resources (linkable documents etc) that are tagged to appear in different areas of the appliation. Default platform groups are defined per-environment in the "HUB_RESOURE_GROUPS" const..

serviceStatus HubServiceStatus

Hub Service Status

session UserSession

Return the UserSession if authenticated

sharingApiUrl string

Returns the url to the sharing api composed from portalUrl i.e. https://myorg.maps.arcgis.com/sharing/rest

survey123Url string

Return the Survey123 url

trustedOrgIds string[]

Array of Trusted Org Ids

trustedOrgs IHubTrustedOrgsResponse[]

Trusted orgs xhr response

userRequestOptions IUserRequestOptions

Return IUserRequestOptions, which is used for REST-JS functions which require authentication information.

userHubSettings Optional IUserHubSettings

Hash of user hub settings. These are stored as user-app-resources, associated with the hubforarcgis clientId

userResourceTokens Optional IUserResourceToken[]

Array of exchanged tokens for use with user-app-resources

Methods

Method Returns Notes
Promise<void>

Add an entry to the user's history If not authenticated, this function will no-op

IPermissionAccessResponse

Check specific permission for the current user, and optionally an entity

Promise<void>

Simple clear of the all of the user's history

Promise<void>

Refresh the current user, including their groups

Promise<void>

Remove a specific entry from the user's history

string

Return the token for a given app, if defined

Promise<void>

Update the user's hub settings directly from the Context

addToHistory

Interface Method

Add an entry to the user's history If not authenticated, this function will no-op

Parameters

Parameter Type Default Notes
entry Required IHubHistoryEntry

Returns

Promise<void>

checkPermission

Interface Method

Check specific permission for the current user, and optionally an entity

Parameters

Parameter Type Default Notes
permission Required Permission
entity Optional HubEntity

Returns

clearHistory

Interface Method

Simple clear of the all of the user's history

  • clearHistory() : Promise<void>

Returns

Promise<void>

refreshUser

Interface Method

Refresh the current user, including their groups

  • refreshUser() : Promise<void>

Returns

Promise<void>

removeFromHistory

Interface Method

Remove a specific entry from the user's history

Parameters

Parameter Type Default Notes
entry Required IHubHistoryEntry

Returns

Promise<void>

tokenFor

Interface Method

Return the token for a given app, if defined

Parameters

Parameter Type Default Notes
app Required UserResourceApp

Returns

string

updateUserHubSettings

Interface Method

Update the user's hub settings directly from the Context

Parameters

Parameter Type Default Notes
settings Required IUserHubSettings

Returns

Promise<void>

Interface defined in common/src/ArcGISContext.ts:68