'use strict';

const apiClient = require('./api-client-00edc9b6.js');

class BenefitsApi {
  async getBenefitsAsync() {
    return apiClient.BackendApiClient.instance.url(`benefits`).get().json();
  }
  async postDocumentAsync(req) {
    return apiClient.BackendApiClient.instance
      .url(`document`)
      .formData(req)
      .post()
      .badRequest(() => {
      throw new Error('Failed to upload document');
    })
      .json();
  }
  async postIconAsync(req) {
    return apiClient.BackendApiClient.instance
      .url(`icon`)
      .formData(req)
      .post()
      .badRequest(() => {
      throw new Error('Failed to upload icon');
    })
      .json();
  }
  async getShopifyUrl() {
    return apiClient.BackendApiClient.instance.url(`shopify-url`).get().json();
  }
}
const benefitsApi = new BenefitsApi();

exports.benefitsApi = benefitsApi;
