ynab 1.21.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/api.js CHANGED
@@ -23,11 +23,47 @@ var __extends = (this && this.__extends) || (function () {
23
23
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
24
24
  };
25
25
  })();
26
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
27
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
28
+ return new (P || (P = Promise))(function (resolve, reject) {
29
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
30
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
31
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
32
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
33
+ });
34
+ };
35
+ var __generator = (this && this.__generator) || function (thisArg, body) {
36
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
37
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
38
+ function verb(n) { return function (v) { return step([n, v]); }; }
39
+ function step(op) {
40
+ if (f) throw new TypeError("Generator is already executing.");
41
+ while (_) try {
42
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
43
+ if (y = 0, t) op = [op[0] & 2, t.value];
44
+ switch (op[0]) {
45
+ case 0: case 1: t = op; break;
46
+ case 4: _.label++; return { value: op[1], done: false };
47
+ case 5: _.label++; y = op[1]; op = [0]; continue;
48
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
49
+ default:
50
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
51
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
52
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
53
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
54
+ if (t[2]) _.ops.pop();
55
+ _.trys.pop(); continue;
56
+ }
57
+ op = body.call(thisArg, _);
58
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
59
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
60
+ }
61
+ };
26
62
  import * as url from "url";
27
63
  // Requiring portable-fetch like this ensures that we have a global fetch function
28
64
  // That makes it easier to override with modules like fetch-mock
29
65
  require("portable-fetch");
30
- var USER_AGENT = "api_client/js/1.20.0";
66
+ var USER_AGENT = "api_client/js/1.24.0";
31
67
  function convertDateToFullDateStringFormat(date) {
32
68
  // Convert to RFC 3339 "full-date" format, like "2017-11-27"
33
69
  if (date instanceof Date) {
@@ -526,19 +562,27 @@ export var AccountsApiFp = function (configuration) {
526
562
  * @throws {RequiredError}
527
563
  */
528
564
  createAccount: function (budget_id, data, options) {
565
+ var _this = this;
529
566
  var localVarFetchArgs = AccountsApiFetchParamCreator(configuration).createAccount(budget_id, data, options);
530
567
  return function (fetchFunction) {
531
568
  if (fetchFunction === void 0) { fetchFunction = fetch; }
532
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
533
- if (response.status >= 200 && response.status < 300) {
534
- return response.json();
535
- }
536
- else {
537
- return response.json().then(function (e) {
538
- return Promise.reject(e);
539
- });
540
- }
541
- });
569
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
570
+ var apiResponse;
571
+ return __generator(this, function (_a) {
572
+ switch (_a.label) {
573
+ case 0:
574
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
575
+ return [4 /*yield*/, response.json()];
576
+ case 1:
577
+ apiResponse = _a.sent();
578
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
579
+ return [2 /*return*/, apiResponse];
580
+ case 2: return [2 /*return*/, response.json().then(function (e) {
581
+ return Promise.reject(e);
582
+ })];
583
+ }
584
+ });
585
+ }); });
542
586
  };
543
587
  },
544
588
  /**
@@ -550,19 +594,27 @@ export var AccountsApiFp = function (configuration) {
550
594
  * @throws {RequiredError}
551
595
  */
552
596
  getAccountById: function (budget_id, account_id, options) {
597
+ var _this = this;
553
598
  var localVarFetchArgs = AccountsApiFetchParamCreator(configuration).getAccountById(budget_id, account_id, options);
554
599
  return function (fetchFunction) {
555
600
  if (fetchFunction === void 0) { fetchFunction = fetch; }
556
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
557
- if (response.status >= 200 && response.status < 300) {
558
- return response.json();
559
- }
560
- else {
561
- return response.json().then(function (e) {
562
- return Promise.reject(e);
563
- });
564
- }
565
- });
601
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
602
+ var apiResponse;
603
+ return __generator(this, function (_a) {
604
+ switch (_a.label) {
605
+ case 0:
606
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
607
+ return [4 /*yield*/, response.json()];
608
+ case 1:
609
+ apiResponse = _a.sent();
610
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
611
+ return [2 /*return*/, apiResponse];
612
+ case 2: return [2 /*return*/, response.json().then(function (e) {
613
+ return Promise.reject(e);
614
+ })];
615
+ }
616
+ });
617
+ }); });
566
618
  };
567
619
  },
568
620
  /**
@@ -574,19 +626,27 @@ export var AccountsApiFp = function (configuration) {
574
626
  * @throws {RequiredError}
575
627
  */
576
628
  getAccounts: function (budget_id, last_knowledge_of_server, options) {
629
+ var _this = this;
577
630
  var localVarFetchArgs = AccountsApiFetchParamCreator(configuration).getAccounts(budget_id, last_knowledge_of_server, options);
578
631
  return function (fetchFunction) {
579
632
  if (fetchFunction === void 0) { fetchFunction = fetch; }
580
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
581
- if (response.status >= 200 && response.status < 300) {
582
- return response.json();
583
- }
584
- else {
585
- return response.json().then(function (e) {
586
- return Promise.reject(e);
587
- });
588
- }
589
- });
633
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
634
+ var apiResponse;
635
+ return __generator(this, function (_a) {
636
+ switch (_a.label) {
637
+ case 0:
638
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
639
+ return [4 /*yield*/, response.json()];
640
+ case 1:
641
+ apiResponse = _a.sent();
642
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
643
+ return [2 /*return*/, apiResponse];
644
+ case 2: return [2 /*return*/, response.json().then(function (e) {
645
+ return Promise.reject(e);
646
+ })];
647
+ }
648
+ });
649
+ }); });
590
650
  };
591
651
  },
592
652
  };
@@ -812,19 +872,27 @@ export var BudgetsApiFp = function (configuration) {
812
872
  * @throws {RequiredError}
813
873
  */
814
874
  getBudgetById: function (budget_id, last_knowledge_of_server, options) {
875
+ var _this = this;
815
876
  var localVarFetchArgs = BudgetsApiFetchParamCreator(configuration).getBudgetById(budget_id, last_knowledge_of_server, options);
816
877
  return function (fetchFunction) {
817
878
  if (fetchFunction === void 0) { fetchFunction = fetch; }
818
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
819
- if (response.status >= 200 && response.status < 300) {
820
- return response.json();
821
- }
822
- else {
823
- return response.json().then(function (e) {
824
- return Promise.reject(e);
825
- });
826
- }
827
- });
879
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
880
+ var apiResponse;
881
+ return __generator(this, function (_a) {
882
+ switch (_a.label) {
883
+ case 0:
884
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
885
+ return [4 /*yield*/, response.json()];
886
+ case 1:
887
+ apiResponse = _a.sent();
888
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
889
+ return [2 /*return*/, apiResponse];
890
+ case 2: return [2 /*return*/, response.json().then(function (e) {
891
+ return Promise.reject(e);
892
+ })];
893
+ }
894
+ });
895
+ }); });
828
896
  };
829
897
  },
830
898
  /**
@@ -835,19 +903,27 @@ export var BudgetsApiFp = function (configuration) {
835
903
  * @throws {RequiredError}
836
904
  */
837
905
  getBudgetSettingsById: function (budget_id, options) {
906
+ var _this = this;
838
907
  var localVarFetchArgs = BudgetsApiFetchParamCreator(configuration).getBudgetSettingsById(budget_id, options);
839
908
  return function (fetchFunction) {
840
909
  if (fetchFunction === void 0) { fetchFunction = fetch; }
841
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
842
- if (response.status >= 200 && response.status < 300) {
843
- return response.json();
844
- }
845
- else {
846
- return response.json().then(function (e) {
847
- return Promise.reject(e);
848
- });
849
- }
850
- });
910
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
911
+ var apiResponse;
912
+ return __generator(this, function (_a) {
913
+ switch (_a.label) {
914
+ case 0:
915
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
916
+ return [4 /*yield*/, response.json()];
917
+ case 1:
918
+ apiResponse = _a.sent();
919
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
920
+ return [2 /*return*/, apiResponse];
921
+ case 2: return [2 /*return*/, response.json().then(function (e) {
922
+ return Promise.reject(e);
923
+ })];
924
+ }
925
+ });
926
+ }); });
851
927
  };
852
928
  },
853
929
  /**
@@ -858,19 +934,27 @@ export var BudgetsApiFp = function (configuration) {
858
934
  * @throws {RequiredError}
859
935
  */
860
936
  getBudgets: function (include_accounts, options) {
937
+ var _this = this;
861
938
  var localVarFetchArgs = BudgetsApiFetchParamCreator(configuration).getBudgets(include_accounts, options);
862
939
  return function (fetchFunction) {
863
940
  if (fetchFunction === void 0) { fetchFunction = fetch; }
864
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
865
- if (response.status >= 200 && response.status < 300) {
866
- return response.json();
867
- }
868
- else {
869
- return response.json().then(function (e) {
870
- return Promise.reject(e);
871
- });
872
- }
873
- });
941
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
942
+ var apiResponse;
943
+ return __generator(this, function (_a) {
944
+ switch (_a.label) {
945
+ case 0:
946
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
947
+ return [4 /*yield*/, response.json()];
948
+ case 1:
949
+ apiResponse = _a.sent();
950
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
951
+ return [2 /*return*/, apiResponse];
952
+ case 2: return [2 /*return*/, response.json().then(function (e) {
953
+ return Promise.reject(e);
954
+ })];
955
+ }
956
+ });
957
+ }); });
874
958
  };
875
959
  },
876
960
  };
@@ -1166,19 +1250,27 @@ export var CategoriesApiFp = function (configuration) {
1166
1250
  * @throws {RequiredError}
1167
1251
  */
1168
1252
  getCategories: function (budget_id, last_knowledge_of_server, options) {
1253
+ var _this = this;
1169
1254
  var localVarFetchArgs = CategoriesApiFetchParamCreator(configuration).getCategories(budget_id, last_knowledge_of_server, options);
1170
1255
  return function (fetchFunction) {
1171
1256
  if (fetchFunction === void 0) { fetchFunction = fetch; }
1172
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
1173
- if (response.status >= 200 && response.status < 300) {
1174
- return response.json();
1175
- }
1176
- else {
1177
- return response.json().then(function (e) {
1178
- return Promise.reject(e);
1179
- });
1180
- }
1181
- });
1257
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1258
+ var apiResponse;
1259
+ return __generator(this, function (_a) {
1260
+ switch (_a.label) {
1261
+ case 0:
1262
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1263
+ return [4 /*yield*/, response.json()];
1264
+ case 1:
1265
+ apiResponse = _a.sent();
1266
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1267
+ return [2 /*return*/, apiResponse];
1268
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1269
+ return Promise.reject(e);
1270
+ })];
1271
+ }
1272
+ });
1273
+ }); });
1182
1274
  };
1183
1275
  },
1184
1276
  /**
@@ -1190,19 +1282,27 @@ export var CategoriesApiFp = function (configuration) {
1190
1282
  * @throws {RequiredError}
1191
1283
  */
1192
1284
  getCategoryById: function (budget_id, category_id, options) {
1285
+ var _this = this;
1193
1286
  var localVarFetchArgs = CategoriesApiFetchParamCreator(configuration).getCategoryById(budget_id, category_id, options);
1194
1287
  return function (fetchFunction) {
1195
1288
  if (fetchFunction === void 0) { fetchFunction = fetch; }
1196
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
1197
- if (response.status >= 200 && response.status < 300) {
1198
- return response.json();
1199
- }
1200
- else {
1201
- return response.json().then(function (e) {
1202
- return Promise.reject(e);
1203
- });
1204
- }
1205
- });
1289
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1290
+ var apiResponse;
1291
+ return __generator(this, function (_a) {
1292
+ switch (_a.label) {
1293
+ case 0:
1294
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1295
+ return [4 /*yield*/, response.json()];
1296
+ case 1:
1297
+ apiResponse = _a.sent();
1298
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1299
+ return [2 /*return*/, apiResponse];
1300
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1301
+ return Promise.reject(e);
1302
+ })];
1303
+ }
1304
+ });
1305
+ }); });
1206
1306
  };
1207
1307
  },
1208
1308
  /**
@@ -1215,19 +1315,27 @@ export var CategoriesApiFp = function (configuration) {
1215
1315
  * @throws {RequiredError}
1216
1316
  */
1217
1317
  getMonthCategoryById: function (budget_id, month, category_id, options) {
1318
+ var _this = this;
1218
1319
  var localVarFetchArgs = CategoriesApiFetchParamCreator(configuration).getMonthCategoryById(budget_id, month, category_id, options);
1219
1320
  return function (fetchFunction) {
1220
1321
  if (fetchFunction === void 0) { fetchFunction = fetch; }
1221
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
1222
- if (response.status >= 200 && response.status < 300) {
1223
- return response.json();
1224
- }
1225
- else {
1226
- return response.json().then(function (e) {
1227
- return Promise.reject(e);
1228
- });
1229
- }
1230
- });
1322
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1323
+ var apiResponse;
1324
+ return __generator(this, function (_a) {
1325
+ switch (_a.label) {
1326
+ case 0:
1327
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1328
+ return [4 /*yield*/, response.json()];
1329
+ case 1:
1330
+ apiResponse = _a.sent();
1331
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1332
+ return [2 /*return*/, apiResponse];
1333
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1334
+ return Promise.reject(e);
1335
+ })];
1336
+ }
1337
+ });
1338
+ }); });
1231
1339
  };
1232
1340
  },
1233
1341
  /**
@@ -1241,19 +1349,27 @@ export var CategoriesApiFp = function (configuration) {
1241
1349
  * @throws {RequiredError}
1242
1350
  */
1243
1351
  updateMonthCategory: function (budget_id, month, category_id, data, options) {
1352
+ var _this = this;
1244
1353
  var localVarFetchArgs = CategoriesApiFetchParamCreator(configuration).updateMonthCategory(budget_id, month, category_id, data, options);
1245
1354
  return function (fetchFunction) {
1246
1355
  if (fetchFunction === void 0) { fetchFunction = fetch; }
1247
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
1248
- if (response.status >= 200 && response.status < 300) {
1249
- return response.json();
1250
- }
1251
- else {
1252
- return response.json().then(function (e) {
1253
- return Promise.reject(e);
1254
- });
1255
- }
1256
- });
1356
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1357
+ var apiResponse;
1358
+ return __generator(this, function (_a) {
1359
+ switch (_a.label) {
1360
+ case 0:
1361
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1362
+ return [4 /*yield*/, response.json()];
1363
+ case 1:
1364
+ apiResponse = _a.sent();
1365
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1366
+ return [2 /*return*/, apiResponse];
1367
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1368
+ return Promise.reject(e);
1369
+ })];
1370
+ }
1371
+ });
1372
+ }); });
1257
1373
  };
1258
1374
  },
1259
1375
  };
@@ -1443,19 +1559,27 @@ export var DeprecatedApiFp = function (configuration) {
1443
1559
  * @throws {RequiredError}
1444
1560
  */
1445
1561
  bulkCreateTransactions: function (budget_id, transactions, options) {
1562
+ var _this = this;
1446
1563
  var localVarFetchArgs = DeprecatedApiFetchParamCreator(configuration).bulkCreateTransactions(budget_id, transactions, options);
1447
1564
  return function (fetchFunction) {
1448
1565
  if (fetchFunction === void 0) { fetchFunction = fetch; }
1449
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
1450
- if (response.status >= 200 && response.status < 300) {
1451
- return response.json();
1452
- }
1453
- else {
1454
- return response.json().then(function (e) {
1455
- return Promise.reject(e);
1456
- });
1457
- }
1458
- });
1566
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1567
+ var apiResponse;
1568
+ return __generator(this, function (_a) {
1569
+ switch (_a.label) {
1570
+ case 0:
1571
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1572
+ return [4 /*yield*/, response.json()];
1573
+ case 1:
1574
+ apiResponse = _a.sent();
1575
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1576
+ return [2 /*return*/, apiResponse];
1577
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1578
+ return Promise.reject(e);
1579
+ })];
1580
+ }
1581
+ });
1582
+ }); });
1459
1583
  };
1460
1584
  },
1461
1585
  };
@@ -1608,19 +1732,27 @@ export var MonthsApiFp = function (configuration) {
1608
1732
  * @throws {RequiredError}
1609
1733
  */
1610
1734
  getBudgetMonth: function (budget_id, month, options) {
1735
+ var _this = this;
1611
1736
  var localVarFetchArgs = MonthsApiFetchParamCreator(configuration).getBudgetMonth(budget_id, month, options);
1612
1737
  return function (fetchFunction) {
1613
1738
  if (fetchFunction === void 0) { fetchFunction = fetch; }
1614
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
1615
- if (response.status >= 200 && response.status < 300) {
1616
- return response.json();
1617
- }
1618
- else {
1619
- return response.json().then(function (e) {
1620
- return Promise.reject(e);
1621
- });
1622
- }
1623
- });
1739
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1740
+ var apiResponse;
1741
+ return __generator(this, function (_a) {
1742
+ switch (_a.label) {
1743
+ case 0:
1744
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1745
+ return [4 /*yield*/, response.json()];
1746
+ case 1:
1747
+ apiResponse = _a.sent();
1748
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1749
+ return [2 /*return*/, apiResponse];
1750
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1751
+ return Promise.reject(e);
1752
+ })];
1753
+ }
1754
+ });
1755
+ }); });
1624
1756
  };
1625
1757
  },
1626
1758
  /**
@@ -1632,19 +1764,27 @@ export var MonthsApiFp = function (configuration) {
1632
1764
  * @throws {RequiredError}
1633
1765
  */
1634
1766
  getBudgetMonths: function (budget_id, last_knowledge_of_server, options) {
1767
+ var _this = this;
1635
1768
  var localVarFetchArgs = MonthsApiFetchParamCreator(configuration).getBudgetMonths(budget_id, last_knowledge_of_server, options);
1636
1769
  return function (fetchFunction) {
1637
1770
  if (fetchFunction === void 0) { fetchFunction = fetch; }
1638
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
1639
- if (response.status >= 200 && response.status < 300) {
1640
- return response.json();
1641
- }
1642
- else {
1643
- return response.json().then(function (e) {
1644
- return Promise.reject(e);
1645
- });
1646
- }
1647
- });
1771
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1772
+ var apiResponse;
1773
+ return __generator(this, function (_a) {
1774
+ switch (_a.label) {
1775
+ case 0:
1776
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1777
+ return [4 /*yield*/, response.json()];
1778
+ case 1:
1779
+ apiResponse = _a.sent();
1780
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1781
+ return [2 /*return*/, apiResponse];
1782
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1783
+ return Promise.reject(e);
1784
+ })];
1785
+ }
1786
+ });
1787
+ }); });
1648
1788
  };
1649
1789
  },
1650
1790
  };
@@ -1857,19 +1997,27 @@ export var PayeeLocationsApiFp = function (configuration) {
1857
1997
  * @throws {RequiredError}
1858
1998
  */
1859
1999
  getPayeeLocationById: function (budget_id, payee_location_id, options) {
2000
+ var _this = this;
1860
2001
  var localVarFetchArgs = PayeeLocationsApiFetchParamCreator(configuration).getPayeeLocationById(budget_id, payee_location_id, options);
1861
2002
  return function (fetchFunction) {
1862
2003
  if (fetchFunction === void 0) { fetchFunction = fetch; }
1863
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
1864
- if (response.status >= 200 && response.status < 300) {
1865
- return response.json();
1866
- }
1867
- else {
1868
- return response.json().then(function (e) {
1869
- return Promise.reject(e);
1870
- });
1871
- }
1872
- });
2004
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2005
+ var apiResponse;
2006
+ return __generator(this, function (_a) {
2007
+ switch (_a.label) {
2008
+ case 0:
2009
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2010
+ return [4 /*yield*/, response.json()];
2011
+ case 1:
2012
+ apiResponse = _a.sent();
2013
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2014
+ return [2 /*return*/, apiResponse];
2015
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2016
+ return Promise.reject(e);
2017
+ })];
2018
+ }
2019
+ });
2020
+ }); });
1873
2021
  };
1874
2022
  },
1875
2023
  /**
@@ -1880,19 +2028,27 @@ export var PayeeLocationsApiFp = function (configuration) {
1880
2028
  * @throws {RequiredError}
1881
2029
  */
1882
2030
  getPayeeLocations: function (budget_id, options) {
2031
+ var _this = this;
1883
2032
  var localVarFetchArgs = PayeeLocationsApiFetchParamCreator(configuration).getPayeeLocations(budget_id, options);
1884
2033
  return function (fetchFunction) {
1885
2034
  if (fetchFunction === void 0) { fetchFunction = fetch; }
1886
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
1887
- if (response.status >= 200 && response.status < 300) {
1888
- return response.json();
1889
- }
1890
- else {
1891
- return response.json().then(function (e) {
1892
- return Promise.reject(e);
1893
- });
1894
- }
1895
- });
2035
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2036
+ var apiResponse;
2037
+ return __generator(this, function (_a) {
2038
+ switch (_a.label) {
2039
+ case 0:
2040
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2041
+ return [4 /*yield*/, response.json()];
2042
+ case 1:
2043
+ apiResponse = _a.sent();
2044
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2045
+ return [2 /*return*/, apiResponse];
2046
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2047
+ return Promise.reject(e);
2048
+ })];
2049
+ }
2050
+ });
2051
+ }); });
1896
2052
  };
1897
2053
  },
1898
2054
  /**
@@ -1904,19 +2060,27 @@ export var PayeeLocationsApiFp = function (configuration) {
1904
2060
  * @throws {RequiredError}
1905
2061
  */
1906
2062
  getPayeeLocationsByPayee: function (budget_id, payee_id, options) {
2063
+ var _this = this;
1907
2064
  var localVarFetchArgs = PayeeLocationsApiFetchParamCreator(configuration).getPayeeLocationsByPayee(budget_id, payee_id, options);
1908
2065
  return function (fetchFunction) {
1909
2066
  if (fetchFunction === void 0) { fetchFunction = fetch; }
1910
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
1911
- if (response.status >= 200 && response.status < 300) {
1912
- return response.json();
1913
- }
1914
- else {
1915
- return response.json().then(function (e) {
1916
- return Promise.reject(e);
1917
- });
1918
- }
1919
- });
2067
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2068
+ var apiResponse;
2069
+ return __generator(this, function (_a) {
2070
+ switch (_a.label) {
2071
+ case 0:
2072
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2073
+ return [4 /*yield*/, response.json()];
2074
+ case 1:
2075
+ apiResponse = _a.sent();
2076
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2077
+ return [2 /*return*/, apiResponse];
2078
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2079
+ return Promise.reject(e);
2080
+ })];
2081
+ }
2082
+ });
2083
+ }); });
1920
2084
  };
1921
2085
  },
1922
2086
  };
@@ -2113,19 +2277,27 @@ export var PayeesApiFp = function (configuration) {
2113
2277
  * @throws {RequiredError}
2114
2278
  */
2115
2279
  getPayeeById: function (budget_id, payee_id, options) {
2280
+ var _this = this;
2116
2281
  var localVarFetchArgs = PayeesApiFetchParamCreator(configuration).getPayeeById(budget_id, payee_id, options);
2117
2282
  return function (fetchFunction) {
2118
2283
  if (fetchFunction === void 0) { fetchFunction = fetch; }
2119
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
2120
- if (response.status >= 200 && response.status < 300) {
2121
- return response.json();
2122
- }
2123
- else {
2124
- return response.json().then(function (e) {
2125
- return Promise.reject(e);
2126
- });
2127
- }
2128
- });
2284
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2285
+ var apiResponse;
2286
+ return __generator(this, function (_a) {
2287
+ switch (_a.label) {
2288
+ case 0:
2289
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2290
+ return [4 /*yield*/, response.json()];
2291
+ case 1:
2292
+ apiResponse = _a.sent();
2293
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2294
+ return [2 /*return*/, apiResponse];
2295
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2296
+ return Promise.reject(e);
2297
+ })];
2298
+ }
2299
+ });
2300
+ }); });
2129
2301
  };
2130
2302
  },
2131
2303
  /**
@@ -2137,19 +2309,27 @@ export var PayeesApiFp = function (configuration) {
2137
2309
  * @throws {RequiredError}
2138
2310
  */
2139
2311
  getPayees: function (budget_id, last_knowledge_of_server, options) {
2312
+ var _this = this;
2140
2313
  var localVarFetchArgs = PayeesApiFetchParamCreator(configuration).getPayees(budget_id, last_knowledge_of_server, options);
2141
2314
  return function (fetchFunction) {
2142
2315
  if (fetchFunction === void 0) { fetchFunction = fetch; }
2143
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
2144
- if (response.status >= 200 && response.status < 300) {
2145
- return response.json();
2146
- }
2147
- else {
2148
- return response.json().then(function (e) {
2149
- return Promise.reject(e);
2150
- });
2151
- }
2152
- });
2316
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2317
+ var apiResponse;
2318
+ return __generator(this, function (_a) {
2319
+ switch (_a.label) {
2320
+ case 0:
2321
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2322
+ return [4 /*yield*/, response.json()];
2323
+ case 1:
2324
+ apiResponse = _a.sent();
2325
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2326
+ return [2 /*return*/, apiResponse];
2327
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2328
+ return Promise.reject(e);
2329
+ })];
2330
+ }
2331
+ });
2332
+ }); });
2153
2333
  };
2154
2334
  },
2155
2335
  };
@@ -2325,19 +2505,27 @@ export var ScheduledTransactionsApiFp = function (configuration) {
2325
2505
  * @throws {RequiredError}
2326
2506
  */
2327
2507
  getScheduledTransactionById: function (budget_id, scheduled_transaction_id, options) {
2508
+ var _this = this;
2328
2509
  var localVarFetchArgs = ScheduledTransactionsApiFetchParamCreator(configuration).getScheduledTransactionById(budget_id, scheduled_transaction_id, options);
2329
2510
  return function (fetchFunction) {
2330
2511
  if (fetchFunction === void 0) { fetchFunction = fetch; }
2331
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
2332
- if (response.status >= 200 && response.status < 300) {
2333
- return response.json();
2334
- }
2335
- else {
2336
- return response.json().then(function (e) {
2337
- return Promise.reject(e);
2338
- });
2339
- }
2340
- });
2512
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2513
+ var apiResponse;
2514
+ return __generator(this, function (_a) {
2515
+ switch (_a.label) {
2516
+ case 0:
2517
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2518
+ return [4 /*yield*/, response.json()];
2519
+ case 1:
2520
+ apiResponse = _a.sent();
2521
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2522
+ return [2 /*return*/, apiResponse];
2523
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2524
+ return Promise.reject(e);
2525
+ })];
2526
+ }
2527
+ });
2528
+ }); });
2341
2529
  };
2342
2530
  },
2343
2531
  /**
@@ -2349,19 +2537,27 @@ export var ScheduledTransactionsApiFp = function (configuration) {
2349
2537
  * @throws {RequiredError}
2350
2538
  */
2351
2539
  getScheduledTransactions: function (budget_id, last_knowledge_of_server, options) {
2540
+ var _this = this;
2352
2541
  var localVarFetchArgs = ScheduledTransactionsApiFetchParamCreator(configuration).getScheduledTransactions(budget_id, last_knowledge_of_server, options);
2353
2542
  return function (fetchFunction) {
2354
2543
  if (fetchFunction === void 0) { fetchFunction = fetch; }
2355
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
2356
- if (response.status >= 200 && response.status < 300) {
2357
- return response.json();
2358
- }
2359
- else {
2360
- return response.json().then(function (e) {
2361
- return Promise.reject(e);
2362
- });
2363
- }
2364
- });
2544
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2545
+ var apiResponse;
2546
+ return __generator(this, function (_a) {
2547
+ switch (_a.label) {
2548
+ case 0:
2549
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2550
+ return [4 /*yield*/, response.json()];
2551
+ case 1:
2552
+ apiResponse = _a.sent();
2553
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2554
+ return [2 /*return*/, apiResponse];
2555
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2556
+ return Promise.reject(e);
2557
+ })];
2558
+ }
2559
+ });
2560
+ }); });
2365
2561
  };
2366
2562
  },
2367
2563
  };
@@ -2871,19 +3067,27 @@ export var TransactionsApiFp = function (configuration) {
2871
3067
  * @throws {RequiredError}
2872
3068
  */
2873
3069
  createTransaction: function (budget_id, data, options) {
3070
+ var _this = this;
2874
3071
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).createTransaction(budget_id, data, options);
2875
3072
  return function (fetchFunction) {
2876
3073
  if (fetchFunction === void 0) { fetchFunction = fetch; }
2877
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
2878
- if (response.status >= 200 && response.status < 300) {
2879
- return response.json();
2880
- }
2881
- else {
2882
- return response.json().then(function (e) {
2883
- return Promise.reject(e);
2884
- });
2885
- }
2886
- });
3074
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3075
+ var apiResponse;
3076
+ return __generator(this, function (_a) {
3077
+ switch (_a.label) {
3078
+ case 0:
3079
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3080
+ return [4 /*yield*/, response.json()];
3081
+ case 1:
3082
+ apiResponse = _a.sent();
3083
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3084
+ return [2 /*return*/, apiResponse];
3085
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3086
+ return Promise.reject(e);
3087
+ })];
3088
+ }
3089
+ });
3090
+ }); });
2887
3091
  };
2888
3092
  },
2889
3093
  /**
@@ -2895,19 +3099,27 @@ export var TransactionsApiFp = function (configuration) {
2895
3099
  * @throws {RequiredError}
2896
3100
  */
2897
3101
  getTransactionById: function (budget_id, transaction_id, options) {
3102
+ var _this = this;
2898
3103
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).getTransactionById(budget_id, transaction_id, options);
2899
3104
  return function (fetchFunction) {
2900
3105
  if (fetchFunction === void 0) { fetchFunction = fetch; }
2901
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
2902
- if (response.status >= 200 && response.status < 300) {
2903
- return response.json();
2904
- }
2905
- else {
2906
- return response.json().then(function (e) {
2907
- return Promise.reject(e);
2908
- });
2909
- }
2910
- });
3106
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3107
+ var apiResponse;
3108
+ return __generator(this, function (_a) {
3109
+ switch (_a.label) {
3110
+ case 0:
3111
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3112
+ return [4 /*yield*/, response.json()];
3113
+ case 1:
3114
+ apiResponse = _a.sent();
3115
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3116
+ return [2 /*return*/, apiResponse];
3117
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3118
+ return Promise.reject(e);
3119
+ })];
3120
+ }
3121
+ });
3122
+ }); });
2911
3123
  };
2912
3124
  },
2913
3125
  /**
@@ -2921,19 +3133,27 @@ export var TransactionsApiFp = function (configuration) {
2921
3133
  * @throws {RequiredError}
2922
3134
  */
2923
3135
  getTransactions: function (budget_id, since_date, type, last_knowledge_of_server, options) {
3136
+ var _this = this;
2924
3137
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).getTransactions(budget_id, since_date, type, last_knowledge_of_server, options);
2925
3138
  return function (fetchFunction) {
2926
3139
  if (fetchFunction === void 0) { fetchFunction = fetch; }
2927
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
2928
- if (response.status >= 200 && response.status < 300) {
2929
- return response.json();
2930
- }
2931
- else {
2932
- return response.json().then(function (e) {
2933
- return Promise.reject(e);
2934
- });
2935
- }
2936
- });
3140
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3141
+ var apiResponse;
3142
+ return __generator(this, function (_a) {
3143
+ switch (_a.label) {
3144
+ case 0:
3145
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3146
+ return [4 /*yield*/, response.json()];
3147
+ case 1:
3148
+ apiResponse = _a.sent();
3149
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3150
+ return [2 /*return*/, apiResponse];
3151
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3152
+ return Promise.reject(e);
3153
+ })];
3154
+ }
3155
+ });
3156
+ }); });
2937
3157
  };
2938
3158
  },
2939
3159
  /**
@@ -2948,19 +3168,27 @@ export var TransactionsApiFp = function (configuration) {
2948
3168
  * @throws {RequiredError}
2949
3169
  */
2950
3170
  getTransactionsByAccount: function (budget_id, account_id, since_date, type, last_knowledge_of_server, options) {
3171
+ var _this = this;
2951
3172
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).getTransactionsByAccount(budget_id, account_id, since_date, type, last_knowledge_of_server, options);
2952
3173
  return function (fetchFunction) {
2953
3174
  if (fetchFunction === void 0) { fetchFunction = fetch; }
2954
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
2955
- if (response.status >= 200 && response.status < 300) {
2956
- return response.json();
2957
- }
2958
- else {
2959
- return response.json().then(function (e) {
2960
- return Promise.reject(e);
2961
- });
2962
- }
2963
- });
3175
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3176
+ var apiResponse;
3177
+ return __generator(this, function (_a) {
3178
+ switch (_a.label) {
3179
+ case 0:
3180
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3181
+ return [4 /*yield*/, response.json()];
3182
+ case 1:
3183
+ apiResponse = _a.sent();
3184
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3185
+ return [2 /*return*/, apiResponse];
3186
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3187
+ return Promise.reject(e);
3188
+ })];
3189
+ }
3190
+ });
3191
+ }); });
2964
3192
  };
2965
3193
  },
2966
3194
  /**
@@ -2975,19 +3203,27 @@ export var TransactionsApiFp = function (configuration) {
2975
3203
  * @throws {RequiredError}
2976
3204
  */
2977
3205
  getTransactionsByCategory: function (budget_id, category_id, since_date, type, last_knowledge_of_server, options) {
3206
+ var _this = this;
2978
3207
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).getTransactionsByCategory(budget_id, category_id, since_date, type, last_knowledge_of_server, options);
2979
3208
  return function (fetchFunction) {
2980
3209
  if (fetchFunction === void 0) { fetchFunction = fetch; }
2981
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
2982
- if (response.status >= 200 && response.status < 300) {
2983
- return response.json();
2984
- }
2985
- else {
2986
- return response.json().then(function (e) {
2987
- return Promise.reject(e);
2988
- });
2989
- }
2990
- });
3210
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3211
+ var apiResponse;
3212
+ return __generator(this, function (_a) {
3213
+ switch (_a.label) {
3214
+ case 0:
3215
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3216
+ return [4 /*yield*/, response.json()];
3217
+ case 1:
3218
+ apiResponse = _a.sent();
3219
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3220
+ return [2 /*return*/, apiResponse];
3221
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3222
+ return Promise.reject(e);
3223
+ })];
3224
+ }
3225
+ });
3226
+ }); });
2991
3227
  };
2992
3228
  },
2993
3229
  /**
@@ -3002,19 +3238,27 @@ export var TransactionsApiFp = function (configuration) {
3002
3238
  * @throws {RequiredError}
3003
3239
  */
3004
3240
  getTransactionsByPayee: function (budget_id, payee_id, since_date, type, last_knowledge_of_server, options) {
3241
+ var _this = this;
3005
3242
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).getTransactionsByPayee(budget_id, payee_id, since_date, type, last_knowledge_of_server, options);
3006
3243
  return function (fetchFunction) {
3007
3244
  if (fetchFunction === void 0) { fetchFunction = fetch; }
3008
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
3009
- if (response.status >= 200 && response.status < 300) {
3010
- return response.json();
3011
- }
3012
- else {
3013
- return response.json().then(function (e) {
3014
- return Promise.reject(e);
3015
- });
3016
- }
3017
- });
3245
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3246
+ var apiResponse;
3247
+ return __generator(this, function (_a) {
3248
+ switch (_a.label) {
3249
+ case 0:
3250
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3251
+ return [4 /*yield*/, response.json()];
3252
+ case 1:
3253
+ apiResponse = _a.sent();
3254
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3255
+ return [2 /*return*/, apiResponse];
3256
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3257
+ return Promise.reject(e);
3258
+ })];
3259
+ }
3260
+ });
3261
+ }); });
3018
3262
  };
3019
3263
  },
3020
3264
  /**
@@ -3025,19 +3269,27 @@ export var TransactionsApiFp = function (configuration) {
3025
3269
  * @throws {RequiredError}
3026
3270
  */
3027
3271
  importTransactions: function (budget_id, options) {
3272
+ var _this = this;
3028
3273
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).importTransactions(budget_id, options);
3029
3274
  return function (fetchFunction) {
3030
3275
  if (fetchFunction === void 0) { fetchFunction = fetch; }
3031
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
3032
- if (response.status >= 200 && response.status < 300) {
3033
- return response.json();
3034
- }
3035
- else {
3036
- return response.json().then(function (e) {
3037
- return Promise.reject(e);
3038
- });
3039
- }
3040
- });
3276
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3277
+ var apiResponse;
3278
+ return __generator(this, function (_a) {
3279
+ switch (_a.label) {
3280
+ case 0:
3281
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3282
+ return [4 /*yield*/, response.json()];
3283
+ case 1:
3284
+ apiResponse = _a.sent();
3285
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3286
+ return [2 /*return*/, apiResponse];
3287
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3288
+ return Promise.reject(e);
3289
+ })];
3290
+ }
3291
+ });
3292
+ }); });
3041
3293
  };
3042
3294
  },
3043
3295
  /**
@@ -3050,19 +3302,27 @@ export var TransactionsApiFp = function (configuration) {
3050
3302
  * @throws {RequiredError}
3051
3303
  */
3052
3304
  updateTransaction: function (budget_id, transaction_id, data, options) {
3305
+ var _this = this;
3053
3306
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).updateTransaction(budget_id, transaction_id, data, options);
3054
3307
  return function (fetchFunction) {
3055
3308
  if (fetchFunction === void 0) { fetchFunction = fetch; }
3056
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
3057
- if (response.status >= 200 && response.status < 300) {
3058
- return response.json();
3059
- }
3060
- else {
3061
- return response.json().then(function (e) {
3062
- return Promise.reject(e);
3063
- });
3064
- }
3065
- });
3309
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3310
+ var apiResponse;
3311
+ return __generator(this, function (_a) {
3312
+ switch (_a.label) {
3313
+ case 0:
3314
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3315
+ return [4 /*yield*/, response.json()];
3316
+ case 1:
3317
+ apiResponse = _a.sent();
3318
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3319
+ return [2 /*return*/, apiResponse];
3320
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3321
+ return Promise.reject(e);
3322
+ })];
3323
+ }
3324
+ });
3325
+ }); });
3066
3326
  };
3067
3327
  },
3068
3328
  /**
@@ -3074,19 +3334,27 @@ export var TransactionsApiFp = function (configuration) {
3074
3334
  * @throws {RequiredError}
3075
3335
  */
3076
3336
  updateTransactions: function (budget_id, data, options) {
3337
+ var _this = this;
3077
3338
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).updateTransactions(budget_id, data, options);
3078
3339
  return function (fetchFunction) {
3079
3340
  if (fetchFunction === void 0) { fetchFunction = fetch; }
3080
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
3081
- if (response.status >= 200 && response.status < 300) {
3082
- return response.json();
3083
- }
3084
- else {
3085
- return response.json().then(function (e) {
3086
- return Promise.reject(e);
3087
- });
3088
- }
3089
- });
3341
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3342
+ var apiResponse;
3343
+ return __generator(this, function (_a) {
3344
+ switch (_a.label) {
3345
+ case 0:
3346
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3347
+ return [4 /*yield*/, response.json()];
3348
+ case 1:
3349
+ apiResponse = _a.sent();
3350
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3351
+ return [2 /*return*/, apiResponse];
3352
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3353
+ return Promise.reject(e);
3354
+ })];
3355
+ }
3356
+ });
3357
+ }); });
3090
3358
  };
3091
3359
  },
3092
3360
  };
@@ -3392,19 +3660,27 @@ export var UserApiFp = function (configuration) {
3392
3660
  * @throws {RequiredError}
3393
3661
  */
3394
3662
  getUser: function (options) {
3663
+ var _this = this;
3395
3664
  var localVarFetchArgs = UserApiFetchParamCreator(configuration).getUser(options);
3396
3665
  return function (fetchFunction) {
3397
3666
  if (fetchFunction === void 0) { fetchFunction = fetch; }
3398
- return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
3399
- if (response.status >= 200 && response.status < 300) {
3400
- return response.json();
3401
- }
3402
- else {
3403
- return response.json().then(function (e) {
3404
- return Promise.reject(e);
3405
- });
3406
- }
3407
- });
3667
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3668
+ var apiResponse;
3669
+ return __generator(this, function (_a) {
3670
+ switch (_a.label) {
3671
+ case 0:
3672
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3673
+ return [4 /*yield*/, response.json()];
3674
+ case 1:
3675
+ apiResponse = _a.sent();
3676
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3677
+ return [2 /*return*/, apiResponse];
3678
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3679
+ return Promise.reject(e);
3680
+ })];
3681
+ }
3682
+ });
3683
+ }); });
3408
3684
  };
3409
3685
  },
3410
3686
  };