Skip to content

hailer.workspace

Read and (for private apps) create workspaces. Results depend on app kind.

MethodHost opReturns
current()workspace.currentPromise<Workspace | null>
list()workspace.listPromise<Workspace[]>
create(name)workspace.createPromise<{ _id: string; name: string }>

current()

The workspace the app is acting in.

ts
const ws = await hailer.workspace.current();
  • Workspace app — the workspace the app is locked to.
  • Private app — the user's currently-active workspace, or null if none is active.

list()

ts
const workspaces = await hailer.workspace.list();
  • Workspace app — a single-element array with the app's workspace.
  • Private app — all workspaces the user belongs to, sorted by name.

create(name)

ts
const ws = await hailer.workspace.create('New workspace');

Private apps only. In a workspace app this is rejected with a 403. Returns the new workspace's { _id, name }.

hailer.workspace.product

Marketplace/template lookups scoped to workspaces.

MethodHost opReturns
publishTemplate(template)workspace.product.publishTemplatePromise<ProductVersion>
isProductInstalled(id, workspaceId)workspace.product.isProductInstalledPromise<boolean>
get(id)workspace.product.getPromise<ProductVersion | undefined>
install(productId, workspaceId)workspace.product.installPromise<boolean>
getManifest(id)workspace.product.getManifestPromise<any>

publishTemplate takes { workspaceId?, versionId?, version, versionDescription, title, description }.

Hailer Developer Documentation