@tokens-studio/sdk
Version:
The official SDK for Tokens Studio
26 lines • 825 B
JavaScript
import { tasks } from '@tokens-studio/cli-kit';
import { error } from '../utils/messages.js';
import { getThemes } from '../utils/queries.js';
import { fetchPaginatedData } from '../utils/fetch-paginated-data.js';
export async function fetchThemes(client, config) {
let themes = [];
await tasks({
start: 'Fetching themes data',
end: 'Done!',
}, [
{
pending: 'themes',
start: 'Getting themes',
end: 'Fetched themes',
while: async () => {
themes = await fetchPaginatedData(client, getThemes, { ...config, branch: config.branch ?? 'main' });
},
onError(e) {
error(e);
throw e;
},
},
]);
return themes;
}
//# sourceMappingURL=fetch-themes.js.map