← back to Pattern Vault

wpb-uploaders/platforms/creativemarket.js

19 lines

/* Creative Market uploader — brand: Wallpaper's Back · email info@wallpapersback.com
 * DISARMED. Digital seamless-pattern packs. Needs a captured login session +
 * live DOM calibration of the upload form before arming (Steve-gated). */
const path = require('path'), os = require('os');
module.exports = {
  key: 'creativemarket', name: 'Creative Market', brand: "Wallpaper's Back",
  sessionFile: path.join(os.homedir(), 'Projects/pattern-vault/wpb-uploaders/sessions/creativemarket-state.json'),
  healthUrl: 'https://creativemarket.com/account',
  uploadUrl: 'https://creativemarket.com/shops/products/new',
  // Returns {id,url} on real success, else {reason} → fail-loud. TODO: calibrate against live DOM.
  async uploadFn(pg, d, { rnd, sleep }) {
    await pg.goto(this.uploadUrl, { waitUntil: 'domcontentloaded', timeout: 45000 }).catch(() => {});
    await sleep(rnd(2500, 4500));
    // NOT YET CALIBRATED — refuse to false-green. Real steps (file, title, category,
    // "Includes AI-generated assets" checkbox, price, publish) go here once armed + watched.
    return { reason: 'creativemarket uploadFn not yet calibrated — DISARMED stub (needs live DOM + Steve arm)' };
  },
};