@mx-cartographer/common
Advanced tools
Comparing version 0.4.2-alpha to 0.4.3-alpha
@@ -50,6 +50,3 @@ "use strict"; | ||
return __generator(this, function (_a) { | ||
return [2 /*return*/, this.fetchInstance.post(ApiEndpoints_1.ApiEndpoints.LOCALIZED_COPY, req) | ||
.then(function (data) { return data; })["catch"](function (err) { | ||
return "something bad happened, ".concat(err); | ||
})]; | ||
return [2 /*return*/, this.fetchInstance.post(ApiEndpoints_1.ApiEndpoints.LOCALIZED_COPY, req).then(function (data) { return data; })]; | ||
}); | ||
@@ -56,0 +53,0 @@ }); }; |
@@ -30,2 +30,3 @@ export { AccountFilter } from './components/accountfilter/AccountFilter'; | ||
export { CategoryStore } from './stores/CategoryStore'; | ||
export { LocalizedCopyStore } from './stores/LocalizedCopyStore'; | ||
export { MerchantStore } from './stores/MerchantStore'; | ||
@@ -32,0 +33,0 @@ export { ScheduledPaymentStore } from './stores/ScheduledPaymentStore'; |
@@ -14,3 +14,3 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.useCombineEvents = exports.analyticsSession = exports.TransactionTypes = exports.TransactionStatus = exports.ColumnWidths = exports.ITERATION_ITEM_TYPES = exports.PLAN_TYPES = exports.LOADING_STATUS = exports.DATE_FORMATTING = exports.RECURRENCE_TYPES = exports.RangeTypes = exports.GeneralDateRangeTypes = exports.GeneralDateRangeTypeMap = exports.CategoryGuids = exports.CategoryGuidToName = exports.CategoryColors = exports.CalendarMonths = exports.CalendarDays = exports.ApiEndpoints = exports.ACCOUNT_TYPES = exports.AccountTypeNames = exports.UserStore = exports.TransactionStore = exports.ScheduledPaymentStore = exports.MerchantStore = exports.CategoryStore = exports.AccountStore = exports.UserApi = exports.TransactionApi = exports.SpendingPlanApi = exports.ScheduledPaymentApi = exports.MerchantApi = exports.LocalizedCopyApi = exports.CategoryApi = exports.AnalyticsApi = exports.AccountApi = exports.Scrim = exports.NewDrawer = exports.Drawer = exports.DateRangePickerDrawer = exports.DateRangePicker = exports.DateRangeControls = exports.Calendar = exports.AccountFilter = void 0; | ||
exports.useCombineEvents = exports.analyticsSession = exports.TransactionTypes = exports.TransactionStatus = exports.ColumnWidths = exports.ITERATION_ITEM_TYPES = exports.PLAN_TYPES = exports.LOADING_STATUS = exports.DATE_FORMATTING = exports.RECURRENCE_TYPES = exports.RangeTypes = exports.GeneralDateRangeTypes = exports.GeneralDateRangeTypeMap = exports.CategoryGuids = exports.CategoryGuidToName = exports.CategoryColors = exports.CalendarMonths = exports.CalendarDays = exports.ApiEndpoints = exports.ACCOUNT_TYPES = exports.AccountTypeNames = exports.UserStore = exports.TransactionStore = exports.ScheduledPaymentStore = exports.MerchantStore = exports.LocalizedCopyStore = exports.CategoryStore = exports.AccountStore = exports.UserApi = exports.TransactionApi = exports.SpendingPlanApi = exports.ScheduledPaymentApi = exports.MerchantApi = exports.LocalizedCopyApi = exports.CategoryApi = exports.AnalyticsApi = exports.AccountApi = exports.Scrim = exports.NewDrawer = exports.Drawer = exports.DateRangePickerDrawer = exports.DateRangePicker = exports.DateRangeControls = exports.Calendar = exports.AccountFilter = void 0; | ||
// Common Components | ||
@@ -57,2 +57,4 @@ var AccountFilter_1 = require("./components/accountfilter/AccountFilter"); | ||
__createBinding(exports, CategoryStore_1, "CategoryStore"); | ||
var LocalizedCopyStore_1 = require("./stores/LocalizedCopyStore"); | ||
__createBinding(exports, LocalizedCopyStore_1, "LocalizedCopyStore"); | ||
var MerchantStore_1 = require("./stores/MerchantStore"); | ||
@@ -59,0 +61,0 @@ __createBinding(exports, MerchantStore_1, "MerchantStore"); |
import { LocalizedCopyApi } from '../api/LocalizedCopyApi'; | ||
import type { LocalizedCopy } from '../types/LocalizedCopy'; | ||
import type { LocalizedCopy, LocalizedCopyRequest } from '../types/LocalizedCopy'; | ||
export declare class LocalizedCopyStore { | ||
api: LocalizedCopyApi; | ||
localizedCopy: LocalizedCopy[]; | ||
api: LocalizedCopyApi | null; | ||
constructor(); | ||
initialize: (api: LocalizedCopyApi) => Promise<void>; | ||
getLocalizedCopy: (req: LocalizedCopy[]) => Promise<void>; | ||
initialize: (api: LocalizedCopyApi, feature_namespace: string, staticCopyKeys: any) => Promise<void>; | ||
getLocalizedCopy: (req: LocalizedCopyRequest[]) => Promise<void>; | ||
} |
@@ -41,12 +41,23 @@ "use strict"; | ||
var mobx_1 = require("mobx"); | ||
var LocalizedCopyApi_1 = require("../api/LocalizedCopyApi"); | ||
var LocalizedCopyStore = /** @class */ (function () { | ||
function LocalizedCopyStore() { | ||
var _this = this; | ||
this.api = new LocalizedCopyApi_1.LocalizedCopyApi('/', ''); | ||
// OBSERVABLES: Localized Copy data | ||
this.localizedCopy = []; | ||
this.initialize = function (api) { return __awaiter(_this, void 0, void 0, function () { | ||
this.api = null; | ||
this.initialize = function (api, feature_namespace, staticCopyKeys) { return __awaiter(_this, void 0, void 0, function () { | ||
var req; | ||
return __generator(this, function (_a) { | ||
this.api = api; | ||
return [2 /*return*/]; | ||
switch (_a.label) { | ||
case 0: | ||
this.api = api; | ||
req = staticCopyKeys.map(function (key) { return ({ | ||
feature_namespace: feature_namespace, | ||
key: key | ||
}); }); | ||
return [4 /*yield*/, this.getLocalizedCopy(req)]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
@@ -56,13 +67,14 @@ }); }; | ||
var _a, error_1; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
var _b; | ||
return __generator(this, function (_c) { | ||
switch (_c.label) { | ||
case 0: | ||
_b.trys.push([0, 2, , 3]); | ||
_c.trys.push([0, 2, , 3]); | ||
_a = this; | ||
return [4 /*yield*/, this.api.getLocalizedCopy(req)]; | ||
return [4 /*yield*/, ((_b = this.api) === null || _b === void 0 ? void 0 : _b.getLocalizedCopy(req))]; | ||
case 1: | ||
_a.localizedCopy = _b.sent(); | ||
_a.localizedCopy = _c.sent(); | ||
return [3 /*break*/, 3]; | ||
case 2: | ||
error_1 = _b.sent(); | ||
error_1 = _c.sent(); | ||
console.error("Error occurred while fetching localized copy: ".concat(error_1)); | ||
@@ -69,0 +81,0 @@ return [3 /*break*/, 3]; |
{ | ||
"name": "@mx-cartographer/common", | ||
"version": "0.4.2-alpha", | ||
"version": "0.4.3-alpha", | ||
"description": "Common components used within Cartographer", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
364611
5426