UNPKG

askai-img

Version:

AI Art Generation Tool

29 lines (28 loc) 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.StylesService = void 0; class StylesService { async getCustomStyles() { const response = await fetch('https://raw.githubusercontent.com/Vauth/custom/main/styles.json'); return await response.json(); } async getAllStyles() { const response = await fetch('https://paint.api.wombo.ai/api/styles'); const apiStyles = await response.json(); const customStyles = await this.getCustomStyles(); const styles = { ...Object.entries(customStyles).reduce((acc, [key, value]) => { acc[key] = value.id; return acc; }, {}), ...apiStyles.reduce((acc, style) => { if (!style.is_premium) { acc[style.name] = style.id; } return acc; }, {}) }; return styles; } } exports.StylesService = StylesService;