Function getFileVariants

  • Returns list of file variants for given asset.

    Parameters

    • env: string = 'stage'

      env

    • shortID: string

      dm shortID

    • allSizes: number[]

      array of dimensions. must match configuration in dm | assetgroup | defaultSizes. see getPossibleSizes in ec.editor4 for details.

    • asset: AssetResource

      asset in question.

    • thumb: boolean = false

      if true, returns a thumbnail (width = height)

    Returns { size: number; url: any; generated: any }[]

    const asset = await ecadmin
    .assetgroup("test")
    .getAsset("tP-ZxpZZTGmbPnET-wArAQ");
    const variants = getFileVariants('stage', '83cc6374', [64, 128, 256, 512, 1024], asset, 128, false);