Class LinkedFile

Base class for all Shortcut resources. Provides methods for creating, updating, and deleting resources.

Remarks

Related: LinkedFilesService for the service managing stories.

Hierarchy (view full)

Implements

Constructors

Properties

availableOperations: ResourceOperation[] = ...

The available operations for the resource, any not in this list will raise an error when called

baseUrl: string = 'https://api.app.shortcut.com/api/v3/linked-files'
changedFields: string[] = []

Fields that have been changed, used to determine what to update. It is not recommended to access this property directly.

contentType: string
createFields: string[] = ...

Fields that are used when creating a new resource

createdAt: Date
description: string
entityType: string
groupMentionIds: string[]
id: number
memberMentionIds: string[]
name: string
service: BaseService<BaseResource<default>, default> | BaseSearchableService<BaseResource<default>, default>
size: null | number
storyIds: number[]
thumbnailUrl: null | string
type: string
updatedAt: Date
url: string

Accessors

  • get baseUrl(): string
  • The base URL for the resource to be used in API requests. This property must be overridden in the subclass.

    Returns string

    Throws

    • Throws an error if the property is not overridden in the subclass.

Methods

  • Protected

    This method can be overridden by derived classes to perform any necessary operations before saving the resource

    Returns Promise<void>

  • Create a new instance of the resource, using the current object's properties. Use the xCreateData interface to determine which fields are available for creation.

    Returns Promise<LinkedFile>

    • A Promise that resolves with the newly created instance.

    Throws

    • Throws an error if the HTTP request fails.
  • Delete the current instance of the resource.

    Returns Promise<void>

    • A Promise that resolves when the resource has been deleted.

    Throws

    • Throws an error if the HTTP request fails.
  • Save the current instance of the resource. If the resource already exists (has an ID), it will be updated. Otherwise, it will be created using the fields createFields.

    Returns Promise<void>

  • Update the current instance of the resource with the changed fields.

    Returns Promise<void>

    • A Promise that resolves when the resource has been updated.

    Throws

    • Throws an error if the HTTP request fails.