@marqeta/ux-toolkit-sdk-javascript 1.3.0 → 2.0.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/index.js CHANGED
@@ -900,6 +900,9 @@ __export(src_exports, {
900
900
  InitiateFunding: function() {
901
901
  return InitiateFunding;
902
902
  },
903
+ InterestTierResponseTypeEnum: function() {
904
+ return InterestTierResponseTypeEnum;
905
+ },
903
906
  IsMockModeEnabled: function() {
904
907
  return IsMockModeEnabled;
905
908
  },
@@ -1254,6 +1257,9 @@ __export(src_exports, {
1254
1257
  TransactionDirection: function() {
1255
1258
  return TransactionDirection;
1256
1259
  },
1260
+ TransactionDisputeStatus: function() {
1261
+ return TransactionDisputeStatus;
1262
+ },
1257
1263
  TransactionRecordStatus: function() {
1258
1264
  return TransactionRecordStatus;
1259
1265
  },
@@ -1425,6 +1431,12 @@ __export(src_exports, {
1425
1431
  getOffers: function() {
1426
1432
  return getOffers;
1427
1433
  },
1434
+ getOutagesByToken: function() {
1435
+ return getOutagesByToken;
1436
+ },
1437
+ getOutagesList: function() {
1438
+ return getOutagesList;
1439
+ },
1428
1440
  getSessionId: function() {
1429
1441
  return getSessionId;
1430
1442
  },
@@ -6405,54 +6417,41 @@ var _RestAuthService = /*#__PURE__*/ function() {
6405
6417
  value: function getCardholderContext() {
6406
6418
  var _this = this;
6407
6419
  return _async_to_generator(function() {
6408
- var cardholderContext, token, cuiApiBaseUrl, path, response, data, convertedData, error2;
6420
+ var cardholderContext, cuiApiBaseUrl, path, data, convertedData, error2;
6409
6421
  return _ts_generator(this, function(_state) {
6410
6422
  switch(_state.label){
6411
6423
  case 0:
6412
6424
  _state.trys.push([
6413
6425
  0,
6414
- 4,
6426
+ 3,
6415
6427
  ,
6416
- 5
6428
+ 4
6417
6429
  ]);
6418
6430
  if (!!cardholderContext) return [
6419
6431
  3,
6420
- 3
6432
+ 2
6421
6433
  ];
6422
- token = _this.cacheService.get("token");
6423
6434
  cuiApiBaseUrl = _this.getEnvConfigValueByName.execute("CUI_API_BASE_URL");
6424
6435
  path = "".concat(cuiApiBaseUrl, "/api/v1/auth/cardholder-context");
6425
6436
  return [
6426
6437
  4,
6427
- fetch(path, {
6428
- method: "GET",
6429
- headers: {
6430
- "Authorization": "Bearer ".concat(token),
6431
- "Content-Type": "application/json"
6432
- }
6433
- })
6438
+ _this.authenticatedHttpClient.get(path)
6434
6439
  ];
6435
6440
  case 1:
6436
- response = _state.sent();
6437
- return [
6438
- 4,
6439
- response.json()
6440
- ];
6441
- case 2:
6442
6441
  data = _state.sent();
6443
6442
  convertedData = convertObjKeysToLowerCamelCase(convertObjKeysToCamelCase(data === null || data === void 0 ? void 0 : data.data));
6444
6443
  cardholderContext = new CardholderContextEntity(convertedData);
6445
6444
  _this.cacheService.set("cardholderContext", cardholderContext);
6446
- _state.label = 3;
6447
- case 3:
6445
+ _state.label = 2;
6446
+ case 2:
6448
6447
  return [
6449
6448
  3,
6450
- 5
6449
+ 4
6451
6450
  ];
6452
- case 4:
6451
+ case 3:
6453
6452
  error2 = _state.sent();
6454
6453
  throw new Error("Error during getCardholderContext ".concat(error2));
6455
- case 5:
6454
+ case 4:
6456
6455
  return [
6457
6456
  2,
6458
6457
  new CardholderContextEntity(cardholderContext)
@@ -6467,53 +6466,40 @@ var _RestAuthService = /*#__PURE__*/ function() {
6467
6466
  value: function getUserTokenHash() {
6468
6467
  var _this = this;
6469
6468
  return _async_to_generator(function() {
6470
- var userTokenHash, token, cuiApiBaseUrl, path, response, data, error2;
6469
+ var userTokenHash, cuiApiBaseUrl, path, data, error2;
6471
6470
  return _ts_generator(this, function(_state) {
6472
6471
  switch(_state.label){
6473
6472
  case 0:
6474
6473
  _state.trys.push([
6475
6474
  0,
6476
- 4,
6475
+ 3,
6477
6476
  ,
6478
- 5
6477
+ 4
6479
6478
  ]);
6480
6479
  if (!!userTokenHash) return [
6481
6480
  3,
6482
- 3
6481
+ 2
6483
6482
  ];
6484
- token = _this.cacheService.get("token");
6485
6483
  cuiApiBaseUrl = _this.getEnvConfigValueByName.execute("CUI_API_BASE_URL");
6486
6484
  path = "".concat(cuiApiBaseUrl, "/api/v1/auth/user-token-hash");
6487
6485
  return [
6488
6486
  4,
6489
- fetch(path, {
6490
- method: "GET",
6491
- headers: {
6492
- "Authorization": "Bearer ".concat(token),
6493
- "Content-Type": "application/json"
6494
- }
6495
- })
6487
+ _this.authenticatedHttpClient.get(path)
6496
6488
  ];
6497
6489
  case 1:
6498
- response = _state.sent();
6499
- return [
6500
- 4,
6501
- response.json()
6502
- ];
6503
- case 2:
6504
6490
  data = _state.sent();
6505
6491
  userTokenHash = data.user_token_hash;
6506
6492
  _this.cacheService.set("userTokenHash", userTokenHash);
6507
- _state.label = 3;
6508
- case 3:
6493
+ _state.label = 2;
6494
+ case 2:
6509
6495
  return [
6510
6496
  3,
6511
- 5
6497
+ 4
6512
6498
  ];
6513
- case 4:
6499
+ case 3:
6514
6500
  error2 = _state.sent();
6515
6501
  throw new Error("Error during getUserTokenHash ".concat(error2));
6516
- case 5:
6502
+ case 4:
6517
6503
  return [
6518
6504
  2,
6519
6505
  userTokenHash
@@ -19202,6 +19188,11 @@ var AccountType;
19202
19188
  AccountType2["CHECKING"] = "CHECKING";
19203
19189
  AccountType2["SAVINGS"] = "SAVINGS";
19204
19190
  })(AccountType || (AccountType = {}));
19191
+ var InterestTierResponseTypeEnum;
19192
+ (function(InterestTierResponseTypeEnum2) {
19193
+ InterestTierResponseTypeEnum2["Checking"] = "CHECKING";
19194
+ InterestTierResponseTypeEnum2["Savings"] = "SAVINGS";
19195
+ })(InterestTierResponseTypeEnum || (InterestTierResponseTypeEnum = {}));
19205
19196
  // src/wla/base/types/AccountTransactions.ts
19206
19197
  var TransactionDirection;
19207
19198
  (function(TransactionDirection2) {
@@ -19337,6 +19328,11 @@ var BannerTypeEnum;
19337
19328
  BannerTypeEnum2["Info"] = "INFO";
19338
19329
  BannerTypeEnum2["Warning"] = "WARNING";
19339
19330
  })(BannerTypeEnum || (BannerTypeEnum = {}));
19331
+ var TransactionDisputeStatus;
19332
+ (function(TransactionDisputeStatus2) {
19333
+ TransactionDisputeStatus2["InReview"] = "IN_REVIEW";
19334
+ TransactionDisputeStatus2["Completed"] = "COMPLETED";
19335
+ })(TransactionDisputeStatus || (TransactionDisputeStatus = {}));
19340
19336
  var TransactionDetailResponseIconTypeEnum;
19341
19337
  (function(TransactionDetailResponseIconTypeEnum2) {
19342
19338
  TransactionDetailResponseIconTypeEnum2["Payout"] = "PAYOUT";
@@ -20373,7 +20369,7 @@ var _RestWlaService = /*#__PURE__*/ function() {
20373
20369
  {
20374
20370
  key: "getAccountDetails",
20375
20371
  value: function getAccountDetails(accountToken) {
20376
- var includeYtdInterest = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
20372
+ var includeYtdInterest = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, includeInterestTiers = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
20377
20373
  var _this = this;
20378
20374
  return _async_to_generator(function() {
20379
20375
  var cuiApiBaseUrl, queryParams, path, params, data, error2;
@@ -20389,7 +20385,8 @@ var _RestWlaService = /*#__PURE__*/ function() {
20389
20385
  cuiApiBaseUrl = _this.getEnvConfigValueByName.execute("CUI_API_BASE_URL");
20390
20386
  queryParams = new URLSearchParams({
20391
20387
  account_token: accountToken,
20392
- include_ytd_interest: "".concat(includeYtdInterest)
20388
+ include_ytd_interest: "".concat(includeYtdInterest),
20389
+ include_interest_tier: "".concat(includeInterestTiers)
20393
20390
  });
20394
20391
  path = "".concat(cuiApiBaseUrl, "/api/v1/wla/account?").concat(queryParams.toString());
20395
20392
  params = {
@@ -20563,6 +20560,90 @@ var _RestWlaService = /*#__PURE__*/ function() {
20563
20560
  });
20564
20561
  })();
20565
20562
  }
20563
+ },
20564
+ {
20565
+ key: "getOutageByToken",
20566
+ value: function getOutageByToken(token) {
20567
+ var devicePlatform = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "ANDROID";
20568
+ var _this = this;
20569
+ return _async_to_generator(function() {
20570
+ var cuiApiBaseUrl, path, params, error2;
20571
+ return _ts_generator(this, function(_state) {
20572
+ switch(_state.label){
20573
+ case 0:
20574
+ _state.trys.push([
20575
+ 0,
20576
+ 2,
20577
+ ,
20578
+ 3
20579
+ ]);
20580
+ cuiApiBaseUrl = _this.getEnvConfigValueByName.execute("CUI_API_BASE_URL");
20581
+ path = "".concat(cuiApiBaseUrl, "/api/v1/wla/outages/").concat(token, "?device_platform=").concat(devicePlatform);
20582
+ params = {
20583
+ headers: _this.getCommonWlaApiHeaders()
20584
+ };
20585
+ return [
20586
+ 4,
20587
+ _this.httpClient.get(path, params)
20588
+ ];
20589
+ case 1:
20590
+ return [
20591
+ 2,
20592
+ _state.sent()
20593
+ ];
20594
+ case 2:
20595
+ error2 = _state.sent();
20596
+ throw new MqSDKError("Unable to get Outages for the token provided", error2);
20597
+ case 3:
20598
+ return [
20599
+ 2
20600
+ ];
20601
+ }
20602
+ });
20603
+ })();
20604
+ }
20605
+ },
20606
+ {
20607
+ key: "getOutagesList",
20608
+ value: function getOutagesList() {
20609
+ var devicePlatform = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "ANDROID";
20610
+ var _this = this;
20611
+ return _async_to_generator(function() {
20612
+ var cuiApiBaseUrl, path, params, error2;
20613
+ return _ts_generator(this, function(_state) {
20614
+ switch(_state.label){
20615
+ case 0:
20616
+ _state.trys.push([
20617
+ 0,
20618
+ 2,
20619
+ ,
20620
+ 3
20621
+ ]);
20622
+ cuiApiBaseUrl = _this.getEnvConfigValueByName.execute("CUI_API_BASE_URL");
20623
+ path = "".concat(cuiApiBaseUrl, "/api/v1/wla/outages?device_platform=").concat(devicePlatform);
20624
+ params = {
20625
+ headers: _this.getCommonWlaApiHeaders()
20626
+ };
20627
+ return [
20628
+ 4,
20629
+ _this.httpClient.get(path, params)
20630
+ ];
20631
+ case 1:
20632
+ return [
20633
+ 2,
20634
+ _state.sent()
20635
+ ];
20636
+ case 2:
20637
+ error2 = _state.sent();
20638
+ throw new MqSDKError("Unable to get Outages", error2);
20639
+ case 3:
20640
+ return [
20641
+ 2
20642
+ ];
20643
+ }
20644
+ });
20645
+ })();
20646
+ }
20566
20647
  }
20567
20648
  ]);
20568
20649
  return _RestWlaService;
@@ -20849,19 +20930,19 @@ function _getOffers() {
20849
20930
  return _getOffers.apply(this, arguments);
20850
20931
  }
20851
20932
  __name(getOffers, "getOffers");
20852
- function getWlaAccountDetails(accountToken, includeYtdInterest) {
20933
+ function getWlaAccountDetails(accountToken, includeYtdInterest, includeInterestTiers) {
20853
20934
  return _getWlaAccountDetails.apply(this, arguments);
20854
20935
  }
20855
20936
  function _getWlaAccountDetails() {
20856
20937
  _getWlaAccountDetails = // src/wla/base/interactors/getWlaAccountDetails.ts
20857
- _async_to_generator(function(accountToken, includeYtdInterest) {
20938
+ _async_to_generator(function(accountToken, includeYtdInterest, includeInterestTiers) {
20858
20939
  var container2, wlaService;
20859
20940
  return _ts_generator(this, function(_state) {
20860
20941
  container2 = getActiveIocContainer();
20861
20942
  wlaService = container2.get(ITF_WLA_SERVICE);
20862
20943
  return [
20863
20944
  2,
20864
- wlaService.getAccountDetails(accountToken, includeYtdInterest)
20945
+ wlaService.getAccountDetails(accountToken, includeYtdInterest, includeInterestTiers)
20865
20946
  ];
20866
20947
  });
20867
20948
  });
@@ -21229,6 +21310,44 @@ function _replaceWlaCard() {
21229
21310
  return _replaceWlaCard.apply(this, arguments);
21230
21311
  }
21231
21312
  __name(replaceWlaCard, "replaceWlaCard");
21313
+ function getOutagesList(devicePlatform) {
21314
+ return _getOutagesList.apply(this, arguments);
21315
+ }
21316
+ function _getOutagesList() {
21317
+ _getOutagesList = // src/wla/base/interactors/getOutagesList.ts
21318
+ _async_to_generator(function(devicePlatform) {
21319
+ var container2, wlaService;
21320
+ return _ts_generator(this, function(_state) {
21321
+ container2 = getActiveIocContainer();
21322
+ wlaService = container2.get(ITF_WLA_SERVICE);
21323
+ return [
21324
+ 2,
21325
+ wlaService.getOutagesList(devicePlatform)
21326
+ ];
21327
+ });
21328
+ });
21329
+ return _getOutagesList.apply(this, arguments);
21330
+ }
21331
+ __name(getOutagesList, "getOutagesList");
21332
+ function getOutagesByToken(outageToken, devicePlatform) {
21333
+ return _getOutagesByToken.apply(this, arguments);
21334
+ }
21335
+ function _getOutagesByToken() {
21336
+ _getOutagesByToken = // src/wla/base/interactors/getOutagesByToken.ts
21337
+ _async_to_generator(function(outageToken, devicePlatform) {
21338
+ var container2, wlaService;
21339
+ return _ts_generator(this, function(_state) {
21340
+ container2 = getActiveIocContainer();
21341
+ wlaService = container2.get(ITF_WLA_SERVICE);
21342
+ return [
21343
+ 2,
21344
+ wlaService.getOutageByToken(outageToken, devicePlatform)
21345
+ ];
21346
+ });
21347
+ });
21348
+ return _getOutagesByToken.apply(this, arguments);
21349
+ }
21350
+ __name(getOutagesByToken, "getOutagesByToken");
21232
21351
  // src/wla/ioc/WlaIocModule.ts
21233
21352
  var import_inversify134 = require("inversify");
21234
21353
  var WlaIocModule = new import_inversify134.ContainerModule(function(bind) {
@@ -21734,6 +21853,7 @@ setActiveIocContainer(container);
21734
21853
  ITF_USERS: ITF_USERS,
21735
21854
  ITF_WLA_SERVICE: ITF_WLA_SERVICE,
21736
21855
  InitiateFunding: InitiateFunding,
21856
+ InterestTierResponseTypeEnum: InterestTierResponseTypeEnum,
21737
21857
  IsMockModeEnabled: IsMockModeEnabled,
21738
21858
  KycVerificationRequestIdentifierTypeEnum: KycVerificationRequestIdentifierTypeEnum,
21739
21859
  LIST_OF_ENABLED_COMPONENTS: LIST_OF_ENABLED_COMPONENTS,
@@ -21852,6 +21972,7 @@ setActiveIocContainer(container);
21852
21972
  TransactionDetailResponseIconTypeEnum: TransactionDetailResponseIconTypeEnum,
21853
21973
  TransactionDetailsBannerType: TransactionDetailsBannerType,
21854
21974
  TransactionDirection: TransactionDirection,
21975
+ TransactionDisputeStatus: TransactionDisputeStatus,
21855
21976
  TransactionRecordStatus: TransactionRecordStatus,
21856
21977
  TransactionStatus: TransactionStatus,
21857
21978
  TransactionType: TransactionType,
@@ -21909,6 +22030,8 @@ setActiveIocContainer(container);
21909
22030
  getMockUserRequestToCreateResponse: getMockUserRequestToCreateResponse,
21910
22031
  getOfferDetails: getOfferDetails,
21911
22032
  getOffers: getOffers,
22033
+ getOutagesByToken: getOutagesByToken,
22034
+ getOutagesList: getOutagesList,
21912
22035
  getSessionId: getSessionId,
21913
22036
  getSsoAccessTokenHandler: getSsoAccessTokenHandler,
21914
22037
  getUserProgram: getUserProgram,