Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Utils

Hierarchy

  • Utils

Index

Methods

Static attemptResourceWithToken

Static authorize

  • authorize(resource: IExternalResource, tokenStorageStrategy: string, clickThrough: function, restricted: function, login: function, getAccessToken: function, storeAccessToken: function, getStoredAccessToken: function): Promise<IExternalResource>

Static createAuthorizationFailedError

  • createAuthorizationFailedError(): Error

Static createError

  • createError(name: StatusCode, message: string): Error

Static createInternalServerError

  • createInternalServerError(message: string): Error
  • Parameters

    • message: string

    Returns Error

Static createRestrictedError

  • createRestrictedError(): Error

Static doAuthChain

  • doAuthChain(resource: IExternalResource, openContentProviderInteraction: function, openTokenService: function, userInteractedWithContentProvider: function, getContentProviderInteraction: function, handleMovedTemporarily: function, showOutOfOptionsMessages: function): Promise<IExternalResource | void>

Static generateTreeNodeIds

  • generateTreeNodeIds(treeNode: TreeNode, index?: number): void
  • Parameters

    • treeNode: TreeNode
    • Default value index: number = 0

    Returns void

Static getImageQuality

  • getImageQuality(profile: ServiceProfile): string
  • Parameters

    • profile: ServiceProfile

    Returns string

Static getInexactLocale

  • getInexactLocale(locale: string): string
  • Parameters

    • locale: string

    Returns string

Static getLocalisedValue

  • getLocalisedValue(resource: any, locale: string): string | null
  • Parameters

    • resource: any
    • locale: string

    Returns string | null

Static getMediaType

  • getMediaType(type: string): MediaType
  • Parameters

    • type: string

    Returns MediaType

Static getResourceById

Static getService

  • getService(resource: any, profile: ServiceProfile): Service | null
  • Parameters

    • resource: any
    • profile: ServiceProfile

    Returns Service | null

Static getServices

  • getServices(resource: any): Service[]

Static getTemporalComponent

  • getTemporalComponent(target: string): number[] | null
  • Parameters

    • target: string

    Returns number[] | null

Static isImageProfile

  • isImageProfile(profile: ServiceProfile): boolean
  • Parameters

    • profile: ServiceProfile

    Returns boolean

Static isLevel0ImageProfile

  • isLevel0ImageProfile(profile: ServiceProfile): boolean
  • Parameters

    • profile: ServiceProfile

    Returns boolean

Static isLevel1ImageProfile

  • isLevel1ImageProfile(profile: ServiceProfile): boolean
  • Parameters

    • profile: ServiceProfile

    Returns boolean

Static isLevel2ImageProfile

  • isLevel2ImageProfile(profile: ServiceProfile): boolean
  • Parameters

    • profile: ServiceProfile

    Returns boolean

Static loadExternalResourceAuth09

  • loadExternalResourceAuth09(resource: IExternalResource, tokenStorageStrategy: string, clickThrough: function, restricted: function, login: function, getAccessToken: function, storeAccessToken: function, getStoredAccessToken: function, handleResourceResponse: function, options?: IManifestoOptions): Promise<IExternalResource>

Static loadExternalResourceAuth1

  • loadExternalResourceAuth1(resource: IExternalResource, openContentProviderInteraction: function, openTokenService: function, getStoredAccessToken: function, userInteractedWithContentProvider: function, getContentProviderInteraction: function, handleMovedTemporarily: function, showOutOfOptionsMessages: function): Promise<IExternalResource>

Static loadExternalResourcesAuth09

  • loadExternalResourcesAuth09(resources: IExternalResource[], tokenStorageStrategy: string, clickThrough: function, restricted: function, login: function, getAccessToken: function, storeAccessToken: function, getStoredAccessToken: function, handleResourceResponse: function, options?: IManifestoOptions): Promise<IExternalResource[]>

Static loadExternalResourcesAuth1

  • loadExternalResourcesAuth1(resources: IExternalResource[], openContentProviderInteraction: function, openTokenService: function, getStoredAccessToken: function, userInteractedWithContentProvider: function, getContentProviderInteraction: function, handleMovedTemporarily: function, showOutOfOptionsMessages: function): Promise<IExternalResource[]>

Static loadManifest

  • loadManifest(uri: string): Promise<string>
  • Parameters

    • uri: string

    Returns Promise<string>

Static normaliseType

  • normaliseType(type: string): string
  • Parameters

    • type: string

    Returns string

Static normaliseUrl

  • normaliseUrl(url: string): string
  • Parameters

    • url: string

    Returns string

Static normalisedUrlsMatch

  • normalisedUrlsMatch(url1: string, url2: string): boolean
  • Parameters

    • url1: string
    • url2: string

    Returns boolean

Static parseManifest

Static Private showAuthInteraction

  • showAuthInteraction(resource: IExternalResource, tokenStorageStrategy: any, clickThrough: any, restricted: any, login: any, getAccessToken: any, storeAccessToken: any, resolve: any, reject: any): void
  • Parameters

    • resource: IExternalResource
    • tokenStorageStrategy: any
    • clickThrough: any
    • restricted: any
    • login: any
    • getAccessToken: any
    • storeAccessToken: any
    • resolve: any
    • reject: any

    Returns void

Static traverseAndFind

  • traverseAndFind(object: any, k: string, v: string): object & void
  • Does a depth first traversal of an Object, returning an Object that matches provided k and v arguments

    example

    Utils.traverseAndFind({foo: 'bar'}, 'foo', 'bar')

    Parameters

    • object: any
    • k: string
    • v: string

    Returns object & void

Generated using TypeDoc