ThanklyCatalog

class ThanklyCatalog(config: ThanklyConfig, engine: HttpEngine = OkHttpEngine())

Catalog reads and asset uploads.

A server-side surface, authenticated with the org credential on X-Authorization. Responses are returned as raw JSON: catalog and product shapes are partner-configurable and evolve independently, so fixed classes here would be a drift liability rather than a convenience.

Constructors

Link copied to clipboard
constructor(config: ThanklyConfig, engine: HttpEngine = OkHttpEngine())

Functions

Link copied to clipboard
suspend fun catalog(slug: String): JsonObject

Read a catalog's metadata by slug.

Link copied to clipboard
suspend fun presignUpload(filename: String, contentType: String): JsonObject

Get a presigned URL for uploading an asset.

Link copied to clipboard
suspend fun product(slug: String, productId: String): JsonObject

Read one product.

Link copied to clipboard
suspend fun products(slug: String, limit: Int = 50, offset: Int = 0): JsonObject

Page through a catalog's products.

Link copied to clipboard
suspend fun uploadTo(presignedUrl: String, bytes: ByteArray, contentType: String)

Upload bytes to a URL from presignUpload.