@point-api/js-sdk
Version:
Javascript SDK for Point API
24 lines • 714 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/** Class to manage user's Account */
class AccountApiModule {
constructor(api) {
this.url = "/account";
this.api = api;
}
async get() {
return (await this.authFetch("GET")).json();
}
async setPreference(preference) {
return this.authFetch("PUT", preference);
}
/** Make authenticated request to interactions api */
authFetch(method, data) {
const headers = {
"Content-Type": "application/json"
};
return this.api.authFetch(method, this.url, data, headers);
}
}
exports.default = AccountApiModule;
//# sourceMappingURL=account.js.map