UNPKG

mpp-sdk

Version:

SDK to talk to the Memento Payments Platform

55 lines (54 loc) 1.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const base_1 = require("./base"); class DevicesEndpoint extends base_1.BaseEndpoint { getById(id) { return this.doRequest({ url: `/devices/${id}`, method: "GET", }); } update(deviceId, data) { return this.doRequest({ url: `/devices/${deviceId}`, method: "PUT", data, }); } /** * createToken creates and attaches a device token to the device * associated with the authentication token used which is used for * e.g. push notifications. * @param data */ createToken(data) { return this.doRequest({ url: `/devices/tokens`, method: "POST", data, }); } /** * Sets the device key for the device associated with the authentication * token used. * @param data */ setDeviceKey(data) { return this.doRequest({ url: "/devices/key", method: "PUT", data, }); } /** * Gets the device key for the device associated with the authentication * token used. */ getDeviceKey() { return this.doRequest({ url: "/devices/key", method: "GET", }); } } exports.default = DevicesEndpoint;