Abstract SDK

Abstract SDK

  • Getting Started
  • API
  • Community

›API

Introduction

  • Getting Started

API

  • Authentication
  • Reference

Utilities

  • Sketch
Edit

Reference

Activities

API

An activity represents a designated type of event within a project. These events can be specific to the project itself, or they can be specific to a collection, a branch, a commit, or a review within the project.

The activity object

PropertyTypeDescription
branchIdstringUUID of the branch that this activity was triggered on
createdAtstringTimestamp at which the activity was triggered
idstringUUID identifier of the activity
payloadObjectObject containing information specific to this type of activity
typestringThe type of this activity, may be one of BRANCH_ARCHIVED, BRANCH_CREATED, BRANCH_DELETED, BRANCH_DESCRIPTION_UPDATED, BRANCH_RENAMED, BRANCH_STATUS_UPDATED, BRANCH_UNARCHIVED, COLLECTION_PUBLISHED, COMMENT_CREATED, COMMIT, MERGE_COMMIT, PROJECT_ARCHIVED, PROJECT_CREATED, PROJECT_DELETED, PROJECT_DESCRIPTION_CHANGED, PROJECT_RENAMED, PROJECT_TRANSFERRED, PROJECT_UNARCHIVED, REVIEWER_REMOVED, REVIEW_COMPLETED, REVIEW_DISMISSED, REVIEW_REQUESTED, UPDATE_COMMIT
userIdstringUUID of the user that triggered this activity

List all activities

activities.list(BranchDescriptor | OrganizationDescriptor | ProjectDescriptor, { limit?: number, offset?: number }): Promise<Activity[]>

List the first two activities for a given project on a specific branch

abstract.activities.list({
  branchId: "8a13eb62-a42f-435f-b3a3-39af939ad31b",
  projectId: "b8bf5540-6e1e-11e6-8526-2d315b6ef48f",
}, { limit: 2 });

Retrieve an activity

activities.info(ActivityDescriptor): Promise<Activity>

Load the info for an activity

abstract.activities.info({
  activityId: "616daa90-1736-11e8-b8b0-8d1fec7aef78"
});

Branches

API

A branch is where design work and commits happen. A branch acts as a personal workspace for contributors, we encourage branches to be created for logical chunks of work – for example designing a new feature.

Note: Branches will be available through the CLI transport in the near future

The branch object

PropertyTypeDescription
createdAtstringTimestamp that the branch was created
descriptionstringA summary of the branch – this field may contain markdown.
divergedFromBranchIdstringUUID identifier of the branch this branch diverged from
headstringSHA that represents the latest commit on the branch
idstringUUID identifier of the branch, or the string "master"
mergeShastringSHA that represents the commit where this branch was merged
mergedIntoBranchIdstringUUID identifier of the branch this branch was merged into
namestringThe name of the branch
parentstringUUID identifier of the branch that this branch was created from, or the string "master"
projectIdstringUUID of the project that this branch is contained within
startedAtShastringSHA that represents the commit where this branch was created
statusstringThe current status of the branch. May be one of active, wip, feedback, review, merged, archived, deleted, diverged
updatedAtstringTimestamp that the branch was last updated
userIdstringUUID of the user that created the branch
userNamestringThe name of the user that created the branch

List all branches

branches.list(ProjectDescriptor, { filter?: "active" | "archived" | "mine" }): Promise<Branch[]>

List the active branches for a project

abstract.branches.list({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
}, {
  filter: "active"
});

Retrieve a branch

branches.info(BranchDescriptor): Promise<Branch>

Load the info for a specific branch in a project

abstract.branches.info({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master"
});

Changesets

CLI API

A changeset is a group of changes that together form a single, indivisible modification to a project. Changesets include data on all visual and nonvisual changes and provide insight into the differences between two versions of a project.

The changeset object

PropertyTypeDescription
branchIdstringUUID of the branch that this changeset is part of, or the string "master"
changesChangesetChange[]List of changes that make up this changeset
compareToShastringSHA of the commit introducing changes in this changeset
idstringUUID identifier of the changeset
projectIdstringUUID of the project this changeset belongs to
shastringSHA of the base commit in this changeset that changes are against

ChangesetChange

PropertyTypeDescription
typestringType of this change, can be one of file, page, layer, symbol, artboard, colors, gradient, layer-style, text-style
statusstringStatus of this change, can be one of added, deleted, edited, edited-indirectly, none
hasPreviewbooleanIndicates if this change has a visual preview
meta{ [key: string]: [any, any] }Object containing additional information about this change
fileIdstringUUID of the file this change was made against
pageIdstringUUID of the page this change was made against
layerIdstringUUID of the layer this change was made against
colorsIdstringUUID of the color associated with this change
gradientIdstringUUID of the gradient associated with this change
layerStyleIdstringUUID of the layer style associated with this change
textStyleIdstringUUID of the text style associated with this change

Retrieve a changeset

changesets.info(CommitDescriptor): Promise<Changeset>

Load an individual changeset

abstract.changesets.info({
  branchId: "master",
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  sha: "e2a0a301c4a530ec16024cbb339dfc135c841b10"
});

Collections

CLI API

A collection is a set of layers at the same or different commits on a branch, they can be created in the desktop or web app and are used to group work together to communicate a flow, ask for review, or other use cases.

The collection object

PropertyTypeDescription
branchIdstringUUID of the branch that this collection belongs to, or the string "master"
createdAtstringTimestamp that the collection was created
descriptionstringA description of the collection
idstringUUID identifier of the collection
layersCollectionLayer[]An ordered array of collection layers. Note: These are not the same as Layer objects.
namestringThe name of the collection
projectIdstringUUID of the project this commit belongs to
publishedAtstringTimestamp that the collection was published
userUserThe user that created the collection
userIdstringUUID of the user that created the collection

List all collections

collections.list(ProjectDescriptor | BranchDescriptor, { layersPerCollection?: number }): Promise<Collection[]>

List all collections for a branch

abstract.collections.list({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master"
});

Retrieve a collection

collections.info(CollectionDescriptor): Promise<Collection>

Load an individual collection

abstract.collections.info({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  collectionId: "413daa80-1456-11e8-b8b0-4d1fec7ae555"
});

Comments

API

A comment in Abstract can be left on a branch, commit, or layer. Comments on layers can also include an optional annotation that represents a bounding area ontop of the layer, this can be used to leave comments about specific areas.

The comment object

PropertyTypeDescription
annotationAnnotationThe optional bounding box for the comment on the layer
bodystringThe body of the comment
branchIdstringUUID of the branch this comment is on, or the string "master"
commitShastringSHA of the commit this comment was left on
createdAtstringTimestamp of the comment creation time
deletedAtstringTimestamp of the comment deletion time
editedAtstringTimestamp of when the comment was last edited
fileIdstringUUID of the file that this comment is on
idstringUUID identifier of the comment
layerIdstringUUID of the layer that this comment is on
pageIdstringUUID of the page that this comment is on
parentIdstringUUID of the parent comment if this is a reply
projectIdstringUUID of the project that this comment is contained within
replyIdsstring[]An array of comment UUID's that are replies to this comment
reviewStatusstringIf the comment was a review this may be one of APPROVED or REJECTED
updatedAtstringTimestamp of when the comment was last updated
userUserThe user that created the comment
userIdstringUUID of the user this commit was created by

List all comments

comments.list(BranchDescriptor | CommitDescriptor | PageDescriptor | LayerDescriptor): Promise<Comment[]>

List the comments for a specific project

abstract.comments.list({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78"
});

or, list the first two comments for a specific layer...

abstract.comments.list({
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7",
  layerId: "CA420E64-08D0-4B96-B0F7-75AA316B6A19",
  pageId: "7D2D2599-9B3F-49BC-9F86-9D9D532F143A",
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78"
}, { limit: 2 });

Retrieve a comment

comments.info(CommentDescriptor): Promise<Comment>

Load the info for a comment

abstract.comments.info({
  commentId: "616daa90-1736-11e8-b8b0-8d1fec7aef78"
});

Create a comment

comments.create(BranchDescriptor | CommitDescriptor | LayerDescriptor, Comment): Promise<Comment>

Create a comment on a branch

abstract.comments.create({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master"
}, {
  body: "Hello from the Abstract SDK"
});

Or, perhaps create an annotation on a layer…

abstract.comments.create({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7",
  pageId: "7D2D2599-9B3F-49BC-9F86-9D9D532F143A",
  layerId: "CA420E64-08D0-4B96-B0F7-75AA316B6A19",
  sha: "c4e5578c590f5334349b6d7f0dfd4d3882361f1a", // or sha: "latest"
}, {
  body: "Hello from the Abstract SDK",
  annotation: {
    width: 100,
    height: 100,
    x: 300,
    y: 400
  }
});

Note: It's important to ensure that the annotation bounding box is within the dimensions of the layer!

Commits

CLI API

A commit represents a point in time – contributors can create commits in the desktop app to save their work at different stages. When loading data from the Abstract SDK you will almost always need to provide a commit SHA to identify which version of the object you would like.

The commit object

PropertyTypeDescription
descriptionstringThe body of the commit comment
destinationBranchIdstringFor merge commits this points to the merged into branch
destinationBranchNamestringFor merge commits this is the name of the branch that was merged into
fileIdsstring[]For system commits like file upgrades this represents the file UUID's that were changed
parentsstring[]SHA(s) of the parent commits
projectIdstringUUID of the project this commit belongs to
shastringSHA of the hashed content of the commit. This acts as the unique identifer.
sourceBranchIdstringFor merge commits this points to the merged from branch
sourceBranchNamestringFor merge commits this is the name of the branch that was merged from
timestringTimestamp of the commit
titlestringThe title of the commit
typestringThe type of the commit, may be one of NORMAL, PROJECT_CREATED, FILE_ADDED, FILE_RENAMED, FILE_DELETED, FILE_REPLACED, LIBRARY_ADDED, LIBRARY_REMOVED, RESTORE, UPDATE, MERGE
userIdstringUUID of the user this commit was created by
userNamestringDisplay name of the user this commit was created by

Example response

{
  description: "Just eyeballed it."
  destinationBranchId: ""
  destinationBranchName: ""
  fileIds: []
  parents: ["b56da8ffdc66b3c526f7289c175cfbb7cbf20663"]
  projectId: "ab8d54b0-502f-11e6-9379-dd323631859b"
  sha: "c4e5578c590f5334349b6d7f0dfd4d3882361f1a"
  sourceBranchId: ""
  sourceBranchName: ""
  time: "2018-10-19T01:19:08+02:00"
  title: "Tweaked the coloring"
  type: "NORMAL"
  userId: "c95ecfd4-6ed7-4722-9145-d2f02a34f3d7"
  userName: "Tim Van Damme"
}

List all commits

commits.list(BranchDescriptor | LayerDescriptor): Promise<Commit[]>

List the commits for a specific branch

abstract.commits.list({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master"
});

or, get a list of commits for a layer – this query will only return commits where the referenced layer was changed…

abstract.commits.list({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7",
  pageId: "7D2D2599-9B3F-49BC-9F86-9D9D532F143A",
  layerId: "CA420E64-08D0-4B96-B0F7-75AA316B6A19",
  sha: "latest"
});

Retrieve a commit

commits.info (FileDescriptor | LayerDescriptor | CommitDescriptor): Promise<Commit>

Load the commit info for a specific commit SHA on a branch

abstract.commits.info({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  sha: "fb7e9b50da6c330fc43ffb369616f0cd1fa92cc2"
});

Data

CLI API

The data object

PropertyTypeDescription
branchIdstringUUID of the branch that this layer is contained within
fileIdstringUUID of the file that this layer is contained within
layerIdstringUUID of the layer that this data is loaded from
layers{string: LayerData }An object that describes the child layers
projectIdstringUUID of the project that this data is contained within
shastringSHA of the commit where the layer was last changed

LayerData

PropertyTypeDescription
childIdsstring[]Array of UUID's for the layers children, if any
idstringUUID of the chid layer
libraryIdstringUUID of the library file this layer is from
libraryNamestringThe name of the library file this layer is from
parentIdstringUUID of the parent layer, if any
propertiesLayerPropertiesLayer properties (to be documented)
symbolIdstringUUID of the parent symbol, if any
typestringOne of artboard, layer, symbolMaster, symbolInstance, group, text, bitmap, shapeGroup, shapePath, rectangle, oval, polygon, triangle, star, page, slice, hotspot

Retrieve layer data

data.info(LayerDescriptor): Promise<Data>

abstract.data.info({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7",
  pageId: "7D2D2599-9B3F-49BC-9F86-9D9D532F143A",
  layerId: "CA420E64-08D0-4B96-B0F7-75AA316B6A19",
  sha: "c4e5578c590f5334349b6d7f0dfd4d3882361f1a" // or sha: "latest"
});

Files

A file represents a standard file – in Abstract a file is always loaded from a specific commit SHA, or point in time.

CLI API

The file object

PropertyTypeDescription
applicationDocumentVersionnumberThe application (eg Sketch's) version of the file
applicationVersionstringThe version of the application the file was created with
idstringUUID identifier for the file
isLibrarybooleanIs this file a library file or not
lastChangedAtShastringSHA that represents the commit where this file was last changed
namestringThe name of the file
projectIdstringUUID of the project this file belongs to
shastringSHA that this file was loaded at
typestringThe application that the file was created in

List all files

files.list(BranchDescriptor): Promise<File[]>

List the files for a branch at the latest commit

abstract.files.list({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  sha: "latest"
});

Retrieve a file

files.info(FileDescriptor): Promise<File>

Load the file info for the latest commit on a branch

abstract.files.info({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7"
  sha: "latest"
});

You can also load the file info at any commit on the branch…

abstract.files.info({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7",
  sha: "fb7e9b50da6c330fc43ffb369616f0cd1fa92cc2"
});

Layers

CLI API

A layer is a container for designs. In Sketch a layer usually represents an artboard however it can also be a non-contained layer floating on the page.

The layer object

PropertyTypeDescription
fileIdstringUUID of the file that this layer is contained within
heightnumberThe height of the layer in pixels
idstringUUID identifier of the layer
lastChangedAtShastringSHA of the commit where the layer was last changed
libraryIdstringUUID of the library file that this layer was included from
namestringThe name of the layer
ordernumberThe order of the layer in the page
pageIdstringUUID of the page that this layer is contained within
projectIdstringUUID of the project that this layer is contained within
shastringSHA of the commit this layer was loaded at
typestringThe type of the layer, eg "artboard"
updatedAtstringTimestamp of the commit that this layer was last changed
widthnumberThe width of the layer in pixels
xnumberThe horizontal position of the layer on the page, measured from the left
ynumberThe vertical position of the layer on the page, measured from the top

List all layers

layers.list(FileDescriptor | PageDescriptor, { limit?: number, offset?: number }): Promise<Layer[]>

List the layers for a file at a commit

abstract.layers.list({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7",
  sha: "fb7e9b50da6c330fc43ffb369616f0cd1fa92cc2"
});

As a file can contain a lot of layers we recommend filtering by page and adding a limit…

abstract.layers.list({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7",
  pageId: "7D2D2599-9B3F-49BC-9F86-9D9D532F143A",
  sha: "fb7e9b50da6c330fc43ffb369616f0cd1fa92cc2"
}, {
  limit: 25,
  offset: 0
});

Retrieve a layer

layers.info(LayerDescriptor): Promise<Layer>

Load the info for a layer in a file at the latest commit on a branch

abstract.layers.info({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7",
  pageId: "7D2D2599-9B3F-49BC-9F86-9D9D532F143A",
  layerId: "CA420E64-08D0-4B96-B0F7-75AA316B6A19",
  sha: "latest"
});

Notifications

API

A notification is a user-facing message triggered by an underlying activity. Notifications are both viewable and dismissable in the desktop application.

The notification object

PropertyTypeDescription
branchIdstringUUID of the branch that triggered this notification, if applicable
commentIdstringUUID of the comment that triggered this notification, if applicable
createdAtstringTimestamp at which the notification was sent
idstringUUID identifier of the notification
initiatingUserUserUser that triggered this notification, if applicable
initiatingUserIdstringUUID of the user that triggered this notification, if applicable
messageTypestringThe type of this activity that triggered this notification, may be one of BRANCH_ARCHIVED, BRANCH_CREATED, BRANCH_DELETED, BRANCH_DESCRIPTION_UPDATED, BRANCH_RENAMED, BRANCH_STATUS_UPDATED, BRANCH_UNARCHIVED, COLLECTION_PUBLISHED, COMMENT_CREATED, COMMIT, MERGE_COMMIT, PROJECT_ARCHIVED, PROJECT_CREATED, PROJECT_DELETED, PROJECT_DESCRIPTION_CHANGED, PROJECT_RENAMED, PROJECT_TRANSFERRED, PROJECT_UNARCHIVED, REVIEWER_REMOVED, REVIEW_COMPLETED, REVIEW_DISMISSED, REVIEW_REQUESTED, UPDATE_COMMIT
organizationstringOrganization that triggered this notification, if applicable
organizationIdstringUUID of the organization that triggered this notification, if applicable
projectstringProject that triggered this notification, if applicable
projectIdstringUUID of the project that triggered this notification, if applicable
payloadObjectObject containing information specific to activity that triggered this notification
readAtstringTimestamp at which the notification was read or dismissed

List notifications

notifications.list(OrganizationDescriptor, { limit?: number, offset?: number }): Promise<Notification[]>

List the first two notifications for a given organization

abstract.notifications.list({
  organizationId: "8a13eb62-a42f-435f-b3a3-39af939ad31b"
}, { limit: 2 });

Retrieve a notification

notifications.info(NotificationDescriptor): Promise<Notification>

Load the info for a notification

abstract.notifications.info({
  notificationId: "616daa90-1736-11e8-b8b0-8d1fec7aef78"
});

Organizations

API

Organizations contain users and projects.

The organization object

PropertyTypeDescription
createdAtstringTimestamp that the organization was created
hasBillingInfobooleanWhether this organization has billing information on file
idstringUUID
isUsernameOrganizationbooleanA username organization is a free organization included with every user account
isWithinSubscriptionTermbooleanWhether the organizations subscription is in good standing
logoUrlstringA url for the organization logo
namestringThe name of the organization
restrictedToDomainsstring[]An optional list of domain names that invitations to this organization are restricted to
trialEndsAtstringTimestamp of when the trial ends, if within trial period
updatedAtstringTimestamp that the organization was last updated
userIdstringUUID of the user that created the organization

List all organizations

organizations.list(): Promise<Organization[]>

Load the organizations accessible by the current access token

abstract.organizations.list();

Retrive an organization

Not yet implemented

Pages

A page is a container for layers, often a file will have several pages to organize design work.

CLI API

The page object

PropertyTypeDescription
fileIdstringUUID of the file that this page is contained within
idstringUUID identifier for the page
namestringThe name of the page
ordernumberThe order of the page in the file
projectIdstringUUID of the project this page belongs to
shastringSHA of the commit this page was loaded at
typestringThis field has the value "library" for virtual library pages

List all pages

pages.list(FileDescriptor): Promise<Page[]>

List the pages for a file at a commit

abstract.pages.list({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7",
  sha: "fb7e9b50da6c330fc43ffb369616f0cd1fa92cc2"
});

Retrieve a page

pages.info(PageDescriptor): Promise<Page>

Load the info for a page in a file at the latest commit on a branch

abstract.pages.info({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7",
  pageId: "7D2D2599-9B3F-49BC-9F86-9D9D532F143A"
});

Previews

API

A preview is an image file that represents the rendered version of a layer. In Abstract all previews are currently only available in PNG format.

The preview object

PropertyTypeDescription
webUrlstringA url to where this preview can be loaded in the Abstract web app

Retrieve an image file

previews.raw(LayerDescriptor): Promise<ArrayBuffer>

Load the preview image for a layer at a commit. The resulting Buffer can be used with node fs API's – for example you can write the image to disk:

const buffer = await abstract.previews.raw({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7",
  pageId: "7D2D2599-9B3F-49BC-9F86-9D9D532F143A",
  layerId: "CA420E64-08D0-4B96-B0F7-75AA316B6A19",
  sha: "c4e5578c590f5334349b6d7f0dfd4d3882361f1a" // or sha: "latest"
});

fs.writeFile(`preview.png`, buffer, (err) => {
  if (err) throw err;
  console.log("Preview image written!");
});

Retrieve a preview

previews.info(LayerDescriptor): Promise<Preview>

Load the info for a layer preview

abstract.previews.info({
  projectId: "616daa90-1736-11e8-b8b0-8d1fec7aef78",
  branchId: "master",
  fileId: "51DE7CD1-ECDC-473C-B30E-62AE913743B7",
  pageId: "7D2D2599-9B3F-49BC-9F86-9D9D532F143A",
  layerId: "CA420E64-08D0-4B96-B0F7-75AA316B6A19",
  sha: "c4e5578c590f5334349b6d7f0dfd4d3882361f1a" // or sha: "latest"
});

Projects

API

A project is a container for files, it belongs to an organization. Teams use projects to logically separate their files for example for a project, a platform (e.g. Web / iOS), or by client.

The project object

PropertyTypeDescription
aboutstringA longer description of the project (May optionally include markdown tags)
archivedAtstringTimestamp that the project was archived
colorstringA hex value that represents a custom project color
createdAtstringTimestamp that the project was created
createdByUserUserThe user that created the project
descriptionstringA longer summary of the project
firstPushedAtstringTimestamp that the project first received data
idstringUUID
namestringThe name of the project
organizationIdstringUUID of the organization this project belongs to
pushedAtstringTimestamp that data was last received
repoCreatedAtstringTimestamp that the backend storage was created
sizeInBytesnumberThe size of the project on disk in bytes
updatedAtstringTimestamp that the project was last updated
visibilitystringEither "organization" for a team project, or "specific" for a private project

List all projects

projects.list(OrganizationDescriptor?): Promise<Project[]>

List all projects accessible through the current authentication

abstract.projects.list();

or, get a list of projects for a specific organization…

abstract.projects.list({
  organizationId: "616daa90-1736-11e8-b8b0-8d1fec7aef78"
});

Retrieve a project

Not yet implemented

Shares

API

A share is a shareable url to an object in Abstract. You can use the desktop or web app to create a share url.

Note: The format of a share url is https://share.goabstract.com/<UUID>.

The share object

PropertyTypeDescription
descriptorDescriptorA descriptor for the shared object
appUrlstringA url that can be used to open the desktop app
userIdstringUUID of the user that created the share
idstringUUID

Note: The descriptor property can be used as the first argument for many of the SDK methods

Load info for a share

shares.info(ShareDescriptor): Promise<Share>

abstract.shares.info({
  url: 'https://share.goabstract.com/49b1f582-a8b4-46ca-8c86-bbc675fe27c4'
});

or, by id…

abstract.shares.info({
  shareId: '49b1f582-a8b4-46ca-8c86-bbc675fe27c4'
});

Using share.descriptor

List all files for branch's share url

const branchShare = await abstract.share.info({
  url: 'https://share.goabstract.com/49b1f582-a8b4-46ca-8c86-bbc675fe27c4'
})

const branchFiles = await abstract.files.list(branchShare.descriptor);

Descriptors

Reference for the parameters required to load resources with Abstract SDK.

OrganizationDescriptor

{ organizationId: string }

ProjectDescriptor

{ projectId: string }

ShareDescriptor

{ url: string } | { shareId: string }

BranchDescriptor

{
  projectId: string,
  branchId: string | "master"
}

CommitDescriptor

{
  projectId: string,
  branchId: string | "master",
  sha: string
}

FileDescriptor

{
  projectId: string,
  branchId: string | "master",
  fileId: string,
  sha: string | "latest"
}

PageDescriptor

{
  projectId: string,
  branchId: string | "master",
  fileId: string,
  pageId: string,
  sha: string
}

LayerDescriptor

{
  projectId: string,
  branchId: string | "master",
  fileId: string,
  pageId: string,
  layerId: string,
  sha: string | "latest"
}

CollectionDescriptor

{
  projectId: string,
  branchId: string | "master",
  collectionId: string
}

ActivityDescriptor

{ activityId: string }

NotificationDescriptor

{ notificationId: string }

CommentDescriptor

{
 commentId: string
}
← AuthenticationSketch →
  • Activities
    • The activity object
    • List all activities
    • Retrieve an activity
  • Branches
    • The branch object
    • List all branches
    • Retrieve a branch
  • Changesets
    • The changeset object
    • Retrieve a changeset
  • Collections
    • The collection object
    • List all collections
    • Retrieve a collection
  • Comments
    • The comment object
    • List all comments
    • Retrieve a comment
    • Create a comment
  • Commits
    • The commit object
    • List all commits
    • Retrieve a commit
  • Data
    • The data object
    • Retrieve layer data
  • Files
    • The file object
    • List all files
    • Retrieve a file
  • Layers
    • The layer object
    • List all layers
    • Retrieve a layer
  • Notifications
    • The notification object
    • List notifications
    • Retrieve a notification
  • Organizations
    • The organization object
    • List all organizations
    • Retrive an organization
  • Pages
    • The page object
    • List all pages
    • Retrieve a page
  • Previews
    • The preview object
    • Retrieve an image file
    • Retrieve a preview
  • Projects
    • The project object
    • List all projects
    • Retrieve a project
  • Shares
    • The share object
    • Load info for a share
    • Using share.descriptor
  • Descriptors
    • OrganizationDescriptor
    • ProjectDescriptor
    • ShareDescriptor
    • BranchDescriptor
    • CommitDescriptor
    • FileDescriptor
    • PageDescriptor
    • LayerDescriptor
    • CollectionDescriptor
    • ActivityDescriptor
    • NotificationDescriptor
    • CommentDescriptor
Copyright © 2018 Elastic Projects