Class PolyverseServiceAbstract

The PolyverseService class provides access to the Polyverse API.

Constructors

Properties

defaultAssetTypeFilter: (
    | "Mesh"
    | "Material"
    | "Image"
    | "Json"
    | "Environment"
    | "Data"
    | "RSXDeployment")[]

The default asset type filter

Methods

  • Articulates a backend route using routeParams and queryParams.

    Parameters

    • route: string
    • OptionalrouteParams: {
          [key: string]: string | number | boolean;
      }
      • [key: string]: string | number | boolean

    Returns string

    The routeParams will substitue url encoded the key/value pairs with route templates. e.g. /user/:userID will substitute the :userID with the key userID

  • Performs an authenticated fetch. If the user is not authenticated, this API will throw.

    Parameters

    • url: string

      The url to fetch.

    • OptionalisAuthOptional: boolean

    Returns Promise<AsyncHTTPRequest>

    A promise for the fetch

  • Fetches the asset from the Polyverse backend.

    Parameters

    • libraryID: string

      The library ID to fetch the asset from.

    • assetID: string

      The asset ID to fetch.

    Returns Promise<PolyverseAssetObject>

    A promise for the asset object.

  • Fetches the asset list from the Polyverse backend. This API is used to fetch assets from the Polyverse backend. The assets can be fetched from the global library, user subscriptions, a channel or a library.

    Parameters

    • sortType: PolyverseAssetLibrarySortType

      The sort type to use.

    • contentsLimit: number

      The number of contents to fetch.

    • contentsOffset: number

      The offset to fetch the contents from.

    • fetchType:
          | "Global"
          | "Subscriptions"
          | "Channel"
          | "Library"

      The type of fetch to perform.

    • fetchObjectID: string

      The object ID to fetch the contents from.

    • categories: string[]

      The categories to fetch the assets from.

    • includeAssetTypeFilters: (
          | "Mesh"
          | "Material"
          | "Image"
          | "Json"
          | "Environment"
          | "Data"
          | "RSXDeployment")[]

      The asset type filters to include.

    • OptionalignoreAssetTypeFilters: (
          | "Mesh"
          | "Material"
          | "Image"
          | "Json"
          | "Environment"
          | "Data"
          | "RSXDeployment")[]

      The asset type filters to ignore.

    • OptionalincludeCategories: boolean

      Whether to include categories in the fetch.

    • OptionalsearchQuery: string

      The search query to use.

    Returns Promise<PolyverseLibraryAssetContents>

    A promise for the library asset contents.

    This is only used for channel and library fetch types.

  • Open the Polyverse library or asset in the browser.

    Parameters

    • libraryID: string

      The library ID to open.

    • OptionalassetID: string

      The optional asset ID to open.

    Returns void