UNPKG

@onereach/orest-input-cli

Version:

The tool for creating, serving, and publishing OREST Inputs

29 lines (23 loc) 520 B
const StoreApi = require('./api/storeApi'); async function isPublished( { id, version, userToken, storeApiUrl, packageType }, { storeApi } = {} ) { let storeApiLocal = storeApi; if (!storeApi) { storeApiLocal = new StoreApi({ userToken, storeApiUrl, packageType, }); } try { return await storeApiLocal.getMetaByVersion({ id, version }); } catch (error) { if (/Not Found/gi.test(error)) { return false; } throw error; } } module.exports = isPublished;