UNPKG

mattermost-redux

Version:

Common code (API client, Redux stores, logic, utility functions) for building a Mattermost client

61 lines (60 loc) 2.62 kB
"use strict"; // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. Object.defineProperty(exports, "__esModule", { value: true }); exports.getCloudSubscription = getCloudSubscription; exports.getCloudProducts = getCloudProducts; exports.getCloudCustomer = getCloudCustomer; exports.getInvoices = getInvoices; exports.updateCloudCustomer = updateCloudCustomer; exports.updateCloudCustomerAddress = updateCloudCustomerAddress; const action_types_1 = require("mattermost-redux/action_types"); const client_1 = require("mattermost-redux/client"); const helpers_1 = require("./helpers"); function getCloudSubscription() { return (0, helpers_1.bindClientFunc)({ clientFunc: client_1.Client4.getSubscription, onSuccess: [action_types_1.CloudTypes.RECEIVED_CLOUD_SUBSCRIPTION], onFailure: action_types_1.CloudTypes.CLOUD_SUBSCRIPTION_FAILED, onRequest: action_types_1.CloudTypes.CLOUD_SUBSCRIPTION_REQUEST, }); } function getCloudProducts(includeLegacyProducts) { return (0, helpers_1.bindClientFunc)({ clientFunc: client_1.Client4.getCloudProducts, onSuccess: [action_types_1.CloudTypes.RECEIVED_CLOUD_PRODUCTS], onFailure: action_types_1.CloudTypes.CLOUD_PRODUCTS_FAILED, onRequest: action_types_1.CloudTypes.CLOUD_PRODUCTS_REQUEST, params: [includeLegacyProducts], }); } function getCloudCustomer() { return (0, helpers_1.bindClientFunc)({ clientFunc: client_1.Client4.getCloudCustomer, onSuccess: [action_types_1.CloudTypes.RECEIVED_CLOUD_CUSTOMER], onFailure: action_types_1.CloudTypes.CLOUD_CUSTOMER_FAILED, onRequest: action_types_1.CloudTypes.CLOUD_CUSTOMER_REQUEST, }); } function getInvoices() { return (0, helpers_1.bindClientFunc)({ clientFunc: client_1.Client4.getInvoices, onSuccess: [action_types_1.CloudTypes.RECEIVED_CLOUD_INVOICES], onFailure: action_types_1.CloudTypes.CLOUD_INVOICES_FAILED, onRequest: action_types_1.CloudTypes.CLOUD_INVOICES_REQUEST, }); } function updateCloudCustomer(customerPatch) { return (0, helpers_1.bindClientFunc)({ clientFunc: client_1.Client4.updateCloudCustomer, onSuccess: [action_types_1.CloudTypes.RECEIVED_CLOUD_CUSTOMER], params: [customerPatch], }); } function updateCloudCustomerAddress(address) { return (0, helpers_1.bindClientFunc)({ clientFunc: client_1.Client4.updateCloudCustomerAddress, onSuccess: [action_types_1.CloudTypes.RECEIVED_CLOUD_CUSTOMER], params: [address], }); }