Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AssetsApiClient

Hierarchy

  • AssetsApiClient

Index

Accessors

messages

  • Make sure to call the loadMessages function before using the messages object.

    Returns Messages

Methods

browse

  • Returns the browse result at a given path.

    remark

    Note that the entire tree structure will be returned when specifying the fromRoot parameter.

    Parameters

    Returns Promise<BrowseResponse>

copy

  • Copies an entity from a given source destination to the specified target destination.

    Parameters

    Returns Promise<BulkResponse>

create

  • create(metadata: {}): Promise<Asset>
  • Creates an asset with the given metadata.

    Parameters

    • metadata: {}
      • [key: string]: any

    Returns Promise<Asset>

createFolder

createRelation

  • Creates a relation between two entities.

    Parameters

    Returns Promise<{}>

csrf

  • csrf(force?: boolean): Promise<string>
  • Requests a new csrf token.

    remark

    For the calls in this client, the token will be refreshed automatically should the token expire.

    Parameters

    • Default value force: boolean = false

    Returns Promise<string>

fieldinfo

  • Returns the configuration of fieldinfo of the current Assets server.

    Returns Promise<FieldinfoResponse>

getProfile

  • Returns the profile for the currently logged in user

    Returns Promise<ProfileResponse>

loadMessages

  • loadMessages(locale?: string): Promise<{}>
  • Requests the configured messages for the given locale and initializes the messages object on the API client.

    Parameters

    • Default value locale: string = navigator.language

    Returns Promise<{}>

login

  • Performs a login using the configured login method.

    remark

    Note that the passed parameters will be disregarded when using the AssetsPluginContext. A LoginResponse will only be returned when running in standalone mode.

    Parameters

    Returns Promise<void | LoginResponse>

logout

  • logout(): Promise<void>
  • Performs a logout request on the server.

    remark

    Note that for plugin usage (since the client window is used as proxy for requests) this will result in the client being logged out.

    Returns Promise<void>

move

  • Moves an entity from a given source destination to the specified target destination.

    Parameters

    Returns Promise<BulkResponse>

remove

removeRelation

search

update

  • update(id: string, metadata: {}): Promise<Asset>
  • Updates an asset with the specified metadata.

    Parameters

    • id: string
    • metadata: {}
      • [key: string]: any

    Returns Promise<Asset>

updatebulk

  • updatebulk(query: string, metadata: {}): Promise<BulkResponse>
  • Updates assets found by the given query with the specified metadata.

    remark

    Sets the same metadata for all assets. If you want to set different metadata for multiple assets, use updatebulkMulti instead.

    Parameters

    • query: string
    • metadata: {}
      • [key: string]: any

    Returns Promise<BulkResponse>

updatebulkMulti

  • Updates specified assets with respectively specified metadata. Allows for setting different metadata per asset.

    Parameters

    Returns Promise<Asset[]>

useAutoLogin

  • useAutoLogin(username: string, password: string, clientType: string): void
  • Configure the client to start a session within the current window with the given credentials when authenticating.

    Parameters

    • username: string
    • password: string
    • clientType: string

    Returns void

useLoginHandler

  • useLoginHandler(loginHandler: (params?: LoginParams) => Promise<any>): void
  • Configure the client to use a custom handler for logging in.

    Parameters

    Returns void

Static fromPluginContext

  • Use this function to initialize the API client using an established connection with the Assets client using the AssetsPluginContext class. This ensures requests and login prompts are automatically routed through to the Assets client and thus reuses the existing user session from the Assets client window.

    Parameters

    Returns AssetsApiClient

Static standalone

  • standalone(serverUrl: string, username: string, password: string, clientType: string): AssetsApiClient
  • Use this function to initialize the API client as a standalone interface with the Assets server. This means a new userSession must be instantiated in order to start querying the server. For plugin developers looking to reuse the existing userSession from the Assets client, refer to the 'fromPluginContext' function.

    Parameters

    • serverUrl: string
    • username: string
    • password: string
    • clientType: string

    Returns AssetsApiClient