export type UpdateEcommerceAppDto = {name?: string | undefined, description?: string | undefined, logo_url?: string | undefined, website_url?: (string | null) | undefined, developer_name?: string | undefined, contact_email?: string | undefined, contact_phone?: string | undefined, oauth: {authorize_url?: string | undefined, token_url?: string | undefined, client_id?: string | undefined, client_secret?: string | undefined, scopes?: Array | undefined, account_info_url?: string | undefined}, capabilities: {inbound_events?: (Array<'order' | 'checkout' | 'fulfillment' | 'product'>) | undefined, outbound?: ({products_list?: {url: string} | undefined, order_get?: {url: string} | undefined, stock_get?: {url: string} | undefined, checkout_create?: {url: string} | undefined, customer_get?: {url: string} | undefined}) | undefined}}; export type PatchApiApiEcommerceAppIdArgs = {id: string, body: UpdateEcommerceAppDto}; export type PatchApiApiEcommerceAppIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an app * * PATCH /api/ecommerce-app/{id} */ export const patchApiApiEcommerceAppId = async (args: PatchApiApiEcommerceAppIdArgs, options?: PatchApiApiEcommerceAppIdOptions) => { const {baseUrl = "https://api.vambe.me", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/api/ecommerce-app/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };