ynab 1.24.0 → 1.28.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,52 @@ 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
+ };
62
+ // Polyfill fetch globally - this makes it easier to override with modules like fetch-mock.
63
+ var fetchPonyfill = require("fetch-ponyfill")();
64
+ if (!globalThis.fetch) {
65
+ globalThis.fetch = fetchPonyfill.fetch;
66
+ globalThis.Response = fetchPonyfill.Response;
67
+ globalThis.Headers = fetchPonyfill.Headers;
68
+ globalThis.Request = fetchPonyfill.Request;
69
+ }
26
70
  import * as url from "url";
27
- // Requiring portable-fetch like this ensures that we have a global fetch function
28
- // That makes it easier to override with modules like fetch-mock
29
- require("portable-fetch");
30
- var USER_AGENT = "api_client/js/1.21.0";
71
+ var USER_AGENT = "api_client/js/1.27.0";
31
72
  function convertDateToFullDateStringFormat(date) {
32
73
  // Convert to RFC 3339 "full-date" format, like "2017-11-27"
33
74
  if (date instanceof Date) {
@@ -526,19 +567,27 @@ export var AccountsApiFp = function (configuration) {
526
567
  * @throws {RequiredError}
527
568
  */
528
569
  createAccount: function (budget_id, data, options) {
570
+ var _this = this;
529
571
  var localVarFetchArgs = AccountsApiFetchParamCreator(configuration).createAccount(budget_id, data, options);
530
572
  return function (fetchFunction) {
531
573
  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
- });
574
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
575
+ var apiResponse;
576
+ return __generator(this, function (_a) {
577
+ switch (_a.label) {
578
+ case 0:
579
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
580
+ return [4 /*yield*/, response.json()];
581
+ case 1:
582
+ apiResponse = _a.sent();
583
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
584
+ return [2 /*return*/, apiResponse];
585
+ case 2: return [2 /*return*/, response.json().then(function (e) {
586
+ return Promise.reject(e);
587
+ })];
588
+ }
589
+ });
590
+ }); });
542
591
  };
543
592
  },
544
593
  /**
@@ -550,19 +599,27 @@ export var AccountsApiFp = function (configuration) {
550
599
  * @throws {RequiredError}
551
600
  */
552
601
  getAccountById: function (budget_id, account_id, options) {
602
+ var _this = this;
553
603
  var localVarFetchArgs = AccountsApiFetchParamCreator(configuration).getAccountById(budget_id, account_id, options);
554
604
  return function (fetchFunction) {
555
605
  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
- });
606
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
607
+ var apiResponse;
608
+ return __generator(this, function (_a) {
609
+ switch (_a.label) {
610
+ case 0:
611
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
612
+ return [4 /*yield*/, response.json()];
613
+ case 1:
614
+ apiResponse = _a.sent();
615
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
616
+ return [2 /*return*/, apiResponse];
617
+ case 2: return [2 /*return*/, response.json().then(function (e) {
618
+ return Promise.reject(e);
619
+ })];
620
+ }
621
+ });
622
+ }); });
566
623
  };
567
624
  },
568
625
  /**
@@ -574,19 +631,27 @@ export var AccountsApiFp = function (configuration) {
574
631
  * @throws {RequiredError}
575
632
  */
576
633
  getAccounts: function (budget_id, last_knowledge_of_server, options) {
634
+ var _this = this;
577
635
  var localVarFetchArgs = AccountsApiFetchParamCreator(configuration).getAccounts(budget_id, last_knowledge_of_server, options);
578
636
  return function (fetchFunction) {
579
637
  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
- });
638
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
639
+ var apiResponse;
640
+ return __generator(this, function (_a) {
641
+ switch (_a.label) {
642
+ case 0:
643
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
644
+ return [4 /*yield*/, response.json()];
645
+ case 1:
646
+ apiResponse = _a.sent();
647
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
648
+ return [2 /*return*/, apiResponse];
649
+ case 2: return [2 /*return*/, response.json().then(function (e) {
650
+ return Promise.reject(e);
651
+ })];
652
+ }
653
+ });
654
+ }); });
590
655
  };
591
656
  },
592
657
  };
@@ -812,19 +877,27 @@ export var BudgetsApiFp = function (configuration) {
812
877
  * @throws {RequiredError}
813
878
  */
814
879
  getBudgetById: function (budget_id, last_knowledge_of_server, options) {
880
+ var _this = this;
815
881
  var localVarFetchArgs = BudgetsApiFetchParamCreator(configuration).getBudgetById(budget_id, last_knowledge_of_server, options);
816
882
  return function (fetchFunction) {
817
883
  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
- });
884
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
885
+ var apiResponse;
886
+ return __generator(this, function (_a) {
887
+ switch (_a.label) {
888
+ case 0:
889
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
890
+ return [4 /*yield*/, response.json()];
891
+ case 1:
892
+ apiResponse = _a.sent();
893
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
894
+ return [2 /*return*/, apiResponse];
895
+ case 2: return [2 /*return*/, response.json().then(function (e) {
896
+ return Promise.reject(e);
897
+ })];
898
+ }
899
+ });
900
+ }); });
828
901
  };
829
902
  },
830
903
  /**
@@ -835,19 +908,27 @@ export var BudgetsApiFp = function (configuration) {
835
908
  * @throws {RequiredError}
836
909
  */
837
910
  getBudgetSettingsById: function (budget_id, options) {
911
+ var _this = this;
838
912
  var localVarFetchArgs = BudgetsApiFetchParamCreator(configuration).getBudgetSettingsById(budget_id, options);
839
913
  return function (fetchFunction) {
840
914
  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
- });
915
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
916
+ var apiResponse;
917
+ return __generator(this, function (_a) {
918
+ switch (_a.label) {
919
+ case 0:
920
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
921
+ return [4 /*yield*/, response.json()];
922
+ case 1:
923
+ apiResponse = _a.sent();
924
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
925
+ return [2 /*return*/, apiResponse];
926
+ case 2: return [2 /*return*/, response.json().then(function (e) {
927
+ return Promise.reject(e);
928
+ })];
929
+ }
930
+ });
931
+ }); });
851
932
  };
852
933
  },
853
934
  /**
@@ -858,19 +939,27 @@ export var BudgetsApiFp = function (configuration) {
858
939
  * @throws {RequiredError}
859
940
  */
860
941
  getBudgets: function (include_accounts, options) {
942
+ var _this = this;
861
943
  var localVarFetchArgs = BudgetsApiFetchParamCreator(configuration).getBudgets(include_accounts, options);
862
944
  return function (fetchFunction) {
863
945
  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
- });
946
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
947
+ var apiResponse;
948
+ return __generator(this, function (_a) {
949
+ switch (_a.label) {
950
+ case 0:
951
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
952
+ return [4 /*yield*/, response.json()];
953
+ case 1:
954
+ apiResponse = _a.sent();
955
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
956
+ return [2 /*return*/, apiResponse];
957
+ case 2: return [2 /*return*/, response.json().then(function (e) {
958
+ return Promise.reject(e);
959
+ })];
960
+ }
961
+ });
962
+ }); });
874
963
  };
875
964
  },
876
965
  };
@@ -1166,19 +1255,27 @@ export var CategoriesApiFp = function (configuration) {
1166
1255
  * @throws {RequiredError}
1167
1256
  */
1168
1257
  getCategories: function (budget_id, last_knowledge_of_server, options) {
1258
+ var _this = this;
1169
1259
  var localVarFetchArgs = CategoriesApiFetchParamCreator(configuration).getCategories(budget_id, last_knowledge_of_server, options);
1170
1260
  return function (fetchFunction) {
1171
1261
  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
- });
1262
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1263
+ var apiResponse;
1264
+ return __generator(this, function (_a) {
1265
+ switch (_a.label) {
1266
+ case 0:
1267
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1268
+ return [4 /*yield*/, response.json()];
1269
+ case 1:
1270
+ apiResponse = _a.sent();
1271
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1272
+ return [2 /*return*/, apiResponse];
1273
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1274
+ return Promise.reject(e);
1275
+ })];
1276
+ }
1277
+ });
1278
+ }); });
1182
1279
  };
1183
1280
  },
1184
1281
  /**
@@ -1190,19 +1287,27 @@ export var CategoriesApiFp = function (configuration) {
1190
1287
  * @throws {RequiredError}
1191
1288
  */
1192
1289
  getCategoryById: function (budget_id, category_id, options) {
1290
+ var _this = this;
1193
1291
  var localVarFetchArgs = CategoriesApiFetchParamCreator(configuration).getCategoryById(budget_id, category_id, options);
1194
1292
  return function (fetchFunction) {
1195
1293
  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
- });
1294
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1295
+ var apiResponse;
1296
+ return __generator(this, function (_a) {
1297
+ switch (_a.label) {
1298
+ case 0:
1299
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1300
+ return [4 /*yield*/, response.json()];
1301
+ case 1:
1302
+ apiResponse = _a.sent();
1303
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1304
+ return [2 /*return*/, apiResponse];
1305
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1306
+ return Promise.reject(e);
1307
+ })];
1308
+ }
1309
+ });
1310
+ }); });
1206
1311
  };
1207
1312
  },
1208
1313
  /**
@@ -1215,19 +1320,27 @@ export var CategoriesApiFp = function (configuration) {
1215
1320
  * @throws {RequiredError}
1216
1321
  */
1217
1322
  getMonthCategoryById: function (budget_id, month, category_id, options) {
1323
+ var _this = this;
1218
1324
  var localVarFetchArgs = CategoriesApiFetchParamCreator(configuration).getMonthCategoryById(budget_id, month, category_id, options);
1219
1325
  return function (fetchFunction) {
1220
1326
  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
- });
1327
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1328
+ var apiResponse;
1329
+ return __generator(this, function (_a) {
1330
+ switch (_a.label) {
1331
+ case 0:
1332
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1333
+ return [4 /*yield*/, response.json()];
1334
+ case 1:
1335
+ apiResponse = _a.sent();
1336
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1337
+ return [2 /*return*/, apiResponse];
1338
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1339
+ return Promise.reject(e);
1340
+ })];
1341
+ }
1342
+ });
1343
+ }); });
1231
1344
  };
1232
1345
  },
1233
1346
  /**
@@ -1241,19 +1354,27 @@ export var CategoriesApiFp = function (configuration) {
1241
1354
  * @throws {RequiredError}
1242
1355
  */
1243
1356
  updateMonthCategory: function (budget_id, month, category_id, data, options) {
1357
+ var _this = this;
1244
1358
  var localVarFetchArgs = CategoriesApiFetchParamCreator(configuration).updateMonthCategory(budget_id, month, category_id, data, options);
1245
1359
  return function (fetchFunction) {
1246
1360
  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
- });
1361
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1362
+ var apiResponse;
1363
+ return __generator(this, function (_a) {
1364
+ switch (_a.label) {
1365
+ case 0:
1366
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1367
+ return [4 /*yield*/, response.json()];
1368
+ case 1:
1369
+ apiResponse = _a.sent();
1370
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1371
+ return [2 /*return*/, apiResponse];
1372
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1373
+ return Promise.reject(e);
1374
+ })];
1375
+ }
1376
+ });
1377
+ }); });
1257
1378
  };
1258
1379
  },
1259
1380
  };
@@ -1443,19 +1564,27 @@ export var DeprecatedApiFp = function (configuration) {
1443
1564
  * @throws {RequiredError}
1444
1565
  */
1445
1566
  bulkCreateTransactions: function (budget_id, transactions, options) {
1567
+ var _this = this;
1446
1568
  var localVarFetchArgs = DeprecatedApiFetchParamCreator(configuration).bulkCreateTransactions(budget_id, transactions, options);
1447
1569
  return function (fetchFunction) {
1448
1570
  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
- });
1571
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1572
+ var apiResponse;
1573
+ return __generator(this, function (_a) {
1574
+ switch (_a.label) {
1575
+ case 0:
1576
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1577
+ return [4 /*yield*/, response.json()];
1578
+ case 1:
1579
+ apiResponse = _a.sent();
1580
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1581
+ return [2 /*return*/, apiResponse];
1582
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1583
+ return Promise.reject(e);
1584
+ })];
1585
+ }
1586
+ });
1587
+ }); });
1459
1588
  };
1460
1589
  },
1461
1590
  };
@@ -1608,19 +1737,27 @@ export var MonthsApiFp = function (configuration) {
1608
1737
  * @throws {RequiredError}
1609
1738
  */
1610
1739
  getBudgetMonth: function (budget_id, month, options) {
1740
+ var _this = this;
1611
1741
  var localVarFetchArgs = MonthsApiFetchParamCreator(configuration).getBudgetMonth(budget_id, month, options);
1612
1742
  return function (fetchFunction) {
1613
1743
  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
- });
1744
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1745
+ var apiResponse;
1746
+ return __generator(this, function (_a) {
1747
+ switch (_a.label) {
1748
+ case 0:
1749
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1750
+ return [4 /*yield*/, response.json()];
1751
+ case 1:
1752
+ apiResponse = _a.sent();
1753
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1754
+ return [2 /*return*/, apiResponse];
1755
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1756
+ return Promise.reject(e);
1757
+ })];
1758
+ }
1759
+ });
1760
+ }); });
1624
1761
  };
1625
1762
  },
1626
1763
  /**
@@ -1632,19 +1769,27 @@ export var MonthsApiFp = function (configuration) {
1632
1769
  * @throws {RequiredError}
1633
1770
  */
1634
1771
  getBudgetMonths: function (budget_id, last_knowledge_of_server, options) {
1772
+ var _this = this;
1635
1773
  var localVarFetchArgs = MonthsApiFetchParamCreator(configuration).getBudgetMonths(budget_id, last_knowledge_of_server, options);
1636
1774
  return function (fetchFunction) {
1637
1775
  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
- });
1776
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
1777
+ var apiResponse;
1778
+ return __generator(this, function (_a) {
1779
+ switch (_a.label) {
1780
+ case 0:
1781
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
1782
+ return [4 /*yield*/, response.json()];
1783
+ case 1:
1784
+ apiResponse = _a.sent();
1785
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
1786
+ return [2 /*return*/, apiResponse];
1787
+ case 2: return [2 /*return*/, response.json().then(function (e) {
1788
+ return Promise.reject(e);
1789
+ })];
1790
+ }
1791
+ });
1792
+ }); });
1648
1793
  };
1649
1794
  },
1650
1795
  };
@@ -1857,19 +2002,27 @@ export var PayeeLocationsApiFp = function (configuration) {
1857
2002
  * @throws {RequiredError}
1858
2003
  */
1859
2004
  getPayeeLocationById: function (budget_id, payee_location_id, options) {
2005
+ var _this = this;
1860
2006
  var localVarFetchArgs = PayeeLocationsApiFetchParamCreator(configuration).getPayeeLocationById(budget_id, payee_location_id, options);
1861
2007
  return function (fetchFunction) {
1862
2008
  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
- });
2009
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2010
+ var apiResponse;
2011
+ return __generator(this, function (_a) {
2012
+ switch (_a.label) {
2013
+ case 0:
2014
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2015
+ return [4 /*yield*/, response.json()];
2016
+ case 1:
2017
+ apiResponse = _a.sent();
2018
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2019
+ return [2 /*return*/, apiResponse];
2020
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2021
+ return Promise.reject(e);
2022
+ })];
2023
+ }
2024
+ });
2025
+ }); });
1873
2026
  };
1874
2027
  },
1875
2028
  /**
@@ -1880,19 +2033,27 @@ export var PayeeLocationsApiFp = function (configuration) {
1880
2033
  * @throws {RequiredError}
1881
2034
  */
1882
2035
  getPayeeLocations: function (budget_id, options) {
2036
+ var _this = this;
1883
2037
  var localVarFetchArgs = PayeeLocationsApiFetchParamCreator(configuration).getPayeeLocations(budget_id, options);
1884
2038
  return function (fetchFunction) {
1885
2039
  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
- });
2040
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2041
+ var apiResponse;
2042
+ return __generator(this, function (_a) {
2043
+ switch (_a.label) {
2044
+ case 0:
2045
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2046
+ return [4 /*yield*/, response.json()];
2047
+ case 1:
2048
+ apiResponse = _a.sent();
2049
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2050
+ return [2 /*return*/, apiResponse];
2051
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2052
+ return Promise.reject(e);
2053
+ })];
2054
+ }
2055
+ });
2056
+ }); });
1896
2057
  };
1897
2058
  },
1898
2059
  /**
@@ -1904,19 +2065,27 @@ export var PayeeLocationsApiFp = function (configuration) {
1904
2065
  * @throws {RequiredError}
1905
2066
  */
1906
2067
  getPayeeLocationsByPayee: function (budget_id, payee_id, options) {
2068
+ var _this = this;
1907
2069
  var localVarFetchArgs = PayeeLocationsApiFetchParamCreator(configuration).getPayeeLocationsByPayee(budget_id, payee_id, options);
1908
2070
  return function (fetchFunction) {
1909
2071
  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
- });
2072
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2073
+ var apiResponse;
2074
+ return __generator(this, function (_a) {
2075
+ switch (_a.label) {
2076
+ case 0:
2077
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2078
+ return [4 /*yield*/, response.json()];
2079
+ case 1:
2080
+ apiResponse = _a.sent();
2081
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2082
+ return [2 /*return*/, apiResponse];
2083
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2084
+ return Promise.reject(e);
2085
+ })];
2086
+ }
2087
+ });
2088
+ }); });
1920
2089
  };
1921
2090
  },
1922
2091
  };
@@ -2113,19 +2282,27 @@ export var PayeesApiFp = function (configuration) {
2113
2282
  * @throws {RequiredError}
2114
2283
  */
2115
2284
  getPayeeById: function (budget_id, payee_id, options) {
2285
+ var _this = this;
2116
2286
  var localVarFetchArgs = PayeesApiFetchParamCreator(configuration).getPayeeById(budget_id, payee_id, options);
2117
2287
  return function (fetchFunction) {
2118
2288
  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
- });
2289
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2290
+ var apiResponse;
2291
+ return __generator(this, function (_a) {
2292
+ switch (_a.label) {
2293
+ case 0:
2294
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2295
+ return [4 /*yield*/, response.json()];
2296
+ case 1:
2297
+ apiResponse = _a.sent();
2298
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2299
+ return [2 /*return*/, apiResponse];
2300
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2301
+ return Promise.reject(e);
2302
+ })];
2303
+ }
2304
+ });
2305
+ }); });
2129
2306
  };
2130
2307
  },
2131
2308
  /**
@@ -2137,19 +2314,27 @@ export var PayeesApiFp = function (configuration) {
2137
2314
  * @throws {RequiredError}
2138
2315
  */
2139
2316
  getPayees: function (budget_id, last_knowledge_of_server, options) {
2317
+ var _this = this;
2140
2318
  var localVarFetchArgs = PayeesApiFetchParamCreator(configuration).getPayees(budget_id, last_knowledge_of_server, options);
2141
2319
  return function (fetchFunction) {
2142
2320
  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
- });
2321
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2322
+ var apiResponse;
2323
+ return __generator(this, function (_a) {
2324
+ switch (_a.label) {
2325
+ case 0:
2326
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2327
+ return [4 /*yield*/, response.json()];
2328
+ case 1:
2329
+ apiResponse = _a.sent();
2330
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2331
+ return [2 /*return*/, apiResponse];
2332
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2333
+ return Promise.reject(e);
2334
+ })];
2335
+ }
2336
+ });
2337
+ }); });
2153
2338
  };
2154
2339
  },
2155
2340
  };
@@ -2325,19 +2510,27 @@ export var ScheduledTransactionsApiFp = function (configuration) {
2325
2510
  * @throws {RequiredError}
2326
2511
  */
2327
2512
  getScheduledTransactionById: function (budget_id, scheduled_transaction_id, options) {
2513
+ var _this = this;
2328
2514
  var localVarFetchArgs = ScheduledTransactionsApiFetchParamCreator(configuration).getScheduledTransactionById(budget_id, scheduled_transaction_id, options);
2329
2515
  return function (fetchFunction) {
2330
2516
  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
- });
2517
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2518
+ var apiResponse;
2519
+ return __generator(this, function (_a) {
2520
+ switch (_a.label) {
2521
+ case 0:
2522
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2523
+ return [4 /*yield*/, response.json()];
2524
+ case 1:
2525
+ apiResponse = _a.sent();
2526
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2527
+ return [2 /*return*/, apiResponse];
2528
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2529
+ return Promise.reject(e);
2530
+ })];
2531
+ }
2532
+ });
2533
+ }); });
2341
2534
  };
2342
2535
  },
2343
2536
  /**
@@ -2349,19 +2542,27 @@ export var ScheduledTransactionsApiFp = function (configuration) {
2349
2542
  * @throws {RequiredError}
2350
2543
  */
2351
2544
  getScheduledTransactions: function (budget_id, last_knowledge_of_server, options) {
2545
+ var _this = this;
2352
2546
  var localVarFetchArgs = ScheduledTransactionsApiFetchParamCreator(configuration).getScheduledTransactions(budget_id, last_knowledge_of_server, options);
2353
2547
  return function (fetchFunction) {
2354
2548
  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
- });
2549
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
2550
+ var apiResponse;
2551
+ return __generator(this, function (_a) {
2552
+ switch (_a.label) {
2553
+ case 0:
2554
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
2555
+ return [4 /*yield*/, response.json()];
2556
+ case 1:
2557
+ apiResponse = _a.sent();
2558
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
2559
+ return [2 /*return*/, apiResponse];
2560
+ case 2: return [2 /*return*/, response.json().then(function (e) {
2561
+ return Promise.reject(e);
2562
+ })];
2563
+ }
2564
+ });
2565
+ }); });
2365
2566
  };
2366
2567
  },
2367
2568
  };
@@ -2871,19 +3072,27 @@ export var TransactionsApiFp = function (configuration) {
2871
3072
  * @throws {RequiredError}
2872
3073
  */
2873
3074
  createTransaction: function (budget_id, data, options) {
3075
+ var _this = this;
2874
3076
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).createTransaction(budget_id, data, options);
2875
3077
  return function (fetchFunction) {
2876
3078
  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
- });
3079
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3080
+ var apiResponse;
3081
+ return __generator(this, function (_a) {
3082
+ switch (_a.label) {
3083
+ case 0:
3084
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3085
+ return [4 /*yield*/, response.json()];
3086
+ case 1:
3087
+ apiResponse = _a.sent();
3088
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3089
+ return [2 /*return*/, apiResponse];
3090
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3091
+ return Promise.reject(e);
3092
+ })];
3093
+ }
3094
+ });
3095
+ }); });
2887
3096
  };
2888
3097
  },
2889
3098
  /**
@@ -2895,19 +3104,27 @@ export var TransactionsApiFp = function (configuration) {
2895
3104
  * @throws {RequiredError}
2896
3105
  */
2897
3106
  getTransactionById: function (budget_id, transaction_id, options) {
3107
+ var _this = this;
2898
3108
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).getTransactionById(budget_id, transaction_id, options);
2899
3109
  return function (fetchFunction) {
2900
3110
  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
- });
3111
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3112
+ var apiResponse;
3113
+ return __generator(this, function (_a) {
3114
+ switch (_a.label) {
3115
+ case 0:
3116
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3117
+ return [4 /*yield*/, response.json()];
3118
+ case 1:
3119
+ apiResponse = _a.sent();
3120
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3121
+ return [2 /*return*/, apiResponse];
3122
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3123
+ return Promise.reject(e);
3124
+ })];
3125
+ }
3126
+ });
3127
+ }); });
2911
3128
  };
2912
3129
  },
2913
3130
  /**
@@ -2921,19 +3138,27 @@ export var TransactionsApiFp = function (configuration) {
2921
3138
  * @throws {RequiredError}
2922
3139
  */
2923
3140
  getTransactions: function (budget_id, since_date, type, last_knowledge_of_server, options) {
3141
+ var _this = this;
2924
3142
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).getTransactions(budget_id, since_date, type, last_knowledge_of_server, options);
2925
3143
  return function (fetchFunction) {
2926
3144
  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
- });
3145
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3146
+ var apiResponse;
3147
+ return __generator(this, function (_a) {
3148
+ switch (_a.label) {
3149
+ case 0:
3150
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3151
+ return [4 /*yield*/, response.json()];
3152
+ case 1:
3153
+ apiResponse = _a.sent();
3154
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3155
+ return [2 /*return*/, apiResponse];
3156
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3157
+ return Promise.reject(e);
3158
+ })];
3159
+ }
3160
+ });
3161
+ }); });
2937
3162
  };
2938
3163
  },
2939
3164
  /**
@@ -2948,19 +3173,27 @@ export var TransactionsApiFp = function (configuration) {
2948
3173
  * @throws {RequiredError}
2949
3174
  */
2950
3175
  getTransactionsByAccount: function (budget_id, account_id, since_date, type, last_knowledge_of_server, options) {
3176
+ var _this = this;
2951
3177
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).getTransactionsByAccount(budget_id, account_id, since_date, type, last_knowledge_of_server, options);
2952
3178
  return function (fetchFunction) {
2953
3179
  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
- });
3180
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3181
+ var apiResponse;
3182
+ return __generator(this, function (_a) {
3183
+ switch (_a.label) {
3184
+ case 0:
3185
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3186
+ return [4 /*yield*/, response.json()];
3187
+ case 1:
3188
+ apiResponse = _a.sent();
3189
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3190
+ return [2 /*return*/, apiResponse];
3191
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3192
+ return Promise.reject(e);
3193
+ })];
3194
+ }
3195
+ });
3196
+ }); });
2964
3197
  };
2965
3198
  },
2966
3199
  /**
@@ -2975,19 +3208,27 @@ export var TransactionsApiFp = function (configuration) {
2975
3208
  * @throws {RequiredError}
2976
3209
  */
2977
3210
  getTransactionsByCategory: function (budget_id, category_id, since_date, type, last_knowledge_of_server, options) {
3211
+ var _this = this;
2978
3212
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).getTransactionsByCategory(budget_id, category_id, since_date, type, last_knowledge_of_server, options);
2979
3213
  return function (fetchFunction) {
2980
3214
  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
- });
3215
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3216
+ var apiResponse;
3217
+ return __generator(this, function (_a) {
3218
+ switch (_a.label) {
3219
+ case 0:
3220
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3221
+ return [4 /*yield*/, response.json()];
3222
+ case 1:
3223
+ apiResponse = _a.sent();
3224
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3225
+ return [2 /*return*/, apiResponse];
3226
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3227
+ return Promise.reject(e);
3228
+ })];
3229
+ }
3230
+ });
3231
+ }); });
2991
3232
  };
2992
3233
  },
2993
3234
  /**
@@ -3002,19 +3243,27 @@ export var TransactionsApiFp = function (configuration) {
3002
3243
  * @throws {RequiredError}
3003
3244
  */
3004
3245
  getTransactionsByPayee: function (budget_id, payee_id, since_date, type, last_knowledge_of_server, options) {
3246
+ var _this = this;
3005
3247
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).getTransactionsByPayee(budget_id, payee_id, since_date, type, last_knowledge_of_server, options);
3006
3248
  return function (fetchFunction) {
3007
3249
  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
- });
3250
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3251
+ var apiResponse;
3252
+ return __generator(this, function (_a) {
3253
+ switch (_a.label) {
3254
+ case 0:
3255
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3256
+ return [4 /*yield*/, response.json()];
3257
+ case 1:
3258
+ apiResponse = _a.sent();
3259
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3260
+ return [2 /*return*/, apiResponse];
3261
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3262
+ return Promise.reject(e);
3263
+ })];
3264
+ }
3265
+ });
3266
+ }); });
3018
3267
  };
3019
3268
  },
3020
3269
  /**
@@ -3025,19 +3274,27 @@ export var TransactionsApiFp = function (configuration) {
3025
3274
  * @throws {RequiredError}
3026
3275
  */
3027
3276
  importTransactions: function (budget_id, options) {
3277
+ var _this = this;
3028
3278
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).importTransactions(budget_id, options);
3029
3279
  return function (fetchFunction) {
3030
3280
  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
- });
3281
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3282
+ var apiResponse;
3283
+ return __generator(this, function (_a) {
3284
+ switch (_a.label) {
3285
+ case 0:
3286
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3287
+ return [4 /*yield*/, response.json()];
3288
+ case 1:
3289
+ apiResponse = _a.sent();
3290
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3291
+ return [2 /*return*/, apiResponse];
3292
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3293
+ return Promise.reject(e);
3294
+ })];
3295
+ }
3296
+ });
3297
+ }); });
3041
3298
  };
3042
3299
  },
3043
3300
  /**
@@ -3050,19 +3307,27 @@ export var TransactionsApiFp = function (configuration) {
3050
3307
  * @throws {RequiredError}
3051
3308
  */
3052
3309
  updateTransaction: function (budget_id, transaction_id, data, options) {
3310
+ var _this = this;
3053
3311
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).updateTransaction(budget_id, transaction_id, data, options);
3054
3312
  return function (fetchFunction) {
3055
3313
  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
- });
3314
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3315
+ var apiResponse;
3316
+ return __generator(this, function (_a) {
3317
+ switch (_a.label) {
3318
+ case 0:
3319
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3320
+ return [4 /*yield*/, response.json()];
3321
+ case 1:
3322
+ apiResponse = _a.sent();
3323
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3324
+ return [2 /*return*/, apiResponse];
3325
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3326
+ return Promise.reject(e);
3327
+ })];
3328
+ }
3329
+ });
3330
+ }); });
3066
3331
  };
3067
3332
  },
3068
3333
  /**
@@ -3074,19 +3339,27 @@ export var TransactionsApiFp = function (configuration) {
3074
3339
  * @throws {RequiredError}
3075
3340
  */
3076
3341
  updateTransactions: function (budget_id, data, options) {
3342
+ var _this = this;
3077
3343
  var localVarFetchArgs = TransactionsApiFetchParamCreator(configuration).updateTransactions(budget_id, data, options);
3078
3344
  return function (fetchFunction) {
3079
3345
  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
- });
3346
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3347
+ var apiResponse;
3348
+ return __generator(this, function (_a) {
3349
+ switch (_a.label) {
3350
+ case 0:
3351
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3352
+ return [4 /*yield*/, response.json()];
3353
+ case 1:
3354
+ apiResponse = _a.sent();
3355
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3356
+ return [2 /*return*/, apiResponse];
3357
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3358
+ return Promise.reject(e);
3359
+ })];
3360
+ }
3361
+ });
3362
+ }); });
3090
3363
  };
3091
3364
  },
3092
3365
  };
@@ -3392,19 +3665,27 @@ export var UserApiFp = function (configuration) {
3392
3665
  * @throws {RequiredError}
3393
3666
  */
3394
3667
  getUser: function (options) {
3668
+ var _this = this;
3395
3669
  var localVarFetchArgs = UserApiFetchParamCreator(configuration).getUser(options);
3396
3670
  return function (fetchFunction) {
3397
3671
  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
- });
3672
+ return fetchFunction(configuration.basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) { return __awaiter(_this, void 0, void 0, function () {
3673
+ var apiResponse;
3674
+ return __generator(this, function (_a) {
3675
+ switch (_a.label) {
3676
+ case 0:
3677
+ if (!(response.status >= 200 && response.status < 300)) return [3 /*break*/, 2];
3678
+ return [4 /*yield*/, response.json()];
3679
+ case 1:
3680
+ apiResponse = _a.sent();
3681
+ apiResponse.rateLimit = response.headers.get("X-Rate-Limit");
3682
+ return [2 /*return*/, apiResponse];
3683
+ case 2: return [2 /*return*/, response.json().then(function (e) {
3684
+ return Promise.reject(e);
3685
+ })];
3686
+ }
3687
+ });
3688
+ }); });
3408
3689
  };
3409
3690
  },
3410
3691
  };