BaileysEx.Feature.Business (baileys_ex v0.1.0-alpha.9)

Copy Markdown View Source

Business helpers mapped from Baileys' business.ts.

Summary

Functions

Fetch the product catalog for a business.

Fetch order details via the thrift IQ namespace.

Create a business product.

Delete products from the catalog.

Remove the business cover photo.

Update the business profile mutation payload.

Upload and set the business cover photo.

Functions

get_catalog(conn, opts \\ [])

@spec get_catalog(
  term(),
  keyword()
) :: {:ok, map()} | {:error, term()}

Fetch the product catalog for a business.

get_collections(conn, jid \\ nil, limit \\ 51, opts \\ [])

@spec get_collections(term(), String.t() | nil, pos_integer(), keyword()) ::
  {:ok, map()} | {:error, term()}

Fetch business catalog collections.

get_order_details(conn, order_id, token, opts \\ [])

@spec get_order_details(term(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:error, term()}

Fetch order details via the thrift IQ namespace.

product_create(conn, product, opts \\ [])

@spec product_create(term(), map(), keyword()) :: {:ok, map()} | {:error, term()}

Create a business product.

product_delete(conn, product_ids, opts \\ [])

@spec product_delete(term(), [String.t()], keyword()) ::
  {:ok, %{deleted: non_neg_integer()}} | {:error, term()}

Delete products from the catalog.

product_update(conn, product_id, updates, opts \\ [])

@spec product_update(term(), String.t(), map(), keyword()) ::
  {:ok, map()} | {:error, term()}

Update a business product.

remove_cover_photo(conn, cover_id, opts \\ [])

@spec remove_cover_photo(term(), String.t(), keyword()) ::
  {:ok, BaileysEx.BinaryNode.t()} | {:error, term()}

Remove the business cover photo.

update_business_profile(conn, profile_data, opts \\ [])

@spec update_business_profile(term(), map(), keyword()) ::
  {:ok, BaileysEx.BinaryNode.t()} | {:error, term()}

Update the business profile mutation payload.

update_cover_photo(conn, photo, opts \\ [])

@spec update_cover_photo(term(), term(), keyword()) ::
  {:ok, String.t()} | {:error, term()}

Upload and set the business cover photo.