const JellyVideoApiAdapter = (credential) => {
  return {
    createMeeting: async (event) => {
      const keys = credential.key;
      const { access_token } = keys;
      const jellyLink = await fetch("https://www.jellyjelly.com/api/ti/start_jelly", {
        method: "POST",
        headers: {
          Authorization: `Bearer ${access_token}`,
          "Content-Type": "application/json"
        }
      });
      const jellyLinkData = await jellyLink.json();
      return {
        type: "jelly_conferencing",
        id: jellyLinkData.talkId,
        password: "",
        url: jellyLinkData.url
      };
    },
    updateMeeting: async (bookingRef, event) => {
      return {
        type: "jelly_conferencing",
        id: bookingRef.externalCalendarId ? bookingRef.externalCalendarId : "",
        password: "",
        url: bookingRef.meetingUrl ? bookingRef.meetingUrl : ""
      };
    },
    deleteMeeting: async (uid) => {
      return {};
    },
    getAvailability: async (dateFrom, dateTo) => {
      return [];
    }
  };
};
export {
  JellyVideoApiAdapter as default
};
