@arc-publishing/sdk-amp
Version:
Arc AMP SDK to work with Google AMP Pages
26 lines • 935 B
JavaScript
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