Appearance
hailer.product
Create and manage your own marketplace products.
| Method | Host op | Returns |
|---|---|---|
list(filter?, options?) | product.list | Promise<ProductListResponse> |
get(id) | product.get | Promise<Product | undefined> |
create(product) | product.create | Promise<Product> |
update(id, product) | product.update | Promise<Product> |
remove(id) | product.remove | Promise<boolean> |
setPublic(id, isPublic) | product.setPublic | Promise<boolean> |
list(filter?, options?)
ts
const { products, totalCount } = await hailer.product.list(
{ type: 'app' },
{ limit: 20 },
);filter is a ProductSearchFilter; options a ProductSearchOption.
get(id)
ts
const product = await hailer.product.get(productId);create(product)
ts
const product = await hailer.product.create({
name: 'My App',
description: 'Does a thing',
type: 'app',
});Accepts { targetId?, name, description?, icon?, images?, externalUrl?, publisher?, type? }.
update(id, product)
ts
await hailer.product.update(productId, { description: 'Updated', public: true });Accepts a partial of the create fields except targetId, plus public?: boolean.
setPublic(id, isPublic)
ts
await hailer.product.setPublic(productId, true);Related
For public (logged-out) marketplace reads, see hailer.public.product.