UNPKG

@gameroom/cli

Version:

A command line tool for Gameroom

15 lines (13 loc) 566 B
const axios = require('axios'), cosmetic = require('cosmetic'), { tryRepeatedly } = require('../../helpers'), { shopify, spinner } = require('../../refs') module.exports = class Order { constructor() {} static async get({ limit, since_id }) { const result = await tryRepeatedly(() => shopify.get('/orders.json', { params: { status: 'any', limit, since_id } }), (err) => spinner.warn(`error getting ${cosmetic.green('orders')} since ${since_id} ${err}`)) return result && result.data && result.data.orders ? result.data.orders : [] } }