Options
All
  • Public
  • Public/Protected
  • All
Menu

Client providing access to Autodesk Forge model derivative APIs.

tutorial

model-derivative

Hierarchy

Index

Constructors

constructor

  • Initializes new client with specific authentication method.

    Parameters

    • auth: IAuthOptions

      Authentication object, containing either client_id and client_secret properties (for 2-legged authentication), or a single token property (for 2-legged or 3-legged authentication with pre-generated access token).

    • Optional host: string
    • Optional region: US | EMEA

    Returns ModelDerivativeClient

Properties

Protected Optional auth

Protected axios

axios: AxiosInstance

Protected host

host: string

Protected region

region: Region

Protected root

root: string

Protected Optional token

token: string

Methods

Protected delete

  • delete(endpoint: string, headers?: {}, scopes: string[]): Promise<any>
  • Parameters

    • endpoint: string
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

deleteManifest

  • deleteManifest(urn: string): Promise<any>
  • Deletes manifest (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights, or incorrect scopes.

    Parameters

    • urn: string

      Document derivative URN.

    Returns Promise<any>

Protected fetch

  • fetch(config: AxiosRequestConfig): Promise<AxiosResponse<any>>

formats

  • Gets a list of supported translation formats (docs).

    async
    yields

    {Promise} Dictionary of all supported output formats mapped to arrays of formats these outputs can be obtained from.

    throws

    Error when the request fails, for example, due to insufficient rights.

    Returns Promise<IDerivativeFormats>

Protected get

  • get(endpoint: string, headers?: {}, scopes: string[], repeatOn202?: boolean): Promise<any>
  • Parameters

    • endpoint: string
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]
    • repeatOn202: boolean = false

    Returns Promise<any>

Private getBaseUrl

  • getBaseUrl(path: string): URL

Protected getBuffer

  • getBuffer(endpoint: string, headers?: {}, scopes: string[], repeatOn202?: boolean): Promise<any>
  • Parameters

    • endpoint: string
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]
    • repeatOn202: boolean = false

    Returns Promise<any>

getDerivative

  • getDerivative(modelUrn: string, derivativeUrn: string): Promise<ArrayBuffer>
  • Downloads content of a specific model derivative (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights, or incorrect scopes.

    Parameters

    • modelUrn: string

      Model URN.

    • derivativeUrn: string

      Derivative URN.

    Returns Promise<ArrayBuffer>

    Derivative content.

getDerivativeChunked

  • getDerivativeChunked(modelUrn: string, derivativeUrn: string, maxChunkSize?: number): Readable
  • Downloads content of a specific model derivative asset in chunks (docs).

    throws

    Error when the request fails, for example, due to insufficient rights, or incorrect scopes.

    Parameters

    • modelUrn: string

      Model URN.

    • derivativeUrn: string

      Derivative URN.

    • maxChunkSize: number = ...

    Returns Readable

    Readable stream with the content of the downloaded derivative asset.

getDerivativeStream

  • getDerivativeStream(modelUrn: string, derivativeUrn: string): Promise<ReadableStream<any>>
  • Downloads content of a specific model derivative (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights, or incorrect scopes.

    Parameters

    • modelUrn: string

      Model URN.

    • derivativeUrn: string

      Derivative URN.

    Returns Promise<ReadableStream<any>>

    Derivative content stream.

getManifest

  • Retrieves manifest of a derivative (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights.

    Parameters

    • urn: string

      Document derivative URN.

    Returns Promise<IDerivativeManifest>

    Document derivative manifest.

getMetadata

  • Retrieves metadata of a derivative (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights.

    Parameters

    • urn: string

      Document derivative URN.

    Returns Promise<IDerivativeMetadata>

    Document derivative metadata.

getMetadataStream

  • getMetadataStream(urn: string): Promise<ReadableStream<any>>
  • Retrieves metadata of a derivative as a readable stream (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights.

    Parameters

    • urn: string

      Document derivative URN.

    Returns Promise<ReadableStream<any>>

    Document derivative metadata.

Protected getStream

  • getStream(endpoint: string, headers?: {}, scopes: string[], repeatOn202?: boolean): Promise<any>
  • Parameters

    • endpoint: string
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]
    • repeatOn202: boolean = false

    Returns Promise<any>

getThumbnail

  • getThumbnail(urn: string, size?: ThumbnailSize): Promise<ArrayBuffer>
  • Retrieves derivative thumbnail (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights, or incorrect scopes.

    Parameters

    Returns Promise<ArrayBuffer>

    Thumbnail data.

getThumbnailStream

  • getThumbnailStream(urn: string, size?: ThumbnailSize): Promise<ReadableStream<any>>
  • Retrieves derivative thumbnail stream (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights, or incorrect scopes.

    Parameters

    Returns Promise<ReadableStream<any>>

    Thumbnail data stream.

getViewableProperties

  • getViewableProperties(urn: string, guid: string, force?: boolean, objectId?: number): Promise<IDerivativeProps>
  • Retrieves properties of a specific viewable (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights.

    Parameters

    • urn: string

      Document derivative URN.

    • guid: string

      Viewable GUID.

    • Optional force: boolean
    • Optional objectId: number

    Returns Promise<IDerivativeProps>

    Viewable properties.

getViewablePropertiesStream

  • getViewablePropertiesStream(urn: string, guid: string, force?: boolean, objectId?: number): Promise<ReadableStream<any>>
  • Retrieves properties of a specific viewable as a readable stream (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights.

    Parameters

    • urn: string

      Document derivative URN.

    • guid: string

      Viewable GUID.

    • Optional force: boolean
    • Optional objectId: number

    Returns Promise<ReadableStream<any>>

    Readable stream.

getViewableTree

  • getViewableTree(urn: string, guid: string, force?: boolean, objectId?: number): Promise<IDerivativeTree>
  • Retrieves object tree of a specific viewable (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights.

    Parameters

    • urn: string

      Document derivative URN.

    • guid: string

      Viewable GUID.

    • Optional force: boolean
    • Optional objectId: number

    Returns Promise<IDerivativeTree>

    Viewable object tree.

getViewableTreeStream

  • getViewableTreeStream(urn: string, guid: string, force?: boolean, objectId?: number): Promise<ReadableStream<any>>
  • Retrieves object tree of a specific viewable as a readable stream (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights.

    Parameters

    • urn: string

      Document derivative URN.

    • guid: string

      Viewable GUID.

    • Optional force: boolean
    • Optional objectId: number

    Returns Promise<ReadableStream<any>>

    Readable stream.

Protected patch

  • patch(endpoint: string, data: any, headers?: {}, scopes: string[]): Promise<any>
  • Parameters

    • endpoint: string
    • data: any
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

Protected post

  • post(endpoint: string, data: any, headers?: {}, scopes: string[]): Promise<any>
  • Parameters

    • endpoint: string
    • data: any
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

Protected put

  • put(endpoint: string, data: any, headers?: {}, scopes: string[]): Promise<any>
  • Parameters

    • endpoint: string
    • data: any
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

reset

  • reset(auth?: { client_id: string; client_secret: string } | { token: string }, host?: string, region?: US | EMEA): void
  • Resets client to specific authentication method, Forge host, and availability region.

    Parameters

    • Optional auth: { client_id: string; client_secret: string } | { token: string }
    • Optional host: string
    • Optional region: US | EMEA

    Returns void

Protected setAuthorization

  • setAuthorization(options: any, scopes: string[]): Promise<void>

submitJob

  • submitJob(urn: string, outputs: IDerivativeOutputType[], pathInArchive?: string, force?: boolean, workflowId?: string, workflowAttr?: object): Promise<IJob>
  • Submits a translation job (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights.

    Parameters

    • urn: string

      Document to be translated.

    • outputs: IDerivativeOutputType[]

      List of requested output formats.

    • Optional pathInArchive: string
    • Optional force: boolean
    • Optional workflowId: string
    • Optional workflowAttr: object

    Returns Promise<IJob>

    Translation job details, with properties 'result', 'urn', and 'acceptedJobs'.

Generated using TypeDoc