UNPKG

@mft/moneyhub-api-client

Version:
42 lines 1.71 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = ({ config, request }) => { const { resourceServerUrl } = config; return { getNotificationThresholds: async ({ userId, accountId }, options) => request(`${resourceServerUrl}/accounts/${accountId}/notification-thresholds`, { cc: { scope: "accounts:read", sub: userId, }, options, }), addNotificationThreshold: async ({ userId, accountId, threshold }, options) => request(`${resourceServerUrl}/accounts/${accountId}/notification-thresholds`, { method: "POST", cc: { scope: "accounts:read accounts:write", sub: userId, }, options, body: threshold, }), updateNotificationThreshold: async ({ userId, accountId, thresholdId, threshold }, options) => request(`${resourceServerUrl}/accounts/${accountId}/notification-thresholds/${thresholdId}`, { method: "PATCH", cc: { scope: "accounts:read accounts:write", sub: userId, }, options, body: threshold, }), deleteNotificationThreshold: async ({ userId, accountId, thresholdId }, options) => request(`${resourceServerUrl}/accounts/${accountId}/notification-thresholds/${thresholdId}`, { method: "DELETE", cc: { scope: "accounts:read accounts:write", sub: userId, }, options, returnStatus: true, }), }; }; //# sourceMappingURL=notification-thresholds.js.map