@experian-ecs/connected-api-sdk 1.0.1 → 1.0.2

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.
@@ -12,26 +12,26 @@
12
12
  * OTHER LIABILITY ARISING FROM OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS CODE.
13
13
  */
14
14
 
15
- var Tt = Object.defineProperty;
15
+ var St = Object.defineProperty;
16
16
  var yt = (r) => {
17
17
  throw TypeError(r);
18
18
  };
19
- var ft = (r, t, e) => t in r ? Tt(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
19
+ var ft = (r, t, e) => t in r ? St(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
20
20
  var u = (r, t, e) => ft(r, typeof t != "symbol" ? t + "" : t, e), Q = (r, t, e) => t.has(r) || yt("Cannot " + e);
21
21
  var a = (r, t, e) => (Q(r, t, "read from private field"), e ? e.call(r) : t.get(r)), d = (r, t, e) => t.has(r) ? yt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), W = (r, t, e, s) => (Q(r, t, "write to private field"), s ? s.call(r, e) : t.set(r, e), e), p = (r, t, e) => (Q(r, t, "access private method"), e);
22
- function Ut(r) {
22
+ function At(r) {
23
23
  switch (r.type) {
24
24
  case "api_error":
25
- return new At(r);
25
+ return new Ut(r);
26
26
  case "auth_error":
27
27
  return new Pt(r);
28
28
  case "sdk_error":
29
- return new _t(r);
30
- default:
31
29
  return new Ct(r);
30
+ default:
31
+ return new xt(r);
32
32
  }
33
33
  }
34
- class U extends Error {
34
+ class A extends Error {
35
35
  constructor(e) {
36
36
  var s;
37
37
  super(e.message);
@@ -41,53 +41,56 @@ class U extends Error {
41
41
  this.message = ((s = e.data) == null ? void 0 : s.message) || e.message || "", this.data = e.data, this.status = e.status;
42
42
  }
43
43
  }
44
- u(U, "generateError", Ut);
45
- class At extends U {
44
+ u(A, "generateError", At);
45
+ class Ut extends A {
46
46
  constructor(t) {
47
47
  super(t), this.name = "ConnectedSolutionsClientApiError";
48
48
  }
49
49
  }
50
- class Pt extends U {
50
+ class Pt extends A {
51
51
  constructor(t) {
52
52
  super(t), this.name = "ConnectedSolutionsClientAuthError";
53
53
  }
54
54
  }
55
- class Ct extends U {
55
+ class xt extends A {
56
56
  constructor(t) {
57
57
  super(t), this.name = "ConnectedSolutionsClientUnknownError";
58
58
  }
59
59
  }
60
- class _t extends U {
60
+ class Ct extends A {
61
61
  constructor(t) {
62
62
  super(t), this.name = "ConnectedSolutionsClientSDKError";
63
63
  }
64
64
  }
65
65
  const gt = {
66
- PRODUCTION: "https://api.ecs.experian.com",
67
- SANDBOX: "https://sandbox-api.ecs.experian.com",
66
+ PRODUCTION: "https://connected-api.experian.com",
67
+ SANDBOX: "https://sandbox.connected-api.experian.com",
68
68
  UAT: "https://uat-api.ecs.experian.com",
69
69
  INTEGRATION: "https://integration-api.ecs.experian.com",
70
70
  DEVELOPMENT: "https://dev-api.ecs.experian.com"
71
- }, xt = {
72
- PRODUCTION: "https://unity-contentstack.integration.us-exp-api.experiancs.com/",
73
- SANDBOX: "https://unity-contentstack.dev.us-exp-api.experiancs.com/"
71
+ }, Et = {
72
+ PRODUCTION: "https://unity-contentstack.integration.us-exp-api.experiancs.com",
73
+ SANDBOX: "https://unity-contentstack.dev.us-exp-api.experiancs.com",
74
+ UAT: "https://unity-contentstack.dev.us-exp-api.experiancs.com",
75
+ INTEGRATION: "https://unity-contentstack.dev.us-exp-api.experiancs.com",
76
+ DEVELOPMENT: "https://unity-contentstack.dev.us-exp-api.experiancs.com"
74
77
  };
75
- var E, Z, $t;
78
+ var w, Z, $t;
76
79
  class y {
77
80
  constructor(t) {
78
- d(this, E);
81
+ d(this, w);
79
82
  u(this, "config");
80
83
  u(this, "baseUrl", "");
81
84
  u(this, "contentstackUrl", "");
82
85
  const s = t.environment ?? "PRODUCTION";
83
- this.config = t, this.baseUrl = gt[s], this.contentstackUrl = xt[s];
86
+ this.config = t, this.baseUrl = gt[s], this.contentstackUrl = Et[s];
84
87
  }
85
88
  setConfig(t) {
86
89
  "environment" in t && (this.config.environment = t.environment), "token" in t && (this.config.token = t.token);
87
90
  }
88
91
  async fetchWithAuth(t, e) {
89
92
  try {
90
- p(this, E, Z).call(this);
93
+ p(this, w, Z).call(this);
91
94
  const s = typeof Headers < "u" && new Headers(e == null ? void 0 : e.headers);
92
95
  s && !s.Authorization && s.set("Authorization", `Bearer ${this.config.token}`);
93
96
  const n = {
@@ -110,7 +113,7 @@ class y {
110
113
  async fetchRequest(t, e) {
111
114
  var s;
112
115
  try {
113
- p(this, E, Z).call(this);
116
+ p(this, w, Z).call(this);
114
117
  const n = await fetch(t, e);
115
118
  if (!(n != null && n.ok)) {
116
119
  let i;
@@ -120,8 +123,8 @@ class y {
120
123
  message: n == null ? void 0 : n.statusText
121
124
  };
122
125
  if ((s = n == null ? void 0 : n.headers.get("content-type")) != null && s.includes("application/json")) {
123
- const M = await n.clone().json();
124
- m.data = M.error;
126
+ const F = await n.clone().json();
127
+ m.data = F.error;
125
128
  }
126
129
  throw (n == null ? void 0 : n.status) === 401 ? i = {
127
130
  ...m,
@@ -129,9 +132,9 @@ class y {
129
132
  } : i = {
130
133
  ...m,
131
134
  type: "api_error"
132
- }, U.generateError(i);
135
+ }, A.generateError(i);
133
136
  }
134
- return p(this, E, $t).call(this, n) ? {
137
+ return p(this, w, $t).call(this, n) ? {
135
138
  data: await n.clone().json(),
136
139
  error: void 0,
137
140
  meta: {
@@ -159,19 +162,19 @@ class y {
159
162
  }
160
163
  }
161
164
  }
162
- E = new WeakSet(), Z = function() {
165
+ w = new WeakSet(), Z = function() {
163
166
  if (!this.config.token) {
164
167
  const t = {
165
168
  type: "sdk_error",
166
169
  message: "You must first obtain and set a token before using an SDK method"
167
170
  };
168
- throw U.generateError(t);
171
+ throw A.generateError(t);
169
172
  }
170
173
  }, $t = function(t) {
171
174
  var e, s;
172
175
  return ((e = t == null ? void 0 : t.headers.get("content-type")) == null ? void 0 : e.includes("application/json")) || ((s = t == null ? void 0 : t.headers.get("content-type")) == null ? void 0 : s.includes("application/octet-stream"));
173
176
  };
174
- var I;
177
+ var D;
175
178
  const v = class v extends y {
176
179
  constructor(t) {
177
180
  super(t);
@@ -181,14 +184,14 @@ const v = class v extends y {
181
184
  ...t != null && t.product_config_id ? { product_config_id: t.product_config_id } : {},
182
185
  ...t != null && t.include_factors ? { include_factors: t.include_factors.toString() } : {},
183
186
  ...t != null && t.include_ingredients ? { include_ingredients: t.include_ingredients.toString() } : {}
184
- }, n = new URLSearchParams(s).toString(), o = n ? `?${n}` : "", c = `${this.baseUrl}${a(v, I)}${o}`;
187
+ }, n = new URLSearchParams(s).toString(), o = n ? `?${n}` : "", c = `${this.baseUrl}${a(v, D)}${o}`;
185
188
  return this.fetchWithAuth(c, e);
186
189
  }
187
190
  async orderCreditScore(t, e) {
188
191
  const s = {
189
192
  ...t != null && t.include_factors ? { include_factors: t.include_factors.toString() } : {},
190
193
  ...t != null && t.include_ingredients ? { include_ingredients: t.include_ingredients.toString() } : {}
191
- }, n = new URLSearchParams(s).toString(), o = n ? `?${n}` : "", c = `${this.baseUrl}${a(v, I)}?${o}`;
194
+ }, n = new URLSearchParams(s).toString(), o = n ? `?${n}` : "", c = `${this.baseUrl}${a(v, D)}?${o}`;
192
195
  return this.fetchWithAuth(c, {
193
196
  method: "POST",
194
197
  headers: {
@@ -202,7 +205,7 @@ const v = class v extends y {
202
205
  });
203
206
  }
204
207
  };
205
- I = new WeakMap(), d(v, I, "/v1/credit/scores");
208
+ D = new WeakMap(), d(v, D, "/v1/credit/scores");
206
209
  let O = v;
207
210
  var l;
208
211
  const h = class h extends y {
@@ -307,7 +310,7 @@ K = new WeakMap(), /**
307
310
  d(G, K, "/v1/credit/attributes");
308
311
  let et = G;
309
312
  var B;
310
- const L = class L extends y {
313
+ const k = class k extends y {
311
314
  constructor(t) {
312
315
  super(t);
313
316
  }
@@ -315,13 +318,13 @@ const L = class L extends y {
315
318
  const s = {
316
319
  ...t,
317
320
  ...t != null && t.run_all ? { run_all: t.run_all.toString() } : {}
318
- }, n = new URLSearchParams(s).toString(), o = n ? `?${n}` : "", c = `${this.baseUrl}${a(L, B)}${o}`;
321
+ }, n = new URLSearchParams(s).toString(), o = n ? `?${n}` : "", c = `${this.baseUrl}${a(k, B)}${o}`;
319
322
  return this.fetchWithAuth(c, e);
320
323
  }
321
324
  async simulateScenario(t, e) {
322
325
  const { product_config_id: s, ...n } = t, o = new URLSearchParams({ product_config_id: s }).toString(), c = o ? `?${o}` : "";
323
326
  return this.fetchWithAuth(
324
- `${this.baseUrl}${a(L, B)}${c}`,
327
+ `${this.baseUrl}${a(k, B)}${c}`,
325
328
  {
326
329
  method: "POST",
327
330
  headers: {
@@ -334,21 +337,21 @@ const L = class L extends y {
334
337
  );
335
338
  }
336
339
  };
337
- B = new WeakMap(), d(L, B, "/v1/credit/tools/simulator");
338
- let st = L;
339
- var x, H;
340
- const b = class b extends y {
340
+ B = new WeakMap(), d(k, B, "/v1/credit/tools/simulator");
341
+ let st = k;
342
+ var E, H;
343
+ const T = class T extends y {
341
344
  constructor(t) {
342
345
  super(t);
343
346
  }
344
347
  async getCreditScorePlan(t, e) {
345
- const s = new URLSearchParams(t).toString(), n = s ? `?${s}` : "", o = `${this.baseUrl}${a(b, x)}${n}`;
348
+ const s = new URLSearchParams(t).toString(), n = s ? `?${s}` : "", o = `${this.baseUrl}${a(T, E)}${n}`;
346
349
  return this.fetchWithAuth(o, {
347
350
  ...e ?? {}
348
351
  });
349
352
  }
350
353
  async createCreditScorePlan(t, e) {
351
- const { product_config_id: s, ...n } = t, o = new URLSearchParams({ product_config_id: s }).toString(), c = o ? `?${o}` : "", i = `${this.baseUrl}${a(b, x)}${c}`;
354
+ const { product_config_id: s, ...n } = t, o = new URLSearchParams({ product_config_id: s }).toString(), c = o ? `?${o}` : "", i = `${this.baseUrl}${a(T, E)}${c}`;
352
355
  return this.fetchWithAuth(i, {
353
356
  method: "POST",
354
357
  headers: {
@@ -360,14 +363,14 @@ const b = class b extends y {
360
363
  });
361
364
  }
362
365
  async deleteCreditScorePlan(t, e) {
363
- const s = new URLSearchParams(t).toString(), n = s ? `?${s}` : "", o = `${this.baseUrl}${a(b, x)}${n}`;
366
+ const s = new URLSearchParams(t).toString(), n = s ? `?${s}` : "", o = `${this.baseUrl}${a(T, E)}${n}`;
364
367
  return this.fetchWithAuth(o, {
365
368
  method: "DELETE",
366
369
  ...e ?? {}
367
370
  });
368
371
  }
369
372
  async getCreditScorePlanRevisions(t, e) {
370
- const { product_config_id: s, ...n } = t, o = new URLSearchParams({ product_config_id: s }).toString(), c = o ? `?${o}` : "", i = `${this.baseUrl}${a(b, x)}${a(b, H)}${c}`;
373
+ const { product_config_id: s, ...n } = t, o = new URLSearchParams({ product_config_id: s }).toString(), c = o ? `?${o}` : "", i = `${this.baseUrl}${a(T, E)}${a(T, H)}${c}`;
371
374
  return this.fetchWithAuth(i, {
372
375
  method: "POST",
373
376
  body: JSON.stringify(n),
@@ -379,10 +382,10 @@ const b = class b extends y {
379
382
  });
380
383
  }
381
384
  };
382
- x = new WeakMap(), H = new WeakMap(), d(b, x, "/v1/credit/tools/planners"), d(b, H, "/revisions");
383
- let nt = b;
384
- var w;
385
- const _ = class _ extends y {
385
+ E = new WeakMap(), H = new WeakMap(), d(T, E, "/v1/credit/tools/planners"), d(T, H, "/revisions");
386
+ let nt = T;
387
+ var _;
388
+ const C = class C extends y {
386
389
  constructor(t) {
387
390
  super(t);
388
391
  }
@@ -391,38 +394,38 @@ const _ = class _ extends y {
391
394
  page_limit: "10",
392
395
  next_page_token: "",
393
396
  ...t ?? {}
394
- }, n = new URLSearchParams(s).toString(), o = `${this.baseUrl}${a(_, w)}?${n}`;
397
+ }, n = new URLSearchParams(s).toString(), o = `${this.baseUrl}${a(C, _)}?${n}`;
395
398
  return this.fetchWithAuth(o, e);
396
399
  }
397
400
  async getAlertById({ id: t }, e) {
398
- const s = `${this.baseUrl}${a(_, w)}/${t}`;
401
+ const s = `${this.baseUrl}${a(C, _)}/${t}`;
399
402
  return this.fetchWithAuth(s, e);
400
403
  }
401
404
  async markAlertAsRead({ id: t }, e) {
402
- const s = `${this.baseUrl}${a(_, w)}/${t}/dispose`;
405
+ const s = `${this.baseUrl}${a(C, _)}/${t}/dispose`;
403
406
  return this.fetchWithAuth(s, {
404
407
  method: "PATCH",
405
408
  ...e ?? {}
406
409
  });
407
410
  }
408
411
  async getAlertCounts(t) {
409
- const e = `${this.baseUrl}${a(_, w)}/counts`;
412
+ const e = `${this.baseUrl}${a(C, _)}/counts`;
410
413
  return this.fetchWithAuth(e, t);
411
414
  }
412
415
  };
413
- w = new WeakMap(), d(_, w, "/v1/events-alerts");
414
- let rt = _;
416
+ _ = new WeakMap(), d(C, _, "/v1/events-alerts");
417
+ let rt = C;
415
418
  var f;
416
- const S = class S extends y {
419
+ const b = class b extends y {
417
420
  constructor(t) {
418
421
  super(t);
419
422
  }
420
423
  async getReports(t, e) {
421
- const s = new URLSearchParams(t).toString(), n = s ? `?${s}` : "", o = `${this.baseUrl}${a(S, f)}${n}`;
424
+ const s = new URLSearchParams(t).toString(), n = s ? `?${s}` : "", o = `${this.baseUrl}${a(b, f)}${n}`;
422
425
  return this.fetchWithAuth(o, e);
423
426
  }
424
427
  async getReportById(t, e) {
425
- const { id: s, ...n } = t, o = new URLSearchParams(n).toString(), c = o ? `?${o}` : "", i = `${this.baseUrl}${a(S, f)}/${t.id}${c}`;
428
+ const { id: s, ...n } = t, o = new URLSearchParams(n).toString(), c = o ? `?${o}` : "", i = `${this.baseUrl}${a(b, f)}/${t.id}${c}`;
426
429
  return this.fetchWithAuth(i, e);
427
430
  }
428
431
  async getReportsMeta(t, e) {
@@ -430,15 +433,15 @@ const S = class S extends y {
430
433
  ...o ?? {},
431
434
  ...s ? { latest_only: s.toString() } : {},
432
435
  ...n ? { report_read: n.toString() } : {}
433
- }, i = new URLSearchParams(c).toString(), m = i ? `?${i}` : "", N = `${this.baseUrl}${a(S, f)}/meta${m}`;
436
+ }, i = new URLSearchParams(c).toString(), m = i ? `?${i}` : "", N = `${this.baseUrl}${a(b, f)}/meta${m}`;
434
437
  return this.fetchWithAuth(N, e);
435
438
  }
436
439
  async getReportMetaById(t, e) {
437
- const { id: s, ...n } = t, o = new URLSearchParams(n).toString(), c = o ? `?${o}` : "", i = `${this.baseUrl}${a(S, f)}/${s}/meta${c}`;
440
+ const { id: s, ...n } = t, o = new URLSearchParams(n).toString(), c = o ? `?${o}` : "", i = `${this.baseUrl}${a(b, f)}/${s}/meta${c}`;
438
441
  return this.fetchWithAuth(i, e);
439
442
  }
440
443
  async markReportAsRead(t, e) {
441
- const s = `${this.baseUrl}${a(S, f)}/${t.id}/read`;
444
+ const s = `${this.baseUrl}${a(b, f)}/${t.id}/read`;
442
445
  return this.fetchWithAuth(s, {
443
446
  method: "PUT",
444
447
  ...e ?? {}
@@ -447,7 +450,7 @@ const S = class S extends y {
447
450
  async orderReport(t, e) {
448
451
  const s = {
449
452
  ...t.include_fields ? { include_fields: t.include_fields.toString() } : {}
450
- }, n = new URLSearchParams(s).toString(), o = n ? `?${n}` : "", c = `${this.baseUrl}${a(S, f)}${o}`;
453
+ }, n = new URLSearchParams(s).toString(), o = n ? `?${n}` : "", c = `${this.baseUrl}${a(b, f)}${o}`;
451
454
  return this.fetchWithAuth(c, {
452
455
  method: "POST",
453
456
  headers: {
@@ -461,19 +464,19 @@ const S = class S extends y {
461
464
  });
462
465
  }
463
466
  };
464
- f = new WeakMap(), d(S, f, "/v1/credit/reports");
465
- let at = S;
467
+ f = new WeakMap(), d(b, f, "/v1/credit/reports");
468
+ let at = b;
466
469
  var P;
467
- const A = class A extends y {
470
+ const U = class U extends y {
468
471
  constructor(t) {
469
472
  super(t);
470
473
  }
471
474
  async getCustomerById(t, e) {
472
- const s = `${this.baseUrl}${a(A, P)}/${t.customer_id}`;
475
+ const s = `${this.baseUrl}${a(U, P)}/${t.customer_id}`;
473
476
  return this.fetchWithAuth(s, e);
474
477
  }
475
478
  async updateCustomer(t, e) {
476
- const { customer_id: s, ...n } = t, o = `${this.baseUrl}${a(A, P)}/${s}`;
479
+ const { customer_id: s, ...n } = t, o = `${this.baseUrl}${a(U, P)}/${s}`;
477
480
  return this.fetchWithAuth(o, {
478
481
  method: "PATCH",
479
482
  headers: {
@@ -485,14 +488,14 @@ const A = class A extends y {
485
488
  });
486
489
  }
487
490
  async deleteCustomer(t, e) {
488
- const s = `${this.baseUrl}${a(A, P)}/${t.customer_id}`;
491
+ const s = `${this.baseUrl}${a(U, P)}/${t.customer_id}`;
489
492
  return this.fetchWithAuth(s, {
490
493
  method: "DELETE",
491
494
  ...e ?? {}
492
495
  });
493
496
  }
494
497
  async createCustomer(t, e) {
495
- const s = `${this.baseUrl}${a(A, P)}`;
498
+ const s = `${this.baseUrl}${a(U, P)}`;
496
499
  return this.fetchWithAuth(s, {
497
500
  method: "POST",
498
501
  headers: {
@@ -504,7 +507,7 @@ const A = class A extends y {
504
507
  });
505
508
  }
506
509
  async searchCustomers(t, e) {
507
- const { next_cursor: s = "", ...n } = t, o = `${this.baseUrl}${a(A, P)}/search`;
510
+ const { next_cursor: s = "", ...n } = t, o = `${this.baseUrl}${a(U, P)}/search`;
508
511
  return this.fetchWithAuth(o, {
509
512
  method: "POST",
510
513
  headers: {
@@ -516,19 +519,19 @@ const A = class A extends y {
516
519
  });
517
520
  }
518
521
  };
519
- P = new WeakMap(), d(A, P, "/v1/customers");
520
- let ot = A;
522
+ P = new WeakMap(), d(U, P, "/v1/customers");
523
+ let ot = U;
521
524
  var J;
522
- const j = class j extends y {
525
+ const L = class L extends y {
523
526
  constructor(t) {
524
527
  super(t);
525
528
  }
526
529
  async getAuthQuestions(t) {
527
- const e = `${this.baseUrl}${a(j, J)}/questions`;
530
+ const e = `${this.baseUrl}${a(L, J)}/questions`;
528
531
  return this.fetchWithAuth(e, t);
529
532
  }
530
533
  async submitAuthAnswers(t, e) {
531
- const s = `${this.baseUrl}${a(j, J)}/questions`;
534
+ const s = `${this.baseUrl}${a(L, J)}/questions`;
532
535
  return this.fetchWithAuth(s, {
533
536
  method: "POST",
534
537
  headers: {
@@ -540,8 +543,8 @@ const j = class j extends y {
540
543
  });
541
544
  }
542
545
  };
543
- J = new WeakMap(), d(j, J, "/v1/authentication");
544
- let it = j;
546
+ J = new WeakMap(), d(L, J, "/v1/authentication");
547
+ let it = L;
545
548
  var z;
546
549
  const X = class X extends y {
547
550
  constructor(t) {
@@ -563,25 +566,25 @@ const X = class X extends y {
563
566
  z = new WeakMap(), d(X, z, "/v1/registrations");
564
567
  let ct = X;
565
568
  var V;
566
- const k = class k extends y {
569
+ const j = class j extends y {
567
570
  constructor(t) {
568
571
  super(t);
569
572
  }
570
573
  async getProductConfigs(t) {
571
- const e = `${this.baseUrl}${a(k, V)}`;
574
+ const e = `${this.baseUrl}${a(j, V)}`;
572
575
  return this.fetchWithAuth(e, {
573
576
  ...t || {}
574
577
  });
575
578
  }
576
579
  async getProductConfigById(t, e) {
577
- const s = `${this.baseUrl}${a(k, V)}/${t.product_config_id}`;
580
+ const s = `${this.baseUrl}${a(j, V)}/${t.product_config_id}`;
578
581
  return this.fetchWithAuth(s, {
579
582
  ...e ?? {}
580
583
  });
581
584
  }
582
585
  };
583
- V = new WeakMap(), d(k, V, "/v1/product-configs");
584
- let ut = k;
586
+ V = new WeakMap(), d(j, V, "/v1/product-configs");
587
+ let ut = j;
585
588
  const Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
586
589
  __proto__: null,
587
590
  AlertsService: rt,
@@ -596,15 +599,15 @@ const Y = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
596
599
  ProductConfigsService: ut,
597
600
  RegistrationsService: ct
598
601
  }, Symbol.toStringTag, { value: "Module" }));
599
- function wt(r) {
602
+ function _t(r) {
600
603
  return `${r[0].toLowerCase()}${r.substring(1)}`.replace(
601
604
  "Service",
602
605
  ""
603
606
  );
604
607
  }
605
- const Et = typeof process < "u" && process.versions && process.versions.node && typeof window > "u";
606
- var g, R, F, $, mt, ht, pt, bt;
607
- const D = class D {
608
+ const wt = typeof process < "u" && process.versions && process.versions.node && typeof window > "u";
609
+ var g, R, M, $, mt, ht, pt, Tt;
610
+ const I = class I {
608
611
  constructor(t) {
609
612
  d(this, $);
610
613
  u(this, "config");
@@ -614,8 +617,8 @@ const D = class D {
614
617
  this.config = t, this.baseUrl = gt[t.environment ?? "PRODUCTION"], W(this, g, /* @__PURE__ */ new Map());
615
618
  }
616
619
  async getAccessToken(t) {
617
- if (!Et)
618
- throw U.generateError({
620
+ if (!wt)
621
+ throw A.generateError({
619
622
  type: "sdk_error",
620
623
  message: "getAccessToken is not supported in browser"
621
624
  });
@@ -643,22 +646,22 @@ const D = class D {
643
646
  return a(this, g).size;
644
647
  }
645
648
  clearCache() {
646
- const t = `${this.baseUrl}${a(D, F)}`, e = Array.from(a(this, g).keys()).filter(
649
+ const t = `${this.baseUrl}${a(I, M)}`, e = Array.from(a(this, g).keys()).filter(
647
650
  (s) => s.includes(t)
648
651
  );
649
652
  for (const s of e)
650
653
  a(this, g).delete(s);
651
654
  }
652
655
  };
653
- g = new WeakMap(), R = new WeakMap(), F = new WeakMap(), $ = new WeakSet(), mt = async function({
656
+ g = new WeakMap(), R = new WeakMap(), M = new WeakMap(), $ = new WeakSet(), mt = async function({
654
657
  grantType: t,
655
658
  clientId: e,
656
659
  clientSecret: s,
657
660
  customerId: n
658
661
  }) {
659
- var M;
662
+ var F;
660
663
  p(this, $, pt).call(this);
661
- const o = `${this.baseUrl}${a(D, F)}`, c = {
664
+ const o = `${this.baseUrl}${a(I, M)}`, c = {
662
665
  method: "POST",
663
666
  headers: { "content-type": "application/json" },
664
667
  credentials: "include",
@@ -668,7 +671,7 @@ g = new WeakMap(), R = new WeakMap(), F = new WeakMap(), $ = new WeakSet(), mt =
668
671
  client_secret: s,
669
672
  partner_customer_id: n ?? ""
670
673
  })
671
- }, i = await p(this, $, bt).call(this, o, c);
674
+ }, i = await p(this, $, Tt).call(this, o, c);
672
675
  if (i != null && i.ok) {
673
676
  const q = await i.clone().json();
674
677
  return a(this, R) === null && p(this, $, ht).call(this, q.expires_in), q;
@@ -685,31 +688,31 @@ g = new WeakMap(), R = new WeakMap(), F = new WeakMap(), $ = new WeakSet(), mt =
685
688
  } : m = {
686
689
  type: "api_error",
687
690
  ...N
688
- }, (M = i == null ? void 0 : i.headers.get("content-type")) != null && M.includes("application/json")) {
691
+ }, (F = i == null ? void 0 : i.headers.get("content-type")) != null && F.includes("application/json")) {
689
692
  const q = await i.clone().json();
690
693
  m.data = q.error;
691
694
  }
692
- throw U.generateError(m);
695
+ throw A.generateError(m);
693
696
  }, ht = function(t) {
694
697
  const e = (/* @__PURE__ */ new Date()).getTime(), s = 60 * 60 * 1e3, n = e + s, o = t === null ? t : new Date(n).valueOf();
695
698
  W(this, R, o);
696
699
  }, pt = function() {
697
700
  const t = new Date(Date.now()), e = new Date(a(this, R) ?? Number.NaN);
698
701
  Rt(t, e) && (p(this, $, ht).call(this, null), a(this, g).clear());
699
- }, bt = async function(t, e) {
702
+ }, Tt = async function(t, e) {
700
703
  const s = `${t}${JSON.stringify(e || {})}`;
701
704
  if (!a(this, g).has(s)) {
702
705
  const n = fetch(t, e ?? {});
703
706
  a(this, g).set(s, n);
704
707
  }
705
708
  return await a(this, g).get(s);
706
- }, d(D, F, "/v1/oauth2/token");
707
- let dt = D;
709
+ }, d(I, M, "/v1/oauth2/token");
710
+ let dt = I;
708
711
  function Rt(r, t) {
709
712
  return r > t;
710
713
  }
711
- var C;
712
- const T = class T extends y {
714
+ var x;
715
+ const S = class S extends y {
713
716
  // constructor is private so that no other class can access it.
714
717
  constructor(e) {
715
718
  super(e);
@@ -726,7 +729,7 @@ const T = class T extends y {
726
729
  u(this, "productConfigs");
727
730
  u(this, "registrations");
728
731
  for (const s in Y)
729
- typeof Y[s] == "function" && (this[wt(s)] = new Y[s](e));
732
+ typeof Y[s] == "function" && (this[_t(s)] = new Y[s](e));
730
733
  this.auth = new dt({
731
734
  environment: e.environment
732
735
  });
@@ -734,33 +737,33 @@ const T = class T extends y {
734
737
  // new services go here
735
738
  // The method is static as we need to access the method only through the class here
736
739
  static getInstance(e) {
737
- return a(T, C) || W(T, C, new T(e)), a(T, C);
740
+ return a(S, x) || W(S, x, new S(e)), a(S, x);
738
741
  }
739
742
  static clearInstance() {
740
- W(T, C, null);
743
+ W(S, x, null);
741
744
  }
742
745
  };
743
- C = new WeakMap(), d(T, C, null);
744
- let lt = T;
746
+ x = new WeakMap(), d(S, x, null);
747
+ let lt = S;
745
748
  function vt(r) {
746
749
  return lt.getInstance(r);
747
750
  }
748
751
  function Nt(r) {
749
752
  return r.progress_status === "TARGET_NOT_MET" || r.progress_status === "COMPLETED";
750
753
  }
751
- function Lt(r) {
754
+ function kt(r) {
752
755
  return Nt(r) || r.progress_status === "TARGET_SCORE_AND_PLAN_SET" || r.progress_status === "ON_TRACK" || r.progress_status === "OFF_TRACK";
753
756
  }
754
- function jt(r) {
757
+ function Lt(r) {
755
758
  return r.score_model.includes("VANTAGE");
756
759
  }
757
- function kt(r) {
760
+ function jt(r) {
758
761
  return r.score_model.includes("FICO");
759
762
  }
760
- function Dt(r) {
763
+ function It(r) {
761
764
  return r.target_score !== void 0;
762
765
  }
763
- function It(r) {
766
+ function Dt(r) {
764
767
  return r.max_actions_per_plan !== void 0;
765
768
  }
766
769
  function Bt(r) {
@@ -772,10 +775,10 @@ function Jt(r) {
772
775
  function Vt(r) {
773
776
  return !!(r && "best_action" in r);
774
777
  }
775
- function Ft(r) {
778
+ function Mt(r) {
776
779
  return !!(r && "simulated_score" in r);
777
780
  }
778
- function Mt(r) {
781
+ function Ft(r) {
779
782
  return !("simulated_score" in r);
780
783
  }
781
784
  function qt(r) {
@@ -785,25 +788,25 @@ function Kt(r) {
785
788
  return !!(r && "value" in r && "simulated_score" in r);
786
789
  }
787
790
  export {
788
- At as ConnectedSolutionsClientApiError,
791
+ Ut as ConnectedSolutionsClientApiError,
789
792
  Pt as ConnectedSolutionsClientAuthError,
790
- U as ConnectedSolutionsClientError,
791
- _t as ConnectedSolutionsClientSDKError,
792
- Ct as ConnectedSolutionsClientUnknownError,
793
+ A as ConnectedSolutionsClientError,
794
+ Ct as ConnectedSolutionsClientSDKError,
795
+ xt as ConnectedSolutionsClientUnknownError,
793
796
  vt as createSDK,
794
797
  vt as default,
795
- kt as isFicoPlan,
798
+ jt as isFicoPlan,
796
799
  Bt as isFicoRevision,
797
- Dt as isFicoRevisionsRequest,
798
- Mt as isFicoScenario,
800
+ It as isFicoRevisionsRequest,
801
+ Ft as isFicoScenario,
799
802
  qt as isFicoScenarioVariation,
800
803
  Vt as isFicoSimulator,
801
804
  Nt as isPlanCompleted,
802
- Lt as isPlanSet,
803
- jt as isVantagePlan,
805
+ kt as isPlanSet,
806
+ Lt as isVantagePlan,
804
807
  Jt as isVantageRevision,
805
- It as isVantageRevisionsRequest,
806
- Ft as isVantageScenario,
808
+ Dt as isVantageRevisionsRequest,
809
+ Mt as isVantageScenario,
807
810
  Kt as isVantageScenarioVariation
808
811
  };
809
812
  //# sourceMappingURL=index.mjs.map