UNPKG

@arc-publishing/sdk-amp

Version:
26 lines 935 B
import { __assign } from "tslib"; import { isAPIErrorResponse } from '@arc-publishing/sdk-subs-core/lib/utils/APIErrorResponse'; import JSONResponseHandler from '@arc-publishing/sdk-subs-core/lib/utils/JSONResponseHandler'; import { getValidURL } from './utils'; import AMP from './amp'; import { headers } from './constants'; export default function logoutAMPReaderID(ampReaderId) { var url = typeof window !== 'undefined' ? getValidURL(AMP.apiOrigin) : AMP.apiOrigin; return fetch("".concat(url, "/sales/public/v1/amp/logout"), { method: 'PUT', headers: __assign({}, headers), body: JSON.stringify({ ampReaderId: ampReaderId }) }) .then(JSONResponseHandler) .then(function (json) { if (isAPIErrorResponse(json)) { throw json; } else { return json; } }); } //# sourceMappingURL=logoutAMPReaderID.js.map