@upstart.gg/sdk
Version:
You can test the CLI without recompiling by running:
23 lines (21 loc) • 894 B
JavaScript
import { UnauthorizedError } from "../../../../errors.js";
import fetcher_default$1 from "../account/fetcher.js";
//#region src/shared/datasources/external/mastodon/status/fetcher.ts
const fetchMastodonStatus = async ({ options, pageAttributes: attr }) => {
const account = await fetcher_default$1({
options: { username: options.username },
pageAttributes: attr,
oauth: null
});
const url = `https://${new URL(account.url).host}/api/v1/accounts/${account.id}/statuses`;
const response = await fetch(url);
if (!response.ok) {
if (response.status === 401) throw new UnauthorizedError(`fetchMastodonStatus Error: Unauthorized.`);
throw new Error(`fetchMastodonStatus Error: Response status: ${response.status}`);
}
return await response.json();
};
var fetcher_default = fetchMastodonStatus;
//#endregion
export { fetcher_default as default };
//# sourceMappingURL=fetcher.js.map