Appearance
hailer.workspace
Read and (for private apps) create workspaces. Results depend on app kind.
| Method | Host op | Returns |
|---|---|---|
current() | workspace.current | Promise<Workspace | null> |
list() | workspace.list | Promise<Workspace[]> |
create(name) | workspace.create | Promise<{ _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
nullif 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.
| Method | Host op | Returns |
|---|---|---|
publishTemplate(template) | workspace.product.publishTemplate | Promise<ProductVersion> |
isProductInstalled(id, workspaceId) | workspace.product.isProductInstalled | Promise<boolean> |
get(id) | workspace.product.get | Promise<ProductVersion | undefined> |
install(productId, workspaceId) | workspace.product.install | Promise<boolean> |
getManifest(id) | workspace.product.getManifest | Promise<any> |
publishTemplate takes { workspaceId?, versionId?, version, versionDescription, title, description }.