@marqeta/ux-toolkit-sdk-javascript 2.15.1 → 2.15.3

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.
@@ -3791,7 +3791,7 @@ var _DpopAuthCredentialService = /*#__PURE__*/ function() {
3791
3791
  value: function createProofToken(method, resourceUrl) {
3792
3792
  var _this = this;
3793
3793
  return _async_to_generator(function() {
3794
- var keyPair, publicJwk, privateJwk, header, now, payload, _tmp;
3794
+ var keyPair, publicJwk, privateJwk, header, now, url, payload, _tmp;
3795
3795
  return _ts_generator(this, function(_state) {
3796
3796
  switch(_state.label){
3797
3797
  case 0:
@@ -3819,9 +3819,10 @@ var _DpopAuthCredentialService = /*#__PURE__*/ function() {
3819
3819
  jwk: publicJwk
3820
3820
  };
3821
3821
  now = Math.floor(Date.now() / 1e3);
3822
+ url = new URL(resourceUrl);
3822
3823
  _tmp = {
3823
3824
  htm: method,
3824
- htu: resourceUrl,
3825
+ htu: url.origin + url.pathname,
3825
3826
  jti: uuidv4(),
3826
3827
  iat: now
3827
3828
  };
@@ -4201,11 +4202,18 @@ function checkHttpStandizedError(httpIsOk, data) {
4201
4202
  function _checkHttpStandizedError() {
4202
4203
  _checkHttpStandizedError = // src/http-client/utils/checkHttpStandardizedError.ts
4203
4204
  _async_to_generator(function(httpIsOk, data) {
4204
- var error2, stdError, oauthError;
4205
+ var error2, convertedDebug, stdError, oauthError;
4205
4206
  return _ts_generator(this, function(_state) {
4206
4207
  error2 = data === null || data === void 0 ? void 0 : data.error;
4207
4208
  if ((error2 === null || error2 === void 0 ? void 0 : error2.id) && (error2 === null || error2 === void 0 ? void 0 : error2.debug)) {
4208
- stdError = new StandardizedError(error2.id, error2.debug, error2.details);
4209
+ convertedDebug = error2.debug.map(function(item) {
4210
+ return {
4211
+ source: item.source,
4212
+ code: item.code,
4213
+ err: new Error(item.message || "Unknown error")
4214
+ };
4215
+ });
4216
+ stdError = new StandardizedError(error2.id, convertedDebug, error2.details);
4209
4217
  console.log({
4210
4218
  stdError: stdError
4211
4219
  });
@@ -13217,7 +13225,7 @@ var _RestDisputeRepository = /*#__PURE__*/ function() {
13217
13225
  value: function uploadDocumentForDispute(disputeId, file, type, name, stepId, questionId) {
13218
13226
  var _this = this;
13219
13227
  return _async_to_generator(function() {
13220
- var cuiApiBaseUrl, path, formDataPayload, params, data, error2;
13228
+ var cuiApiBaseUrl, path, formDataPayload, fileForUpload, params, data, error2;
13221
13229
  return _ts_generator(this, function(_state) {
13222
13230
  switch(_state.label){
13223
13231
  case 0:
@@ -13230,7 +13238,12 @@ var _RestDisputeRepository = /*#__PURE__*/ function() {
13230
13238
  cuiApiBaseUrl = _this.getEnvConfigValueByName.execute("CUI_API_BASE_URL");
13231
13239
  path = "".concat(cuiApiBaseUrl, "/api/v1/disputes/").concat(disputeId, "/documents");
13232
13240
  formDataPayload = new FormData();
13233
- formDataPayload.append("file", file);
13241
+ fileForUpload = {
13242
+ uri: file.uri,
13243
+ type: file.mimeType || type,
13244
+ name: name
13245
+ };
13246
+ formDataPayload.append("file", fileForUpload);
13234
13247
  formDataPayload.append("name", name);
13235
13248
  formDataPayload.append("type", type);
13236
13249
  if (stepId) formDataPayload.append("step_id", "".concat(stepId));
@@ -3782,7 +3782,7 @@ var _DpopAuthCredentialService = /*#__PURE__*/ function() {
3782
3782
  value: function createProofToken(method, resourceUrl) {
3783
3783
  var _this = this;
3784
3784
  return _async_to_generator(function() {
3785
- var keyPair, publicJwk, privateJwk, header, now, payload, _tmp;
3785
+ var keyPair, publicJwk, privateJwk, header, now, url, payload, _tmp;
3786
3786
  return _ts_generator(this, function(_state) {
3787
3787
  switch(_state.label){
3788
3788
  case 0:
@@ -3810,9 +3810,10 @@ var _DpopAuthCredentialService = /*#__PURE__*/ function() {
3810
3810
  jwk: publicJwk
3811
3811
  };
3812
3812
  now = Math.floor(Date.now() / 1e3);
3813
+ url = new URL(resourceUrl);
3813
3814
  _tmp = {
3814
3815
  htm: method,
3815
- htu: resourceUrl,
3816
+ htu: url.origin + url.pathname,
3816
3817
  jti: _uuid.v4.call(void 0),
3817
3818
  iat: now
3818
3819
  };
@@ -4181,7 +4182,7 @@ function checkHttpStandizedError(httpIsOk, data) {
4181
4182
  function _checkHttpStandizedError() {
4182
4183
  _checkHttpStandizedError = // src/http-client/utils/checkHttpStandardizedError.ts
4183
4184
  _async_to_generator(function(httpIsOk, data) {
4184
- var error2, stdError, oauthError;
4185
+ var error2, convertedDebug, stdError, oauthError;
4185
4186
  return _ts_generator(this, function(_state) {
4186
4187
  error2 = _optionalChain([
4187
4188
  data,
@@ -4203,7 +4204,14 @@ function _checkHttpStandizedError() {
4203
4204
  return _10.debug;
4204
4205
  }
4205
4206
  ])) {
4206
- stdError = new StandardizedError(error2.id, error2.debug, error2.details);
4207
+ convertedDebug = error2.debug.map(function(item) {
4208
+ return {
4209
+ source: item.source,
4210
+ code: item.code,
4211
+ err: new Error(item.message || "Unknown error")
4212
+ };
4213
+ });
4214
+ stdError = new StandardizedError(error2.id, convertedDebug, error2.details);
4207
4215
  console.log({
4208
4216
  stdError: stdError
4209
4217
  });
@@ -13267,7 +13275,7 @@ var _RestDisputeRepository = /*#__PURE__*/ function() {
13267
13275
  value: function uploadDocumentForDispute(disputeId, file, type, name, stepId, questionId) {
13268
13276
  var _this = this;
13269
13277
  return _async_to_generator(function() {
13270
- var cuiApiBaseUrl, path, formDataPayload, params, data, error2;
13278
+ var cuiApiBaseUrl, path, formDataPayload, fileForUpload, params, data, error2;
13271
13279
  return _ts_generator(this, function(_state) {
13272
13280
  switch(_state.label){
13273
13281
  case 0:
@@ -13280,7 +13288,12 @@ var _RestDisputeRepository = /*#__PURE__*/ function() {
13280
13288
  cuiApiBaseUrl = _this.getEnvConfigValueByName.execute("CUI_API_BASE_URL");
13281
13289
  path = "".concat(cuiApiBaseUrl, "/api/v1/disputes/").concat(disputeId, "/documents");
13282
13290
  formDataPayload = new FormData();
13283
- formDataPayload.append("file", file);
13291
+ fileForUpload = {
13292
+ uri: file.uri,
13293
+ type: file.mimeType || type,
13294
+ name: name
13295
+ };
13296
+ formDataPayload.append("file", fileForUpload);
13284
13297
  formDataPayload.append("name", name);
13285
13298
  formDataPayload.append("type", type);
13286
13299
  if (stepId) formDataPayload.append("step_id", "".concat(stepId));