@marqeta/ux-toolkit-sdk-javascript 2.19.1 → 2.20.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.
@@ -2231,7 +2231,7 @@ var _MockCardRepository = /*#__PURE__*/ function() {
2231
2231
  },
2232
2232
  {
2233
2233
  key: "getShowpanByCardToken",
2234
- value: function getShowpanByCardToken(cardToken) {
2234
+ value: function getShowpanByCardToken(cardToken, shortCode) {
2235
2235
  return _async_to_generator(function() {
2236
2236
  var testCardTokenState;
2237
2237
  return _ts_generator(this, function(_state) {
@@ -2255,7 +2255,7 @@ var _MockCardRepository = /*#__PURE__*/ function() {
2255
2255
  },
2256
2256
  {
2257
2257
  key: "getCardByToken",
2258
- value: function getCardByToken(cardToken) {
2258
+ value: function getCardByToken(cardToken, shortCode) {
2259
2259
  return _async_to_generator(function() {
2260
2260
  var testCardTokenState, testInstrumentType;
2261
2261
  return _ts_generator(this, function(_state) {
@@ -2411,7 +2411,7 @@ var _GetCardByToken = /*#__PURE__*/ function() {
2411
2411
  _create_class(_GetCardByToken, [
2412
2412
  {
2413
2413
  key: "execute",
2414
- value: function execute(cardToken) {
2414
+ value: function execute(cardToken, shortCode) {
2415
2415
  var _this = this;
2416
2416
  return _async_to_generator(function() {
2417
2417
  return _ts_generator(this, function(_state) {
@@ -2419,7 +2419,7 @@ var _GetCardByToken = /*#__PURE__*/ function() {
2419
2419
  case 0:
2420
2420
  return [
2421
2421
  4,
2422
- _this.cardRepository.getCardByToken(cardToken)
2422
+ _this.cardRepository.getCardByToken(cardToken, shortCode)
2423
2423
  ];
2424
2424
  case 1:
2425
2425
  return [
@@ -2533,7 +2533,7 @@ var _GetShowpanByCardToken = /*#__PURE__*/ function() {
2533
2533
  _create_class(_GetShowpanByCardToken, [
2534
2534
  {
2535
2535
  key: "execute",
2536
- value: function execute(cardToken) {
2536
+ value: function execute(cardToken, shortCode) {
2537
2537
  var _this = this;
2538
2538
  return _async_to_generator(function() {
2539
2539
  return _ts_generator(this, function(_state) {
@@ -2541,7 +2541,7 @@ var _GetShowpanByCardToken = /*#__PURE__*/ function() {
2541
2541
  case 0:
2542
2542
  return [
2543
2543
  4,
2544
- _this.cardRepository.getShowpanByCardToken(cardToken)
2544
+ _this.cardRepository.getShowpanByCardToken(cardToken, shortCode)
2545
2545
  ];
2546
2546
  case 1:
2547
2547
  return [
@@ -2878,9 +2878,6 @@ var _UpdatePinByCardToken = /*#__PURE__*/ function() {
2878
2878
  ];
2879
2879
  case 1:
2880
2880
  card = _state.sent();
2881
- if (card.state === CardStates.UNACTIVATED) {
2882
- throw new MqSDKError("A card must be activated before its PIN can be updated");
2883
- }
2884
2881
  return [
2885
2882
  4,
2886
2883
  _this.cardRepository.updatePinByCardToken(pin, cardToken)
@@ -4406,42 +4403,25 @@ var _MockAuthCredentialService = /*#__PURE__*/ function() {
4406
4403
  value: function generateAuthKeyPair() {
4407
4404
  var _this = this;
4408
4405
  return _async_to_generator(function() {
4409
- var _ref, publicKey, privateKey, _, _tmp;
4410
4406
  return _ts_generator(this, function(_state) {
4411
- switch(_state.label){
4412
- case 0:
4413
- return [
4414
- 4,
4415
- crypto.subtle.generateKey({
4416
- name: "ECDSA",
4417
- namedCurve: "P-256"
4418
- }, true, [
4419
- "sign",
4420
- "verify"
4421
- ])
4422
- ];
4423
- case 1:
4424
- _ref = _state.sent(), publicKey = _ref.publicKey, privateKey = _ref.privateKey;
4425
- _ = _this.setAuthKeyPair;
4426
- _tmp = {};
4427
- return [
4428
- 4,
4429
- crypto.subtle.exportKey("jwk", publicKey)
4430
- ];
4431
- case 2:
4432
- _tmp.publicJwk = _state.sent();
4433
- return [
4434
- 4,
4435
- crypto.subtle.exportKey("jwk", privateKey)
4436
- ];
4437
- case 3:
4438
- _.apply(_this, [
4439
- (_tmp.privateJwk = _state.sent(), _tmp)
4440
- ]);
4441
- return [
4442
- 2
4443
- ];
4444
- }
4407
+ _this.setAuthKeyPair({
4408
+ publicJwk: {
4409
+ kty: "EC",
4410
+ crv: "P-256",
4411
+ x: "mock-x",
4412
+ y: "mock-y"
4413
+ },
4414
+ privateJwk: {
4415
+ kty: "EC",
4416
+ crv: "P-256",
4417
+ x: "mock-x",
4418
+ y: "mock-y",
4419
+ d: "mock-d"
4420
+ }
4421
+ });
4422
+ return [
4423
+ 2
4424
+ ];
4445
4425
  });
4446
4426
  })();
4447
4427
  }
@@ -9112,7 +9092,7 @@ var _RestCardRepository = /*#__PURE__*/ function() {
9112
9092
  _create_class(_RestCardRepository, [
9113
9093
  {
9114
9094
  key: "getCardByToken",
9115
- value: function getCardByToken(cardToken) {
9095
+ value: function getCardByToken(cardToken, shortCode) {
9116
9096
  var _this = this;
9117
9097
  return _async_to_generator(function() {
9118
9098
  var cuiApiBaseUrl, path, data, convertedData, error2;
@@ -9126,7 +9106,7 @@ var _RestCardRepository = /*#__PURE__*/ function() {
9126
9106
  3
9127
9107
  ]);
9128
9108
  cuiApiBaseUrl = _this.getEnvConfigValueByName.execute("CUI_API_BASE_URL");
9129
- path = "".concat(cuiApiBaseUrl, "/api/v1/cards/").concat(cardToken);
9109
+ path = "".concat(cuiApiBaseUrl, "/api/v1/cards/").concat(cardToken).concat(shortCode ? "?short_code=".concat(shortCode) : "");
9130
9110
  return [
9131
9111
  4,
9132
9112
  _this.httpClient.get(path)
@@ -9200,7 +9180,7 @@ var _RestCardRepository = /*#__PURE__*/ function() {
9200
9180
  },
9201
9181
  {
9202
9182
  key: "getShowpanByCardToken",
9203
- value: function getShowpanByCardToken(cardToken) {
9183
+ value: function getShowpanByCardToken(cardToken, shortCode) {
9204
9184
  var _this = this;
9205
9185
  return _async_to_generator(function() {
9206
9186
  var cuiApiBaseUrl, path, data, convertedData, error2;
@@ -9214,7 +9194,7 @@ var _RestCardRepository = /*#__PURE__*/ function() {
9214
9194
  3
9215
9195
  ]);
9216
9196
  cuiApiBaseUrl = _this.getEnvConfigValueByName.execute("CUI_API_BASE_URL");
9217
- path = "".concat(cuiApiBaseUrl, "/api/v1/cards/").concat(cardToken, "/showpan?show_cvv_number=true");
9197
+ path = "".concat(cuiApiBaseUrl, "/api/v1/cards/").concat(cardToken, "/showpan?show_cvv_number=true").concat(shortCode ? "&short_code=".concat(shortCode) : "");
9218
9198
  return [
9219
9199
  4,
9220
9200
  _this.httpClient.get(path)
@@ -14796,22 +14776,7 @@ var iKycRepository = _iKycRepository;
14796
14776
  iKycRepository = _ts_decorate81([
14797
14777
  injectable81()
14798
14778
  ], iKycRepository);
14799
- // src/kyc/adapters/rest/httpMocks.ts
14800
- var createJsonResponse = /* @__PURE__ */ __name(function(ok, status, errorId) {
14801
- return HttpResponse.json(_object_spread({
14802
- ok: ok
14803
- }, errorId && {
14804
- error: {
14805
- id: errorId,
14806
- debug: []
14807
- }
14808
- }, ok && {
14809
- result: mockKycVerificationResponse,
14810
- status: status
14811
- }), {
14812
- status: status
14813
- });
14814
- }, "createJsonResponse");
14779
+ // src/kyc/adapters/rest/httpMocks/mswKycHandlers.ts
14815
14780
  var mswKycHandlers = [
14816
14781
  http.post("".concat(mockMode_exports.CUI_API_BASE_URL, "/api/v1/kyc"), function() {
14817
14782
  var _ref = _async_to_generator(function(param) {
@@ -14829,13 +14794,18 @@ var mswKycHandlers = [
14829
14794
  if (body.accountHolderGroupToken === INVALID_ACCOUNT_HOLDER) {
14830
14795
  return [
14831
14796
  2,
14832
- createJsonResponse(false, 400)
14797
+ new HttpResponse(null, {
14798
+ status: 400,
14799
+ statusText: "Bad Request"
14800
+ })
14833
14801
  ];
14834
14802
  }
14835
14803
  if (body.lastName === "approve") {
14836
14804
  return [
14837
14805
  2,
14838
- createJsonResponse(true, 200)
14806
+ HttpResponse.json(mockKycVerificationResponse, {
14807
+ status: 200
14808
+ })
14839
14809
  ];
14840
14810
  }
14841
14811
  errorMap = {
@@ -14846,40 +14816,65 @@ var mswKycHandlers = [
14846
14816
  if (body.lastName && errorMap[body.lastName]) {
14847
14817
  return [
14848
14818
  2,
14849
- createJsonResponse(false, 400, errorMap[body.lastName || ""])
14819
+ new HttpResponse(JSON.stringify({
14820
+ ok: false,
14821
+ error: {
14822
+ id: errorMap[body.lastName],
14823
+ debug: []
14824
+ }
14825
+ }), {
14826
+ headers: {
14827
+ "content-type": "application/json"
14828
+ },
14829
+ status: 400,
14830
+ statusText: "Bad Request"
14831
+ })
14850
14832
  ];
14851
14833
  }
14852
- if (!(body.identifierType === "SSN")) return [
14853
- 3,
14854
- 4
14855
- ];
14856
- ssnErrorMap = (_obj = {}, _define_property(_obj, DOB_ISSUE_SSN, "KYC_BAD_DOB"), _define_property(_obj, NAME_ISSUE_SSN, "KYC_BAD_NAME"), _define_property(_obj, ADDRESS_ISSUE_SSN, "KYC_BAD_ADDRESS"), _define_property(_obj, OBAC_ISSUE_SSN, "KYC_OFAC_FAILURE"), _define_property(_obj, BAD_GENERAL_SSN, void 0), _obj);
14857
- if (!(body.identifierValue === LOADING_SSN)) return [
14858
- 3,
14859
- 3
14860
- ];
14861
- return [
14862
- 4,
14863
- delay("infinite")
14864
- ];
14865
- case 2:
14866
- return [
14867
- 2,
14868
- _state.sent()
14869
- ];
14870
- case 3:
14871
- if (body.identifierValue && ssnErrorMap[body.identifierValue]) {
14872
- errorId = ssnErrorMap[body.identifierValue];
14873
- return [
14874
- 2,
14875
- createJsonResponse(false, 400, errorId)
14876
- ];
14834
+ if (body.identifierType === "SSN") {
14835
+ ;
14836
+ ssnErrorMap = (_obj = {}, _define_property(_obj, DOB_ISSUE_SSN, "KYC_BAD_DOB"), _define_property(_obj, NAME_ISSUE_SSN, "KYC_BAD_NAME"), _define_property(_obj, ADDRESS_ISSUE_SSN, "KYC_BAD_ADDRESS"), _define_property(_obj, OBAC_ISSUE_SSN, "KYC_OFAC_FAILURE"), _define_property(_obj, BAD_GENERAL_SSN, void 0), _obj);
14837
+ if (body.identifierValue === LOADING_SSN) {
14838
+ return [
14839
+ 2,
14840
+ new Promise(function() {})
14841
+ ];
14842
+ }
14843
+ if (body.identifierValue && ssnErrorMap[body.identifierValue]) {
14844
+ errorId = ssnErrorMap[body.identifierValue];
14845
+ if (errorId) {
14846
+ return [
14847
+ 2,
14848
+ new HttpResponse(JSON.stringify({
14849
+ ok: false,
14850
+ error: {
14851
+ id: errorId,
14852
+ debug: []
14853
+ }
14854
+ }), {
14855
+ headers: {
14856
+ "content-type": "application/json"
14857
+ },
14858
+ status: 400,
14859
+ statusText: "Bad Request"
14860
+ })
14861
+ ];
14862
+ } else {
14863
+ return [
14864
+ 2,
14865
+ new HttpResponse(null, {
14866
+ status: 400,
14867
+ statusText: "Bad Request"
14868
+ })
14869
+ ];
14870
+ }
14871
+ }
14877
14872
  }
14878
- _state.label = 4;
14879
- case 4:
14880
14873
  return [
14881
14874
  2,
14882
- createJsonResponse(true, 200)
14875
+ HttpResponse.json(mockKycVerificationResponse, {
14876
+ status: 200
14877
+ })
14883
14878
  ];
14884
14879
  }
14885
14880
  });
@@ -15095,184 +15090,1276 @@ var mockKybEvaluationRequest = {
15095
15090
  ]
15096
15091
  };
15097
15092
  var mockKybVerificationResponse = {
15098
- infoMessage: "KYB verification in progress",
15093
+ status: KybEvaluationStatus.IN_PROGRESS,
15099
15094
  schema: {
15100
15095
  properties: {
15101
- "67c69b6f8bf323715f63302b": {
15096
+ "6603a3e6287d3100e9568837": {
15102
15097
  type: "string",
15103
- title: "Company name",
15104
- validationRules: []
15105
- },
15106
- "67c69b6f8bf323715f63302c": {
15107
- type: "string",
15108
- title: "Company number",
15109
- validationRules: []
15110
- }
15111
- },
15112
- required: [
15113
- "67c69b6f8bf323715f63302b",
15114
- "67c69b6f8bf323715f63302c"
15115
- ]
15116
- },
15117
- uiSchemaObject: {
15118
- "ui:rootFieldId": "kyc",
15119
- "ui:fields": {}
15120
- },
15121
- status: KybEvaluationStatus.IN_PROGRESS
15122
- };
15123
- // src/kyb/adapters/rest/httpMocks/mswKybHandlers.ts
15124
- var createJsonResponse2 = /* @__PURE__ */ __name(function(ok, status, errorId) {
15125
- var successResponse = mockKybVerificationResponse;
15126
- if (!ok) {
15127
- return HttpResponse.json({
15128
- status: "ERROR",
15129
- errorMessage: errorId || "Unknown error occurred"
15130
- }, {
15131
- status: status
15132
- });
15133
- }
15134
- return HttpResponse.json(successResponse, {
15135
- status: status
15136
- });
15137
- }, "createJsonResponse");
15138
- var validateWorkflowAnswer = /* @__PURE__ */ __name(function(answer) {
15139
- if (!answer.id || !answer.type || !("value" in answer)) {
15140
- return false;
15141
- }
15142
- switch(answer.type){
15143
- case "string":
15144
- case "phone":
15145
- return typeof answer.value === "string";
15146
- case "number":
15147
- case "integer":
15148
- return typeof answer.value === "number";
15149
- case "boolean":
15150
- return typeof answer.value === "boolean";
15151
- case "object":
15152
- return _type_of(answer.value) === "object";
15153
- default:
15154
- return false;
15155
- }
15156
- }, "validateWorkflowAnswer");
15157
- var mswKybHandlers = [
15158
- http.get("".concat(mockMode_exports.CUI_API_BASE_URL, "/api/v1/kyb/onboarding"), function() {
15159
- var _ref = _async_to_generator(function(param) {
15160
- var request, url, countryCode;
15161
- return _ts_generator(this, function(_state) {
15162
- request = param.request;
15163
- url = new URL(request.url);
15164
- countryCode = url.searchParams.get("locale_code");
15165
- if (!countryCode) {
15166
- return [
15167
- 2,
15168
- createJsonResponse2(false, 400, "KYB_MISSING_REQUIRED_PARAMS")
15169
- ];
15170
- }
15171
- return [
15172
- 2,
15173
- createJsonResponse2(true, 200)
15174
- ];
15175
- });
15176
- });
15177
- return function(_) {
15178
- return _ref.apply(this, arguments);
15179
- };
15180
- }()),
15181
- http.post("".concat(mockMode_exports.CUI_API_BASE_URL, "/api/v1/kyb/onboarding"), function() {
15182
- var _ref = _async_to_generator(function(param) {
15183
- var request, body, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, answer;
15184
- return _ts_generator(this, function(_state) {
15185
- switch(_state.label){
15186
- case 0:
15187
- request = param.request;
15188
- return [
15189
- 4,
15190
- request.json()
15191
- ];
15192
- case 1:
15193
- body = _state.sent();
15194
- if (!body.locale_code || !body.answers) {
15195
- return [
15196
- 2,
15197
- createJsonResponse2(false, 400, "KYB_MISSING_REQUIRED_FIELDS")
15198
- ];
15199
- }
15200
- if (!Array.isArray(body.answers) || body.answers.length === 0) {
15201
- return [
15202
- 2,
15203
- createJsonResponse2(false, 400, "KYB_INVALID_ANSWERS_FORMAT")
15204
- ];
15205
- }
15206
- _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
15207
- try {
15208
- for(_iterator = body.answers[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
15209
- answer = _step.value;
15210
- if (!validateWorkflowAnswer(answer)) {
15211
- return [
15212
- 2,
15213
- createJsonResponse2(false, 400, "KYB_INVALID_ANSWER_FORMAT")
15214
- ];
15215
- }
15216
- }
15217
- } catch (err) {
15218
- _didIteratorError = true;
15219
- _iteratorError = err;
15220
- } finally{
15221
- try {
15222
- if (!_iteratorNormalCompletion && _iterator.return != null) {
15223
- _iterator.return();
15224
- }
15225
- } finally{
15226
- if (_didIteratorError) {
15227
- throw _iteratorError;
15228
- }
15229
- }
15230
- }
15231
- return [
15232
- 2,
15233
- HttpResponse.json({
15234
- status: "COMPLETE",
15235
- infoMessage: "KYB verification completed successfully"
15236
- }, {
15237
- status: 200
15238
- })
15239
- ];
15240
- }
15241
- });
15242
- });
15243
- return function(_) {
15244
- return _ref.apply(this, arguments);
15245
- };
15246
- }())
15247
- ];
15248
- // src/kyb/adapters/rest/RestKybRepository.ts
15249
- import { inject as inject43, injectable as injectable84 } from "inversify";
15250
- function _ts_decorate84(decorators, target, key, desc) {
15251
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
15252
- if ((typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
15253
- else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
15254
- return c > 3 && r && Object.defineProperty(target, key, r), r;
15255
- }
15256
- __name(_ts_decorate84, "_ts_decorate");
15257
- function _ts_metadata45(k, v) {
15258
- if ((typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15259
- }
15260
- __name(_ts_metadata45, "_ts_metadata");
15261
- var _RestKybRepository = /*#__PURE__*/ function() {
15262
- "use strict";
15263
- function _RestKybRepository() {
15264
- _class_call_check(this, _RestKybRepository);
15265
- __publicField(this, "httpClient");
15266
- __publicField(this, "getEnvConfigValueByName");
15267
- }
15268
- _create_class(_RestKybRepository, [
15269
- {
15270
- key: "initializeOnboarding",
15271
- value: function initializeOnboarding(localeCode) {
15272
- var _this = this;
15273
- return _async_to_generator(function() {
15274
- var cuiApiBaseUrl, path, queryParams, err, error2;
15275
- return _ts_generator(this, function(_state) {
15098
+ title: "Country of incorporation",
15099
+ validationRules: [],
15100
+ oneOf: [
15101
+ {
15102
+ const: "AF",
15103
+ title: "Afghanistan"
15104
+ },
15105
+ {
15106
+ const: "AL",
15107
+ title: "Albania"
15108
+ },
15109
+ {
15110
+ const: "DZ",
15111
+ title: "Algeria"
15112
+ },
15113
+ {
15114
+ const: "AS",
15115
+ title: "American Samoa"
15116
+ },
15117
+ {
15118
+ const: "AD",
15119
+ title: "Andorra"
15120
+ },
15121
+ {
15122
+ const: "AO",
15123
+ title: "Angola"
15124
+ },
15125
+ {
15126
+ const: "AI",
15127
+ title: "Anguilla"
15128
+ },
15129
+ {
15130
+ const: "AQ",
15131
+ title: "Antarctica"
15132
+ },
15133
+ {
15134
+ const: "AG",
15135
+ title: "Antigua and Barbuda"
15136
+ },
15137
+ {
15138
+ const: "AR",
15139
+ title: "Argentina"
15140
+ },
15141
+ {
15142
+ const: "AM",
15143
+ title: "Armenia"
15144
+ },
15145
+ {
15146
+ const: "AW",
15147
+ title: "Aruba"
15148
+ },
15149
+ {
15150
+ const: "AU",
15151
+ title: "Australia"
15152
+ },
15153
+ {
15154
+ const: "AT",
15155
+ title: "Austria"
15156
+ },
15157
+ {
15158
+ const: "AZ",
15159
+ title: "Azerbaijan"
15160
+ },
15161
+ {
15162
+ const: "BS",
15163
+ title: "Bahamas"
15164
+ },
15165
+ {
15166
+ const: "BH",
15167
+ title: "Bahrain"
15168
+ },
15169
+ {
15170
+ const: "BD",
15171
+ title: "Bangladesh"
15172
+ },
15173
+ {
15174
+ const: "BB",
15175
+ title: "Barbados"
15176
+ },
15177
+ {
15178
+ const: "BY",
15179
+ title: "Belarus"
15180
+ },
15181
+ {
15182
+ const: "BE",
15183
+ title: "Belgium"
15184
+ },
15185
+ {
15186
+ const: "BZ",
15187
+ title: "Belize"
15188
+ },
15189
+ {
15190
+ const: "BJ",
15191
+ title: "Benin"
15192
+ },
15193
+ {
15194
+ const: "BM",
15195
+ title: "Bermuda"
15196
+ },
15197
+ {
15198
+ const: "BT",
15199
+ title: "Bhutan"
15200
+ },
15201
+ {
15202
+ const: "BO",
15203
+ title: "Bolivia, Plurinational State of"
15204
+ },
15205
+ {
15206
+ const: "BQ",
15207
+ title: "Bonaire, Sint Eustatius and Saba"
15208
+ },
15209
+ {
15210
+ const: "BA",
15211
+ title: "Bosnia and Herzegovina"
15212
+ },
15213
+ {
15214
+ const: "BW",
15215
+ title: "Botswana"
15216
+ },
15217
+ {
15218
+ const: "BV",
15219
+ title: "Bouvet Island"
15220
+ },
15221
+ {
15222
+ const: "BR",
15223
+ title: "Brazil"
15224
+ },
15225
+ {
15226
+ const: "IO",
15227
+ title: "British Indian Ocean Territory"
15228
+ },
15229
+ {
15230
+ const: "BN",
15231
+ title: "Brunei Darussalam"
15232
+ },
15233
+ {
15234
+ const: "BG",
15235
+ title: "Bulgaria"
15236
+ },
15237
+ {
15238
+ const: "BF",
15239
+ title: "Burkina Faso"
15240
+ },
15241
+ {
15242
+ const: "BI",
15243
+ title: "Burundi"
15244
+ },
15245
+ {
15246
+ const: "CV",
15247
+ title: "Cabo Verde"
15248
+ },
15249
+ {
15250
+ const: "KH",
15251
+ title: "Cambodia"
15252
+ },
15253
+ {
15254
+ const: "CM",
15255
+ title: "Cameroon"
15256
+ },
15257
+ {
15258
+ const: "CA",
15259
+ title: "Canada"
15260
+ },
15261
+ {
15262
+ const: "KY",
15263
+ title: "Cayman Islands"
15264
+ },
15265
+ {
15266
+ const: "CF",
15267
+ title: "Central African Republic"
15268
+ },
15269
+ {
15270
+ const: "TD",
15271
+ title: "Chad"
15272
+ },
15273
+ {
15274
+ const: "CL",
15275
+ title: "Chile"
15276
+ },
15277
+ {
15278
+ const: "CN",
15279
+ title: "China"
15280
+ },
15281
+ {
15282
+ const: "CX",
15283
+ title: "Christmas Island"
15284
+ },
15285
+ {
15286
+ const: "CC",
15287
+ title: "Cocos (Keeling) Islands"
15288
+ },
15289
+ {
15290
+ const: "CO",
15291
+ title: "Colombia"
15292
+ },
15293
+ {
15294
+ const: "KM",
15295
+ title: "Comoros"
15296
+ },
15297
+ {
15298
+ const: "CG",
15299
+ title: "Congo"
15300
+ },
15301
+ {
15302
+ const: "CD",
15303
+ title: "Congo, Democratic Republic of the"
15304
+ },
15305
+ {
15306
+ const: "CK",
15307
+ title: "Cook Islands"
15308
+ },
15309
+ {
15310
+ const: "CR",
15311
+ title: "Costa Rica"
15312
+ },
15313
+ {
15314
+ const: "CI",
15315
+ title: "C\xF4te d'Ivoire"
15316
+ },
15317
+ {
15318
+ const: "HR",
15319
+ title: "Croatia"
15320
+ },
15321
+ {
15322
+ const: "CU",
15323
+ title: "Cuba"
15324
+ },
15325
+ {
15326
+ const: "CW",
15327
+ title: "Cura\xE7ao"
15328
+ },
15329
+ {
15330
+ const: "CY",
15331
+ title: "Cyprus"
15332
+ },
15333
+ {
15334
+ const: "CZ",
15335
+ title: "Czechia"
15336
+ },
15337
+ {
15338
+ const: "DK",
15339
+ title: "Denmark"
15340
+ },
15341
+ {
15342
+ const: "DJ",
15343
+ title: "Djibouti"
15344
+ },
15345
+ {
15346
+ const: "DM",
15347
+ title: "Dominica"
15348
+ },
15349
+ {
15350
+ const: "DO",
15351
+ title: "Dominican Republic"
15352
+ },
15353
+ {
15354
+ const: "EC",
15355
+ title: "Ecuador"
15356
+ },
15357
+ {
15358
+ const: "EG",
15359
+ title: "Egypt"
15360
+ },
15361
+ {
15362
+ const: "SV",
15363
+ title: "El Salvador"
15364
+ },
15365
+ {
15366
+ const: "GQ",
15367
+ title: "Equatorial Guinea"
15368
+ },
15369
+ {
15370
+ const: "ER",
15371
+ title: "Eritrea"
15372
+ },
15373
+ {
15374
+ const: "EE",
15375
+ title: "Estonia"
15376
+ },
15377
+ {
15378
+ const: "SZ",
15379
+ title: "Eswatini"
15380
+ },
15381
+ {
15382
+ const: "ET",
15383
+ title: "Ethiopia"
15384
+ },
15385
+ {
15386
+ const: "FK",
15387
+ title: "Falkland Islands (Malvinas)"
15388
+ },
15389
+ {
15390
+ const: "FO",
15391
+ title: "Faroe Islands"
15392
+ },
15393
+ {
15394
+ const: "FJ",
15395
+ title: "Fiji"
15396
+ },
15397
+ {
15398
+ const: "FI",
15399
+ title: "Finland"
15400
+ },
15401
+ {
15402
+ const: "FR",
15403
+ title: "France"
15404
+ },
15405
+ {
15406
+ const: "GF",
15407
+ title: "French Guiana"
15408
+ },
15409
+ {
15410
+ const: "PF",
15411
+ title: "French Polynesia"
15412
+ },
15413
+ {
15414
+ const: "TF",
15415
+ title: "French Southern Territories"
15416
+ },
15417
+ {
15418
+ const: "GA",
15419
+ title: "Gabon"
15420
+ },
15421
+ {
15422
+ const: "GM",
15423
+ title: "Gambia"
15424
+ },
15425
+ {
15426
+ const: "GE",
15427
+ title: "Georgia"
15428
+ },
15429
+ {
15430
+ const: "DE",
15431
+ title: "Germany"
15432
+ },
15433
+ {
15434
+ const: "GH",
15435
+ title: "Ghana"
15436
+ },
15437
+ {
15438
+ const: "GI",
15439
+ title: "Gibraltar"
15440
+ },
15441
+ {
15442
+ const: "GR",
15443
+ title: "Greece"
15444
+ },
15445
+ {
15446
+ const: "GL",
15447
+ title: "Greenland"
15448
+ },
15449
+ {
15450
+ const: "GD",
15451
+ title: "Grenada"
15452
+ },
15453
+ {
15454
+ const: "GP",
15455
+ title: "Guadeloupe"
15456
+ },
15457
+ {
15458
+ const: "GU",
15459
+ title: "Guam"
15460
+ },
15461
+ {
15462
+ const: "GT",
15463
+ title: "Guatemala"
15464
+ },
15465
+ {
15466
+ const: "GG",
15467
+ title: "Guernsey"
15468
+ },
15469
+ {
15470
+ const: "GN",
15471
+ title: "Guinea"
15472
+ },
15473
+ {
15474
+ const: "GW",
15475
+ title: "Guinea-Bissau"
15476
+ },
15477
+ {
15478
+ const: "GY",
15479
+ title: "Guyana"
15480
+ },
15481
+ {
15482
+ const: "HT",
15483
+ title: "Haiti"
15484
+ },
15485
+ {
15486
+ const: "HM",
15487
+ title: "Heard Island and McDonald Islands"
15488
+ },
15489
+ {
15490
+ const: "VA",
15491
+ title: "Holy See"
15492
+ },
15493
+ {
15494
+ const: "HN",
15495
+ title: "Honduras"
15496
+ },
15497
+ {
15498
+ const: "HK",
15499
+ title: "Hong Kong"
15500
+ },
15501
+ {
15502
+ const: "HU",
15503
+ title: "Hungary"
15504
+ },
15505
+ {
15506
+ const: "IS",
15507
+ title: "Iceland"
15508
+ },
15509
+ {
15510
+ const: "IN",
15511
+ title: "India"
15512
+ },
15513
+ {
15514
+ const: "ID",
15515
+ title: "Indonesia"
15516
+ },
15517
+ {
15518
+ const: "IR",
15519
+ title: "Iran, Islamic Republic of"
15520
+ },
15521
+ {
15522
+ const: "IQ",
15523
+ title: "Iraq"
15524
+ },
15525
+ {
15526
+ const: "IE",
15527
+ title: "Ireland"
15528
+ },
15529
+ {
15530
+ const: "IM",
15531
+ title: "Isle of Man"
15532
+ },
15533
+ {
15534
+ const: "IL",
15535
+ title: "Israel"
15536
+ },
15537
+ {
15538
+ const: "IT",
15539
+ title: "Italy"
15540
+ },
15541
+ {
15542
+ const: "JM",
15543
+ title: "Jamaica"
15544
+ },
15545
+ {
15546
+ const: "JP",
15547
+ title: "Japan"
15548
+ },
15549
+ {
15550
+ const: "JE",
15551
+ title: "Jersey"
15552
+ },
15553
+ {
15554
+ const: "JO",
15555
+ title: "Jordan"
15556
+ },
15557
+ {
15558
+ const: "KZ",
15559
+ title: "Kazakhstan"
15560
+ },
15561
+ {
15562
+ const: "KE",
15563
+ title: "Kenya"
15564
+ },
15565
+ {
15566
+ const: "KI",
15567
+ title: "Kiribati"
15568
+ },
15569
+ {
15570
+ const: "KP",
15571
+ title: "Korea, Democratic People's Republic of"
15572
+ },
15573
+ {
15574
+ const: "KR",
15575
+ title: "Korea, Republic of"
15576
+ },
15577
+ {
15578
+ const: "KW",
15579
+ title: "Kuwait"
15580
+ },
15581
+ {
15582
+ const: "KG",
15583
+ title: "Kyrgyzstan"
15584
+ },
15585
+ {
15586
+ const: "LA",
15587
+ title: "Lao People's Democratic Republic"
15588
+ },
15589
+ {
15590
+ const: "LV",
15591
+ title: "Latvia"
15592
+ },
15593
+ {
15594
+ const: "LB",
15595
+ title: "Lebanon"
15596
+ },
15597
+ {
15598
+ const: "LS",
15599
+ title: "Lesotho"
15600
+ },
15601
+ {
15602
+ const: "LR",
15603
+ title: "Liberia"
15604
+ },
15605
+ {
15606
+ const: "LY",
15607
+ title: "Libya"
15608
+ },
15609
+ {
15610
+ const: "LI",
15611
+ title: "Liechtenstein"
15612
+ },
15613
+ {
15614
+ const: "LT",
15615
+ title: "Lithuania"
15616
+ },
15617
+ {
15618
+ const: "LU",
15619
+ title: "Luxembourg"
15620
+ },
15621
+ {
15622
+ const: "MO",
15623
+ title: "Macao"
15624
+ },
15625
+ {
15626
+ const: "MG",
15627
+ title: "Madagascar"
15628
+ },
15629
+ {
15630
+ const: "MW",
15631
+ title: "Malawi"
15632
+ },
15633
+ {
15634
+ const: "MY",
15635
+ title: "Malaysia"
15636
+ },
15637
+ {
15638
+ const: "MV",
15639
+ title: "Maldives"
15640
+ },
15641
+ {
15642
+ const: "ML",
15643
+ title: "Mali"
15644
+ },
15645
+ {
15646
+ const: "MT",
15647
+ title: "Malta"
15648
+ },
15649
+ {
15650
+ const: "MH",
15651
+ title: "Marshall Islands"
15652
+ },
15653
+ {
15654
+ const: "MQ",
15655
+ title: "Martinique"
15656
+ },
15657
+ {
15658
+ const: "MR",
15659
+ title: "Mauritania"
15660
+ },
15661
+ {
15662
+ const: "MU",
15663
+ title: "Mauritius"
15664
+ },
15665
+ {
15666
+ const: "YT",
15667
+ title: "Mayotte"
15668
+ },
15669
+ {
15670
+ const: "MX",
15671
+ title: "Mexico"
15672
+ },
15673
+ {
15674
+ const: "FM",
15675
+ title: "Micronesia, Federated States of"
15676
+ },
15677
+ {
15678
+ const: "MD",
15679
+ title: "Moldova, Republic of"
15680
+ },
15681
+ {
15682
+ const: "MC",
15683
+ title: "Monaco"
15684
+ },
15685
+ {
15686
+ const: "MN",
15687
+ title: "Mongolia"
15688
+ },
15689
+ {
15690
+ const: "ME",
15691
+ title: "Montenegro"
15692
+ },
15693
+ {
15694
+ const: "MS",
15695
+ title: "Montserrat"
15696
+ },
15697
+ {
15698
+ const: "MA",
15699
+ title: "Morocco"
15700
+ },
15701
+ {
15702
+ const: "MZ",
15703
+ title: "Mozambique"
15704
+ },
15705
+ {
15706
+ const: "MM",
15707
+ title: "Myanmar"
15708
+ },
15709
+ {
15710
+ const: "NA",
15711
+ title: "Namibia"
15712
+ },
15713
+ {
15714
+ const: "NR",
15715
+ title: "Nauru"
15716
+ },
15717
+ {
15718
+ const: "NP",
15719
+ title: "Nepal"
15720
+ },
15721
+ {
15722
+ const: "NL",
15723
+ title: "Netherlands, Kingdom of the"
15724
+ },
15725
+ {
15726
+ const: "NC",
15727
+ title: "New Caledonia"
15728
+ },
15729
+ {
15730
+ const: "NZ",
15731
+ title: "New Zealand"
15732
+ },
15733
+ {
15734
+ const: "NI",
15735
+ title: "Nicaragua"
15736
+ },
15737
+ {
15738
+ const: "NE",
15739
+ title: "Niger"
15740
+ },
15741
+ {
15742
+ const: "NG",
15743
+ title: "Nigeria"
15744
+ },
15745
+ {
15746
+ const: "NU",
15747
+ title: "Niue"
15748
+ },
15749
+ {
15750
+ const: "NF",
15751
+ title: "Norfolk Island"
15752
+ },
15753
+ {
15754
+ const: "MK",
15755
+ title: "North Macedonia"
15756
+ },
15757
+ {
15758
+ const: "MP",
15759
+ title: "Northern Mariana Islands"
15760
+ },
15761
+ {
15762
+ const: "NO",
15763
+ title: "Norway"
15764
+ },
15765
+ {
15766
+ const: "OM",
15767
+ title: "Oman"
15768
+ },
15769
+ {
15770
+ const: "PK",
15771
+ title: "Pakistan"
15772
+ },
15773
+ {
15774
+ const: "PW",
15775
+ title: "Palau"
15776
+ },
15777
+ {
15778
+ const: "PS",
15779
+ title: "Palestine, State of"
15780
+ },
15781
+ {
15782
+ const: "PA",
15783
+ title: "Panama"
15784
+ },
15785
+ {
15786
+ const: "PG",
15787
+ title: "Papua New Guinea"
15788
+ },
15789
+ {
15790
+ const: "PY",
15791
+ title: "Paraguay"
15792
+ },
15793
+ {
15794
+ const: "PE",
15795
+ title: "Peru"
15796
+ },
15797
+ {
15798
+ const: "PH",
15799
+ title: "Philippines"
15800
+ },
15801
+ {
15802
+ const: "PN",
15803
+ title: "Pitcairn"
15804
+ },
15805
+ {
15806
+ const: "PL",
15807
+ title: "Poland"
15808
+ },
15809
+ {
15810
+ const: "PT",
15811
+ title: "Portugal"
15812
+ },
15813
+ {
15814
+ const: "PR",
15815
+ title: "Puerto Rico"
15816
+ },
15817
+ {
15818
+ const: "QA",
15819
+ title: "Qatar"
15820
+ },
15821
+ {
15822
+ const: "RE",
15823
+ title: "R\xE9union"
15824
+ },
15825
+ {
15826
+ const: "RO",
15827
+ title: "Romania"
15828
+ },
15829
+ {
15830
+ const: "RU",
15831
+ title: "Russian Federation"
15832
+ },
15833
+ {
15834
+ const: "RW",
15835
+ title: "Rwanda"
15836
+ },
15837
+ {
15838
+ const: "BL",
15839
+ title: "Saint Barth\xE9lemy"
15840
+ },
15841
+ {
15842
+ const: "SH",
15843
+ title: "Saint Helena, Ascension and Tristan da Cunha"
15844
+ },
15845
+ {
15846
+ const: "KN",
15847
+ title: "Saint Kitts and Nevis"
15848
+ },
15849
+ {
15850
+ const: "LC",
15851
+ title: "Saint Lucia"
15852
+ },
15853
+ {
15854
+ const: "MF",
15855
+ title: "Saint Martin (French part)"
15856
+ },
15857
+ {
15858
+ const: "PM",
15859
+ title: "Saint Pierre and Miquelon"
15860
+ },
15861
+ {
15862
+ const: "VC",
15863
+ title: "Saint Vincent and the Grenadines"
15864
+ },
15865
+ {
15866
+ const: "WS",
15867
+ title: "Samoa"
15868
+ },
15869
+ {
15870
+ const: "SM",
15871
+ title: "San Marino"
15872
+ },
15873
+ {
15874
+ const: "ST",
15875
+ title: "Sao Tome and Principe"
15876
+ },
15877
+ {
15878
+ const: "SA",
15879
+ title: "Saudi Arabia"
15880
+ },
15881
+ {
15882
+ const: "SN",
15883
+ title: "Senegal"
15884
+ },
15885
+ {
15886
+ const: "RS",
15887
+ title: "Serbia"
15888
+ },
15889
+ {
15890
+ const: "SC",
15891
+ title: "Seychelles"
15892
+ },
15893
+ {
15894
+ const: "SL",
15895
+ title: "Sierra Leone"
15896
+ },
15897
+ {
15898
+ const: "SG",
15899
+ title: "Singapore"
15900
+ },
15901
+ {
15902
+ const: "SX",
15903
+ title: "Sint Maarten (Dutch part)"
15904
+ },
15905
+ {
15906
+ const: "SK",
15907
+ title: "Slovakia"
15908
+ },
15909
+ {
15910
+ const: "SI",
15911
+ title: "Slovenia"
15912
+ },
15913
+ {
15914
+ const: "SB",
15915
+ title: "Solomon Islands"
15916
+ },
15917
+ {
15918
+ const: "SO",
15919
+ title: "Somalia"
15920
+ },
15921
+ {
15922
+ const: "ZA",
15923
+ title: "South Africa"
15924
+ },
15925
+ {
15926
+ const: "GS",
15927
+ title: "South Georgia and the South Sandwich Islands"
15928
+ },
15929
+ {
15930
+ const: "SS",
15931
+ title: "South Sudan"
15932
+ },
15933
+ {
15934
+ const: "ES",
15935
+ title: "Spain"
15936
+ },
15937
+ {
15938
+ const: "LK",
15939
+ title: "Sri Lanka"
15940
+ },
15941
+ {
15942
+ const: "SD",
15943
+ title: "Sudan"
15944
+ },
15945
+ {
15946
+ const: "SR",
15947
+ title: "Suriname"
15948
+ },
15949
+ {
15950
+ const: "SJ",
15951
+ title: "Svalbard and Jan Mayen"
15952
+ },
15953
+ {
15954
+ const: "SE",
15955
+ title: "Sweden"
15956
+ },
15957
+ {
15958
+ const: "CH",
15959
+ title: "Switzerland"
15960
+ },
15961
+ {
15962
+ const: "SY",
15963
+ title: "Syrian Arab Republic"
15964
+ },
15965
+ {
15966
+ const: "TW",
15967
+ title: "Taiwan, Province of China"
15968
+ },
15969
+ {
15970
+ const: "TJ",
15971
+ title: "Tajikistan"
15972
+ },
15973
+ {
15974
+ const: "TZ",
15975
+ title: "Tanzania, United Republic of"
15976
+ },
15977
+ {
15978
+ const: "TH",
15979
+ title: "Thailand"
15980
+ },
15981
+ {
15982
+ const: "TL",
15983
+ title: "Timor-Leste"
15984
+ },
15985
+ {
15986
+ const: "TG",
15987
+ title: "Togo"
15988
+ },
15989
+ {
15990
+ const: "TK",
15991
+ title: "Tokelau"
15992
+ },
15993
+ {
15994
+ const: "TO",
15995
+ title: "Tonga"
15996
+ },
15997
+ {
15998
+ const: "TT",
15999
+ title: "Trinidad and Tobago"
16000
+ },
16001
+ {
16002
+ const: "TN",
16003
+ title: "Tunisia"
16004
+ },
16005
+ {
16006
+ const: "TR",
16007
+ title: "Turkey"
16008
+ },
16009
+ {
16010
+ const: "TM",
16011
+ title: "Turkmenistan"
16012
+ },
16013
+ {
16014
+ const: "TC",
16015
+ title: "Turks and Caicos Islands"
16016
+ },
16017
+ {
16018
+ const: "TV",
16019
+ title: "Tuvalu"
16020
+ },
16021
+ {
16022
+ const: "UG",
16023
+ title: "Uganda"
16024
+ },
16025
+ {
16026
+ const: "UA",
16027
+ title: "Ukraine"
16028
+ },
16029
+ {
16030
+ const: "AE",
16031
+ title: "United Arab Emirates"
16032
+ },
16033
+ {
16034
+ const: "GB",
16035
+ title: "United Kingdom of Great Britain and Northern Ireland"
16036
+ },
16037
+ {
16038
+ const: "UM",
16039
+ title: "United States Minor Outlying Islands"
16040
+ },
16041
+ {
16042
+ const: "US",
16043
+ title: "United States of America"
16044
+ },
16045
+ {
16046
+ const: "UY",
16047
+ title: "Uruguay"
16048
+ },
16049
+ {
16050
+ const: "UZ",
16051
+ title: "Uzbekistan"
16052
+ },
16053
+ {
16054
+ const: "VU",
16055
+ title: "Vanuatu"
16056
+ },
16057
+ {
16058
+ const: "VE",
16059
+ title: "Venezuela, Bolivarian Republic of"
16060
+ },
16061
+ {
16062
+ const: "VN",
16063
+ title: "Viet Nam"
16064
+ },
16065
+ {
16066
+ const: "VG",
16067
+ title: "Virgin Islands (British)"
16068
+ },
16069
+ {
16070
+ const: "VI",
16071
+ title: "Virgin Islands (U.S.)"
16072
+ },
16073
+ {
16074
+ const: "WF",
16075
+ title: "Wallis and Futuna"
16076
+ },
16077
+ {
16078
+ const: "EH",
16079
+ title: "Western Sahara"
16080
+ },
16081
+ {
16082
+ const: "YE",
16083
+ title: "Yemen"
16084
+ },
16085
+ {
16086
+ const: "ZM",
16087
+ title: "Zambia"
16088
+ },
16089
+ {
16090
+ const: "ZW",
16091
+ title: "Zimbabwe"
16092
+ }
16093
+ ]
16094
+ },
16095
+ "67c5e0988bf323715f63030c": {
16096
+ type: "string",
16097
+ title: "Date of incorporation",
16098
+ validationRules: []
16099
+ },
16100
+ "67c5e091ed74a27d4474c780": {
16101
+ type: "string",
16102
+ title: "Business type",
16103
+ validationRules: []
16104
+ },
16105
+ "6603ab69287d3100e9569177": {
16106
+ type: "phone",
16107
+ title: "Business Phone number",
16108
+ validationRules: [
16109
+ {
16110
+ type: "stringMaxLength",
16111
+ value: 12,
16112
+ errorMessage: "field_too_long",
16113
+ priority: 1
16114
+ }
16115
+ ]
16116
+ },
16117
+ "6682cfaf91f1621d0a26ad93": {
16118
+ type: "string",
16119
+ title: "Registered Business Name",
16120
+ validationRules: []
16121
+ },
16122
+ "6603aa0df673303eedf37c3d": {
16123
+ type: "string",
16124
+ title: "Doing Business as Name",
16125
+ validationRules: []
16126
+ },
16127
+ "66a7f8bab582af0691139a8f": {
16128
+ type: "string",
16129
+ title: "Business Registration Number",
16130
+ validationRules: []
16131
+ },
16132
+ "672a78c9c5105823eb193535": {
16133
+ type: "string",
16134
+ title: "TaxID or VAT number",
16135
+ validationRules: []
16136
+ },
16137
+ "6603a3e6287d3100e9568836": {
16138
+ type: "string",
16139
+ title: "Jurisdiction of Incorporation",
16140
+ validationRules: []
16141
+ },
16142
+ "68c40a8e0fcf327e2fce4d62": {
16143
+ type: "string",
16144
+ title: "Street",
16145
+ validationRules: []
16146
+ },
16147
+ "68c40a8e0fcf327e2fce4d63": {
16148
+ type: "string",
16149
+ title: "Building number",
16150
+ validationRules: []
16151
+ },
16152
+ "66a7f906b582af0691139b49": {
16153
+ type: "string",
16154
+ title: "City",
16155
+ validationRules: []
16156
+ },
16157
+ "666868112bfde900dccacefb": {
16158
+ type: "string",
16159
+ title: "State / Province ",
16160
+ validationRules: []
16161
+ },
16162
+ "6603a3e6287d3100e9568835": {
16163
+ type: "string",
16164
+ title: "ZIP code / Postal Code",
16165
+ validationRules: []
16166
+ },
16167
+ "67d95b0da078851d45fabd9d": {
16168
+ type: "string",
16169
+ title: "Business email",
16170
+ validationRules: []
16171
+ }
16172
+ },
16173
+ required: [
16174
+ "6603a3e6287d3100e9568837",
16175
+ "67c5e0988bf323715f63030c",
16176
+ "67c5e091ed74a27d4474c780",
16177
+ "6682cfaf91f1621d0a26ad93",
16178
+ "66a7f8bab582af0691139a8f",
16179
+ "672a78c9c5105823eb193535",
16180
+ "68c40a8e0fcf327e2fce4d62",
16181
+ "68c40a8e0fcf327e2fce4d63",
16182
+ "66a7f906b582af0691139b49",
16183
+ "666868112bfde900dccacefb",
16184
+ "6603a3e6287d3100e9568835",
16185
+ "67d95b0da078851d45fabd9d"
16186
+ ]
16187
+ },
16188
+ uiSchemaObject: {
16189
+ "ui:rootFieldId": "kyc",
16190
+ "ui:fields": {
16191
+ "6603a3e6287d3100e9568837": {
16192
+ "ui:widget": "select"
16193
+ },
16194
+ "67c5e0988bf323715f63030c": {
16195
+ "ui:widget": "date"
16196
+ },
16197
+ "6603ab69287d3100e9569177": {
16198
+ "ui:widget": "masked",
16199
+ "ui:inputType": "tel",
16200
+ "ui:maskOptions": {
16201
+ maskOptions: {
16202
+ mask: "000-000-0000"
16203
+ },
16204
+ maskedFieldName: "6603ab69287d3100e9569177"
16205
+ }
16206
+ }
16207
+ }
16208
+ }
16209
+ };
16210
+ // src/kyb/adapters/rest/httpMocks/mswKybHandlers.ts
16211
+ var createJsonResponse = /* @__PURE__ */ __name(function(ok, status, errorId) {
16212
+ var successResponse = mockKybVerificationResponse;
16213
+ if (!ok) {
16214
+ return HttpResponse.json({
16215
+ status: "ERROR",
16216
+ errorMessage: errorId || "Unknown error occurred"
16217
+ }, {
16218
+ status: status
16219
+ });
16220
+ }
16221
+ return HttpResponse.json(successResponse, {
16222
+ status: status
16223
+ });
16224
+ }, "createJsonResponse");
16225
+ var validateWorkflowAnswer = /* @__PURE__ */ __name(function(answer) {
16226
+ if (!answer.id || !answer.type || !("value" in answer)) {
16227
+ return false;
16228
+ }
16229
+ switch(answer.type){
16230
+ case "string":
16231
+ case "phone":
16232
+ return typeof answer.value === "string";
16233
+ case "number":
16234
+ case "integer":
16235
+ return typeof answer.value === "number";
16236
+ case "boolean":
16237
+ return typeof answer.value === "boolean";
16238
+ case "object":
16239
+ return _type_of(answer.value) === "object";
16240
+ default:
16241
+ return false;
16242
+ }
16243
+ }, "validateWorkflowAnswer");
16244
+ var mswKybHandlers = [
16245
+ http.get("".concat(mockMode_exports.CUI_API_BASE_URL, "/api/v1/kyb/onboarding"), function() {
16246
+ var _ref = _async_to_generator(function(param) {
16247
+ var request, url, countryCode;
16248
+ return _ts_generator(this, function(_state) {
16249
+ request = param.request;
16250
+ url = new URL(request.url);
16251
+ countryCode = url.searchParams.get("locale_code");
16252
+ if (!countryCode) {
16253
+ return [
16254
+ 2,
16255
+ createJsonResponse(false, 400, "KYB_MISSING_REQUIRED_PARAMS")
16256
+ ];
16257
+ }
16258
+ return [
16259
+ 2,
16260
+ createJsonResponse(true, 200)
16261
+ ];
16262
+ });
16263
+ });
16264
+ return function(_) {
16265
+ return _ref.apply(this, arguments);
16266
+ };
16267
+ }()),
16268
+ http.post("".concat(mockMode_exports.CUI_API_BASE_URL, "/api/v1/kyb/onboarding"), function() {
16269
+ var _ref = _async_to_generator(function(param) {
16270
+ var request, body, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, answer;
16271
+ return _ts_generator(this, function(_state) {
16272
+ switch(_state.label){
16273
+ case 0:
16274
+ request = param.request;
16275
+ return [
16276
+ 4,
16277
+ request.json()
16278
+ ];
16279
+ case 1:
16280
+ body = _state.sent();
16281
+ if (!body.locale_code || !body.answers) {
16282
+ return [
16283
+ 2,
16284
+ createJsonResponse(false, 400, "KYB_MISSING_REQUIRED_FIELDS")
16285
+ ];
16286
+ }
16287
+ if (!Array.isArray(body.answers) || body.answers.length === 0) {
16288
+ return [
16289
+ 2,
16290
+ createJsonResponse(false, 400, "KYB_INVALID_ANSWERS_FORMAT")
16291
+ ];
16292
+ }
16293
+ _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
16294
+ try {
16295
+ for(_iterator = body.answers[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
16296
+ answer = _step.value;
16297
+ if (!validateWorkflowAnswer(answer)) {
16298
+ return [
16299
+ 2,
16300
+ createJsonResponse(false, 400, "KYB_INVALID_ANSWER_FORMAT")
16301
+ ];
16302
+ }
16303
+ }
16304
+ } catch (err) {
16305
+ _didIteratorError = true;
16306
+ _iteratorError = err;
16307
+ } finally{
16308
+ try {
16309
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
16310
+ _iterator.return();
16311
+ }
16312
+ } finally{
16313
+ if (_didIteratorError) {
16314
+ throw _iteratorError;
16315
+ }
16316
+ }
16317
+ }
16318
+ return [
16319
+ 2,
16320
+ HttpResponse.json({
16321
+ status: "COMPLETE",
16322
+ infoMessage: "KYB verification completed successfully"
16323
+ }, {
16324
+ status: 200
16325
+ })
16326
+ ];
16327
+ }
16328
+ });
16329
+ });
16330
+ return function(_) {
16331
+ return _ref.apply(this, arguments);
16332
+ };
16333
+ }())
16334
+ ];
16335
+ // src/kyb/adapters/rest/RestKybRepository.ts
16336
+ import { inject as inject43, injectable as injectable84 } from "inversify";
16337
+ function _ts_decorate84(decorators, target, key, desc) {
16338
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16339
+ if ((typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
16340
+ else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
16341
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
16342
+ }
16343
+ __name(_ts_decorate84, "_ts_decorate");
16344
+ function _ts_metadata45(k, v) {
16345
+ if ((typeof Reflect === "undefined" ? "undefined" : _type_of(Reflect)) === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
16346
+ }
16347
+ __name(_ts_metadata45, "_ts_metadata");
16348
+ var _RestKybRepository = /*#__PURE__*/ function() {
16349
+ "use strict";
16350
+ function _RestKybRepository() {
16351
+ _class_call_check(this, _RestKybRepository);
16352
+ __publicField(this, "httpClient");
16353
+ __publicField(this, "getEnvConfigValueByName");
16354
+ }
16355
+ _create_class(_RestKybRepository, [
16356
+ {
16357
+ key: "initializeOnboarding",
16358
+ value: function initializeOnboarding(localeCode) {
16359
+ var _this = this;
16360
+ return _async_to_generator(function() {
16361
+ var cuiApiBaseUrl, path, queryParams, err, error2;
16362
+ return _ts_generator(this, function(_state) {
15276
16363
  switch(_state.label){
15277
16364
  case 0:
15278
16365
  _state.trys.push([
@@ -16733,10 +17820,16 @@ var _RestIdpService = /*#__PURE__*/ function(iIdpService) {
16733
17820
  value: function requestOtpCode(request) {
16734
17821
  var _this = this;
16735
17822
  return _async_to_generator(function() {
16736
- var url, response;
17823
+ var url, response, error2;
16737
17824
  return _ts_generator(this, function(_state) {
16738
17825
  switch(_state.label){
16739
17826
  case 0:
17827
+ _state.trys.push([
17828
+ 0,
17829
+ 2,
17830
+ ,
17831
+ 3
17832
+ ]);
16740
17833
  _this.validateOAuthBaseUrl(request.oauthBaseUrl);
16741
17834
  url = "".concat(request.oauthBaseUrl, "/mfa/challenge");
16742
17835
  return [
@@ -16761,6 +17854,13 @@ var _RestIdpService = /*#__PURE__*/ function(iIdpService) {
16761
17854
  oobCode: response.oob_code
16762
17855
  }
16763
17856
  ];
17857
+ case 2:
17858
+ error2 = _state.sent();
17859
+ throw new Error(error2.error_description || error2.error || error2);
17860
+ case 3:
17861
+ return [
17862
+ 2
17863
+ ];
16764
17864
  }
16765
17865
  });
16766
17866
  })();
@@ -16962,7 +18062,7 @@ var _RestIdpService = /*#__PURE__*/ function(iIdpService) {
16962
18062
  ];
16963
18063
  case 3:
16964
18064
  error2 = _state.sent();
16965
- throw new Error(error2.error_description || error2.error);
18065
+ throw new Error(error2.error_description || error2.error || error2);
16966
18066
  case 4:
16967
18067
  return [
16968
18068
  2
@@ -17223,7 +18323,6 @@ var _RestStatementsRepository = /*#__PURE__*/ function() {
17223
18323
  _class_call_check(this, _RestStatementsRepository);
17224
18324
  __publicField(this, "httpClient");
17225
18325
  __publicField(this, "getEnvConfigValueByName");
17226
- __publicField(this, "getActiveEnvName");
17227
18326
  }
17228
18327
  _create_class(_RestStatementsRepository, [
17229
18328
  {
@@ -17242,13 +18341,7 @@ var _RestStatementsRepository = /*#__PURE__*/ function() {
17242
18341
  3
17243
18342
  ]);
17244
18343
  queryParams = _this.convertPaginationParamsToQueryParams(paginationParams);
17245
- if ([
17246
- "localhost",
17247
- "qa",
17248
- "development"
17249
- ].includes(_this.getActiveEnvName.execute())) {
17250
- queryParams.set("direct", "true");
17251
- }
18344
+ queryParams.set("direct", "true");
17252
18345
  cuiApiBaseUrl = _this.getEnvConfigValueByName.execute("CUI_API_BASE_URL");
17253
18346
  path = "".concat(cuiApiBaseUrl, "/api/v1/statements?").concat(queryParams.toString());
17254
18347
  return [
@@ -17289,16 +18382,10 @@ var _RestStatementsRepository = /*#__PURE__*/ function() {
17289
18382
  3
17290
18383
  ]);
17291
18384
  queryParams = new URLSearchParams();
18385
+ queryParams.set("direct", "true");
17292
18386
  if (accountToken) {
17293
18387
  queryParams.set("account_token", accountToken);
17294
18388
  }
17295
- if ([
17296
- "localhost",
17297
- "qa",
17298
- "development"
17299
- ].includes(_this.getActiveEnvName.execute())) {
17300
- queryParams.set("direct", "true");
17301
- }
17302
18389
  cuiApiBaseUrl = _this.getEnvConfigValueByName.execute("CUI_API_BASE_URL");
17303
18390
  path = "".concat(cuiApiBaseUrl, "/api/v1/statements/").concat(issuedDate, "/download?").concat(queryParams.toString());
17304
18391
  return [
@@ -17358,10 +18445,6 @@ _ts_decorate99([
17358
18445
  inject52(INTR_GET_ENV_CONFIG_VALUE_BY_NAME),
17359
18446
  _ts_metadata54("design:type", typeof GetEnvConfigValueByName === "undefined" ? Object : GetEnvConfigValueByName)
17360
18447
  ], RestStatementsRepository.prototype, "getEnvConfigValueByName", void 0);
17361
- _ts_decorate99([
17362
- inject52(INTR_GET_ACTIVE_ENV_NAME),
17363
- _ts_metadata54("design:type", typeof GetActiveEnvName === "undefined" ? Object : GetActiveEnvName)
17364
- ], RestStatementsRepository.prototype, "getActiveEnvName", void 0);
17365
18448
  RestStatementsRepository = _ts_decorate99([
17366
18449
  injectable99()
17367
18450
  ], RestStatementsRepository);