@experian-ecs/connected-api-sdk 1.3.0 → 1.5.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.
@@ -12,64 +12,64 @@
12
12
  * OTHER LIABILITY ARISING FROM OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS CODE.
13
13
  */
14
14
 
15
- var Dt = Object.defineProperty;
16
- var Ut = (r) => {
15
+ var zt = Object.defineProperty;
16
+ var Wt = (r) => {
17
17
  throw TypeError(r);
18
18
  };
19
- var Jt = (r, e, t) => e in r ? Dt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
20
- var d = (r, e, t) => Jt(r, typeof e != "symbol" ? e + "" : e, t), st = (r, e, t) => e.has(r) || Ut("Cannot " + t);
21
- var c = (r, e, t) => (st(r, e, "read from private field"), t ? t.call(r) : e.get(r)), h = (r, e, t) => e.has(r) ? Ut("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), V = (r, e, t, n) => (st(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), y = (r, e, t) => (st(r, e, "access private method"), t);
22
- function Ft(r) {
19
+ var Qt = (r, e, t) => e in r ? zt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
20
+ var h = (r, e, t) => Qt(r, typeof e != "symbol" ? e + "" : e, t), ut = (r, e, t) => e.has(r) || Wt("Cannot " + t);
21
+ var c = (r, e, t) => (ut(r, e, "read from private field"), t ? t.call(r) : e.get(r)), d = (r, e, t) => e.has(r) ? Wt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), J = (r, e, t, n) => (ut(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), y = (r, e, t) => (ut(r, e, "access private method"), t);
22
+ function Yt(r) {
23
23
  switch (r.type) {
24
24
  case "client_side_error":
25
- return new Gt(r);
25
+ return new Zt(r);
26
26
  case "authentication_error":
27
- return new Mt(r);
27
+ return new qt(r);
28
28
  case "server_side_error":
29
- return new Kt(r);
29
+ return new Ot(r);
30
30
  case "rate_limit_error":
31
- return new Xt(r);
31
+ return new ee(r);
32
32
  default:
33
- return new Ht(r);
33
+ return new te(r);
34
34
  }
35
35
  }
36
- class T extends Error {
36
+ class p extends Error {
37
37
  constructor(t) {
38
38
  var n;
39
39
  super(t.message);
40
- d(this, "message");
41
- d(this, "data");
42
- d(this, "status");
40
+ h(this, "message");
41
+ h(this, "data");
42
+ h(this, "status");
43
43
  this.message = ((n = t.data) == null ? void 0 : n.message) || t.message || "", this.data = t.data, this.status = t.status;
44
44
  }
45
45
  }
46
- d(T, "generateError", Ft);
47
- class Gt extends T {
46
+ h(p, "generateError", Yt);
47
+ class Zt extends p {
48
48
  constructor(e) {
49
49
  super(e), this.name = "ConnectedSolutionsClientSideError";
50
50
  }
51
51
  }
52
- class Mt extends T {
52
+ class qt extends p {
53
53
  constructor(e) {
54
54
  super(e), this.name = "ConnectedSolutionsClientAuthenticationError";
55
55
  }
56
56
  }
57
- class Kt extends T {
57
+ class Ot extends p {
58
58
  constructor(e) {
59
59
  super(e), this.name = "ConnectedSolutionsClientServerSideError";
60
60
  }
61
61
  }
62
- class Ht extends T {
62
+ class te extends p {
63
63
  constructor(e) {
64
64
  super(e), this.name = "ConnectedSolutionsClientSDKError";
65
65
  }
66
66
  }
67
- class Xt extends T {
67
+ class ee extends p {
68
68
  constructor(e) {
69
69
  super(e), this.name = "ConnectedSolutionsClientRateLimitError";
70
70
  }
71
71
  }
72
- function Ct(r) {
72
+ function jt(r) {
73
73
  switch (r) {
74
74
  case "CLIENT_SIDE_ERROR":
75
75
  return "client_side_error";
@@ -83,38 +83,38 @@ function Ct(r) {
83
83
  return "sdk_error";
84
84
  }
85
85
  }
86
- function Et(r) {
86
+ function kt(r) {
87
87
  return r === 401 ? "authentication_error" : r === 429 ? "rate_limit_error" : r && r >= 500 ? "server_side_error" : r && r >= 400 ? "client_side_error" : "sdk_error";
88
88
  }
89
- const Rt = {
89
+ const It = {
90
90
  PRODUCTION: "https://connected-api.experian.com",
91
91
  SANDBOX: "https://sandbox.connected-api.experian.com",
92
92
  UAT: "https://uat.connected-api.experian.com",
93
93
  INTEGRATION: "https://integration.connected-api.experian.com",
94
94
  DEVELOPMENT: "https://develop.connected-api.experian.com"
95
- }, zt = {
95
+ }, re = {
96
96
  PRODUCTION: "https://unity-contentstack.integration.us-exp-api.experiancs.com",
97
97
  SANDBOX: "https://unity-contentstack.dev.us-exp-api.experiancs.com",
98
98
  UAT: "https://unity-contentstack.dev.us-exp-api.experiancs.com",
99
99
  INTEGRATION: "https://unity-contentstack.dev.us-exp-api.experiancs.com",
100
100
  DEVELOPMENT: "https://unity-contentstack.dev.us-exp-api.experiancs.com"
101
101
  };
102
- var k, ct, vt;
103
- class b {
102
+ var I, ht, Lt;
103
+ class m {
104
104
  constructor(e) {
105
- h(this, k);
106
- d(this, "config");
107
- d(this, "baseUrl", "");
108
- d(this, "contentstackUrl", "");
105
+ d(this, I);
106
+ h(this, "config");
107
+ h(this, "baseUrl", "");
108
+ h(this, "contentstackUrl", "");
109
109
  const n = e.environment ?? "PRODUCTION";
110
- this.config = e, this.baseUrl = Rt[n], this.contentstackUrl = zt[n];
110
+ this.config = e, this.baseUrl = It[n], this.contentstackUrl = re[n];
111
111
  }
112
112
  setConfig(e) {
113
113
  "environment" in e && (this.config.environment = e.environment), "token" in e && (this.config.token = e.token);
114
114
  }
115
115
  async fetchWithAuth(e, t) {
116
116
  try {
117
- y(this, k, ct).call(this);
117
+ y(this, I, ht).call(this);
118
118
  const n = typeof Headers < "u" && new Headers(t == null ? void 0 : t.headers);
119
119
  n && !n.Authorization && n.set("Authorization", `Bearer ${this.config.token}`);
120
120
  const s = {
@@ -137,10 +137,10 @@ class b {
137
137
  async fetchRequest(e, t) {
138
138
  var n;
139
139
  try {
140
- y(this, k, ct).call(this);
140
+ y(this, I, ht).call(this);
141
141
  const s = await fetch(e, t);
142
142
  if (!(s != null && s.ok)) {
143
- let o;
143
+ let a;
144
144
  const u = {
145
145
  type: "sdk_error",
146
146
  status: s == null ? void 0 : s.status,
@@ -148,12 +148,12 @@ class b {
148
148
  };
149
149
  if ((n = s == null ? void 0 : s.headers.get("content-type")) != null && n.includes("application/json")) {
150
150
  const g = await s.clone().json();
151
- u.data = g.error, u.type = Ct(g.error.type);
151
+ u.data = g.error, u.type = jt(g.error.type);
152
152
  } else
153
- u.type = Et(s == null ? void 0 : s.status);
154
- throw T.generateError(u);
153
+ u.type = kt(s == null ? void 0 : s.status);
154
+ throw p.generateError(u);
155
155
  }
156
- return y(this, k, vt).call(this, s) ? {
156
+ return y(this, I, Lt).call(this, s) ? {
157
157
  data: await s.clone().json(),
158
158
  error: void 0,
159
159
  meta: {
@@ -181,37 +181,37 @@ class b {
181
181
  }
182
182
  }
183
183
  }
184
- k = new WeakSet(), ct = function() {
184
+ I = new WeakSet(), ht = function() {
185
185
  if (!this.config.token) {
186
186
  const e = {
187
187
  type: "sdk_error",
188
188
  message: "You must first obtain and set a token before using an SDK method"
189
189
  };
190
- throw T.generateError(e);
190
+ throw p.generateError(e);
191
191
  }
192
- }, vt = function(e) {
192
+ }, Lt = function(e) {
193
193
  var t, n;
194
194
  return ((t = e == null ? void 0 : e.headers.get("content-type")) == null ? void 0 : t.includes("application/json")) || ((n = e == null ? void 0 : e.headers.get("content-type")) == null ? void 0 : n.includes("application/octet-stream"));
195
195
  };
196
- var z, G, at;
197
- const Q = class Q extends b {
196
+ var Y, M, yt;
197
+ const Z = class Z extends m {
198
198
  constructor(t) {
199
199
  super(t);
200
- h(this, G);
200
+ d(this, M);
201
201
  }
202
202
  async getCreditScores(t, n) {
203
- const s = t == null ? void 0 : t.version, i = y(this, G, at).call(this, s), a = {
203
+ const s = t == null ? void 0 : t.version, i = y(this, M, yt).call(this, s), o = {
204
204
  ...t != null && t.product_config_id ? { product_config_id: t.product_config_id } : {},
205
205
  ...t != null && t.include_factors ? { include_factors: t.include_factors.toString() } : {},
206
206
  ...t != null && t.include_ingredients ? { include_ingredients: t.include_ingredients.toString() } : {}
207
- }, o = new URLSearchParams(a).toString(), u = o ? `?${o}` : "", l = `${this.baseUrl}${i}${u}`;
207
+ }, a = new URLSearchParams(o).toString(), u = a ? `?${a}` : "", l = `${this.baseUrl}${i}${u}`;
208
208
  return this.fetchWithAuth(l, n);
209
209
  }
210
210
  async orderCreditScore(t, n) {
211
- const s = t.version, i = y(this, G, at).call(this, s), a = {
211
+ const s = t.version, i = y(this, M, yt).call(this, s), o = {
212
212
  ...t != null && t.include_factors ? { include_factors: t.include_factors.toString() } : {},
213
213
  ...t != null && t.include_ingredients ? { include_ingredients: t.include_ingredients.toString() } : {}
214
- }, o = new URLSearchParams(a).toString(), u = o ? `?${o}` : "", l = `${this.baseUrl}${i}${u}`;
214
+ }, a = new URLSearchParams(o).toString(), u = a ? `?${a}` : "", l = `${this.baseUrl}${i}${u}`;
215
215
  return this.fetchWithAuth(l, {
216
216
  method: "POST",
217
217
  headers: {
@@ -225,17 +225,17 @@ const Q = class Q extends b {
225
225
  });
226
226
  }
227
227
  };
228
- z = new WeakMap(), G = new WeakSet(), /**
228
+ Y = new WeakMap(), M = new WeakSet(), /**
229
229
  * Get the versioned API path for credit scores.
230
230
  * @param version The API version to use.
231
231
  * @returns The versioned API path.
232
232
  */
233
- at = function(t = "v1") {
234
- return `/${t}${c(Q, z)}`;
235
- }, h(Q, z, "/credit/scores");
236
- let ot = Q;
233
+ yt = function(t = "v1") {
234
+ return `/${t}${c(Z, Y)}`;
235
+ }, d(Z, Y, "/credit/scores");
236
+ let lt = Z;
237
237
  var f;
238
- const $ = class $ extends b {
238
+ const $ = class $ extends m {
239
239
  constructor(e) {
240
240
  super(e);
241
241
  }
@@ -304,8 +304,8 @@ const $ = class $ extends b {
304
304
  });
305
305
  }
306
306
  async entitleCustomerToNewProduct(e, t) {
307
- const { product_config_id: n, entitlement_id: s, customer_id: i } = e, a = `${this.baseUrl}${c($, f)}/${s}/products/${n}/activate`;
308
- return this.fetchWithAuth(a, {
307
+ const { product_config_id: n, entitlement_id: s, customer_id: i } = e, o = `${this.baseUrl}${c($, f)}/${s}/products/${n}/activate`;
308
+ return this.fetchWithAuth(o, {
309
309
  method: "POST",
310
310
  ...t ?? {},
311
311
  headers: {
@@ -340,30 +340,30 @@ const $ = class $ extends b {
340
340
  return this.fetchWithAuth(s, t);
341
341
  }
342
342
  };
343
- f = new WeakMap(), h($, f, "/v1/entitlements");
344
- let ut = $;
345
- var Y, Z, wt;
346
- const q = class q extends b {
343
+ f = new WeakMap(), d($, f, "/v1/entitlements");
344
+ let gt = $;
345
+ var q, O, Vt;
346
+ const tt = class tt extends m {
347
347
  constructor(t) {
348
348
  super(t);
349
- h(this, Z);
349
+ d(this, O);
350
350
  }
351
351
  async getCreditAttributes(t, n) {
352
- const s = t == null ? void 0 : t.version, i = y(this, Z, wt).call(this, s), a = `${this.baseUrl}${i}`;
353
- return this.fetchWithAuth(a, n);
352
+ const s = t == null ? void 0 : t.version, i = y(this, O, Vt).call(this, s), o = `${this.baseUrl}${i}`;
353
+ return this.fetchWithAuth(o, n);
354
354
  }
355
355
  };
356
- Y = new WeakMap(), Z = new WeakSet(), /**
356
+ q = new WeakMap(), O = new WeakSet(), /**
357
357
  * Get the versioned API path for credit attributes.
358
358
  * @param version The API version to use.
359
359
  * @returns The versioned API path.
360
360
  */
361
- wt = function(t = "v1") {
362
- return `/${t}${c(q, Y)}`;
363
- }, h(q, Y, "/credit/attributes");
364
- let dt = q;
365
- var M;
366
- const B = class B extends b {
361
+ Vt = function(t = "v1") {
362
+ return `/${t}${c(tt, q)}`;
363
+ }, d(tt, q, "/credit/attributes");
364
+ let $t = tt;
365
+ var H;
366
+ const F = class F extends m {
367
367
  constructor(e) {
368
368
  super(e);
369
369
  }
@@ -371,13 +371,13 @@ const B = class B extends b {
371
371
  const n = {
372
372
  ...e,
373
373
  ...e != null && e.run_all ? { run_all: e.run_all.toString() } : {}
374
- }, s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", a = `${this.baseUrl}${c(B, M)}${i}`;
375
- return this.fetchWithAuth(a, t);
374
+ }, s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", o = `${this.baseUrl}${c(F, H)}${i}`;
375
+ return this.fetchWithAuth(o, t);
376
376
  }
377
377
  async simulateScenario(e, t) {
378
- const { product_config_id: n, ...s } = e, i = new URLSearchParams({ product_config_id: n }).toString(), a = i ? `?${i}` : "";
378
+ const { product_config_id: n, ...s } = e, i = new URLSearchParams({ product_config_id: n }).toString(), o = i ? `?${i}` : "";
379
379
  return this.fetchWithAuth(
380
- `${this.baseUrl}${c(B, M)}${a}`,
380
+ `${this.baseUrl}${c(F, H)}${o}`,
381
381
  {
382
382
  method: "POST",
383
383
  headers: {
@@ -390,10 +390,10 @@ const B = class B extends b {
390
390
  );
391
391
  }
392
392
  };
393
- M = new WeakMap(), h(B, M, "/v1/credit/tools/simulator");
394
- let ht = B;
395
- var j, O;
396
- const U = class U extends b {
393
+ H = new WeakMap(), d(F, H, "/v1/credit/tools/simulator");
394
+ let ft = F;
395
+ var j, et;
396
+ const U = class U extends m {
397
397
  constructor(e) {
398
398
  super(e);
399
399
  }
@@ -404,8 +404,8 @@ const U = class U extends b {
404
404
  });
405
405
  }
406
406
  async createCreditScorePlan(e, t) {
407
- const { product_config_id: n, ...s } = e, i = new URLSearchParams({ product_config_id: n }).toString(), a = i ? `?${i}` : "", o = `${this.baseUrl}${c(U, j)}${a}`;
408
- return this.fetchWithAuth(o, {
407
+ const { product_config_id: n, ...s } = e, i = new URLSearchParams({ product_config_id: n }).toString(), o = i ? `?${i}` : "", a = `${this.baseUrl}${c(U, j)}${o}`;
408
+ return this.fetchWithAuth(a, {
409
409
  method: "POST",
410
410
  headers: {
411
411
  ...(t == null ? void 0 : t.headers) ?? {},
@@ -423,8 +423,8 @@ const U = class U extends b {
423
423
  });
424
424
  }
425
425
  async getCreditScorePlanRevisions(e, t) {
426
- const { product_config_id: n, ...s } = e, i = new URLSearchParams({ product_config_id: n }).toString(), a = i ? `?${i}` : "", o = `${this.baseUrl}${c(U, j)}${c(U, O)}${a}`;
427
- return this.fetchWithAuth(o, {
426
+ const { product_config_id: n, ...s } = e, i = new URLSearchParams({ product_config_id: n }).toString(), o = i ? `?${i}` : "", a = `${this.baseUrl}${c(U, j)}${c(U, et)}${o}`;
427
+ return this.fetchWithAuth(a, {
428
428
  method: "POST",
429
429
  body: JSON.stringify(s),
430
430
  headers: {
@@ -435,10 +435,10 @@ const U = class U extends b {
435
435
  });
436
436
  }
437
437
  };
438
- j = new WeakMap(), O = new WeakMap(), h(U, j, "/v1/credit/tools/planners"), h(U, O, "/revisions");
439
- let lt = U;
440
- var I;
441
- const W = class W extends b {
438
+ j = new WeakMap(), et = new WeakMap(), d(U, j, "/v1/credit/tools/planners"), d(U, et, "/revisions");
439
+ let mt = U;
440
+ var k;
441
+ const x = class x extends m {
442
442
  constructor(e) {
443
443
  super(e);
444
444
  }
@@ -447,76 +447,76 @@ const W = class W extends b {
447
447
  page_limit: "10",
448
448
  next_page_token: "",
449
449
  ...e ?? {}
450
- }, s = new URLSearchParams(n).toString(), i = `${this.baseUrl}${c(W, I)}?${s}`;
450
+ }, s = new URLSearchParams(n).toString(), i = `${this.baseUrl}${c(x, k)}?${s}`;
451
451
  return this.fetchWithAuth(i, t);
452
452
  }
453
453
  async getAlertById({ id: e }, t) {
454
- const n = `${this.baseUrl}${c(W, I)}/${e}`;
454
+ const n = `${this.baseUrl}${c(x, k)}/${e}`;
455
455
  return this.fetchWithAuth(n, t);
456
456
  }
457
457
  async markAlertAsRead({ id: e }, t) {
458
- const n = `${this.baseUrl}${c(W, I)}/${e}/dispose`;
458
+ const n = `${this.baseUrl}${c(x, k)}/${e}/dispose`;
459
459
  return this.fetchWithAuth(n, {
460
460
  method: "PATCH",
461
461
  ...t ?? {}
462
462
  });
463
463
  }
464
464
  async getAlertCounts(e) {
465
- const t = `${this.baseUrl}${c(W, I)}/counts`;
465
+ const t = `${this.baseUrl}${c(x, k)}/counts`;
466
466
  return this.fetchWithAuth(t, e);
467
467
  }
468
468
  };
469
- I = new WeakMap(), h(W, I, "/v1/events-alerts");
470
- let yt = W;
471
- function xt(r) {
469
+ k = new WeakMap(), d(x, k, "/v1/events-alerts");
470
+ let bt = x;
471
+ function Bt(r) {
472
472
  return !(r != null && r.version) || (r == null ? void 0 : r.version) === "v1";
473
473
  }
474
- function Qt(r) {
474
+ function ne(r) {
475
475
  return (r == null ? void 0 : r.version) === "v2";
476
476
  }
477
- function Pt(r) {
478
- return r !== void 0 && xt(r) && "include_fields" in r && typeof r.include_fields == "string";
477
+ function xt(r) {
478
+ return r !== void 0 && Bt(r) && "include_fields" in r && typeof r.include_fields == "string";
479
479
  }
480
- function Yt(r) {
481
- return r !== void 0 && xt(r) && ("include_fields" in r && typeof r.include_fields == "string" || "report_date" in r && typeof r.report_date == "string" || "product_config_id" in r && typeof r.product_config_id == "string" || "report_between" in r && typeof r.report_between == "string");
480
+ function se(r) {
481
+ return r !== void 0 && Bt(r) && ("include_fields" in r && typeof r.include_fields == "string" || "report_date" in r && typeof r.report_date == "string" || "product_config_id" in r && typeof r.product_config_id == "string" || "report_between" in r && typeof r.report_between == "string");
482
482
  }
483
- function Zt(r) {
484
- return r !== void 0 && Qt(r) && ("product_config_id" in r && typeof r.product_config_id == "string" || "report_between" in r && typeof r.report_between == "string");
483
+ function ie(r) {
484
+ return r !== void 0 && ne(r) && ("product_config_id" in r && typeof r.product_config_id == "string" || "report_between" in r && typeof r.report_between == "string");
485
485
  }
486
- var tt, E, N;
487
- const et = class et extends b {
486
+ var rt, v, W;
487
+ const nt = class nt extends m {
488
488
  constructor(t) {
489
489
  super(t);
490
- h(this, E);
490
+ d(this, v);
491
491
  }
492
492
  async getReports(t, n) {
493
- const s = t == null ? void 0 : t.version, i = y(this, E, N).call(this, s), a = {};
494
- Yt(t) && (t.report_between && (a.report_between = t.report_between.toString()), t.include_fields && (a.include_fields = t.include_fields.toString()), t.report_date && (a.report_date = t.report_date.toString()), t.product_config_id && (a.product_config_id = t.product_config_id.toString())), Zt(t) && (t.product_config_id && (a.product_config_id = t.product_config_id.toString()), t.report_between && (a.report_between = t.report_between.toString()));
495
- const o = new URLSearchParams(a).toString(), u = o ? `?${o}` : "", l = `${this.baseUrl}${i}${u}`;
493
+ const s = t == null ? void 0 : t.version, i = y(this, v, W).call(this, s), o = {};
494
+ se(t) && (t.report_between && (o.report_between = t.report_between.toString()), t.include_fields && (o.include_fields = t.include_fields.toString()), t.report_date && (o.report_date = t.report_date.toString()), t.product_config_id && (o.product_config_id = t.product_config_id.toString())), ie(t) && (t.product_config_id && (o.product_config_id = t.product_config_id.toString()), t.report_between && (o.report_between = t.report_between.toString()));
495
+ const a = new URLSearchParams(o).toString(), u = a ? `?${a}` : "", l = `${this.baseUrl}${i}${u}`;
496
496
  return this.fetchWithAuth(l, n);
497
497
  }
498
498
  async getReportById(t, n) {
499
- const { id: s, version: i } = t, a = y(this, E, N).call(this, i), o = {};
500
- Pt(t) && (o.include_fields = t.include_fields.toString());
501
- const u = new URLSearchParams(o).toString(), l = u ? `?${u}` : "", g = `${this.baseUrl}${a}/${s}${l}`;
499
+ const { id: s, version: i } = t, o = y(this, v, W).call(this, i), a = {};
500
+ xt(t) && (a.include_fields = t.include_fields.toString());
501
+ const u = new URLSearchParams(a).toString(), l = u ? `?${u}` : "", g = `${this.baseUrl}${o}/${s}${l}`;
502
502
  return this.fetchWithAuth(g, n);
503
503
  }
504
504
  async getReportsMeta(t, n) {
505
- const { version: s, latest_only: i, report_read: a, ...o } = t ?? {}, u = y(this, E, N).call(this, s), l = {
506
- ...o ?? {},
505
+ const { version: s, latest_only: i, report_read: o, ...a } = t ?? {}, u = y(this, v, W).call(this, s), l = {
506
+ ...a ?? {},
507
507
  ...i ? { latest_only: i.toString() } : {},
508
- ...a ? { report_read: a.toString() } : {}
509
- }, g = new URLSearchParams(l).toString(), m = g ? `?${g}` : "", Bt = `${this.baseUrl}${u}/meta${m}`;
510
- return this.fetchWithAuth(Bt, n);
508
+ ...o ? { report_read: o.toString() } : {}
509
+ }, g = new URLSearchParams(l).toString(), T = g ? `?${g}` : "", at = `${this.baseUrl}${u}/meta${T}`;
510
+ return this.fetchWithAuth(at, n);
511
511
  }
512
512
  async getReportMetaById(t, n) {
513
- const { id: s, version: i, ...a } = t, o = y(this, E, N).call(this, i), u = new URLSearchParams(a).toString(), l = u ? `?${u}` : "", g = `${this.baseUrl}${o}/${s}/meta${l}`;
513
+ const { id: s, version: i, ...o } = t, a = y(this, v, W).call(this, i), u = new URLSearchParams(o).toString(), l = u ? `?${u}` : "", g = `${this.baseUrl}${a}/${s}/meta${l}`;
514
514
  return this.fetchWithAuth(g, n);
515
515
  }
516
516
  async markReportAsRead(t, n) {
517
- const { id: s, version: i } = t, a = y(this, E, N).call(this, i), o = `${this.baseUrl}${a}`;
517
+ const { id: s, version: i } = t, o = y(this, v, W).call(this, i), a = `${this.baseUrl}${o}`;
518
518
  if (i === "v2") {
519
- const l = `${o}/${s}/disposition`, g = t;
519
+ const l = `${a}/${s}/disposition`, g = t;
520
520
  return this.fetchWithAuth(l, {
521
521
  method: "PATCH",
522
522
  headers: {
@@ -529,16 +529,16 @@ const et = class et extends b {
529
529
  ...n ?? {}
530
530
  });
531
531
  }
532
- const u = `${o}/${s}/read`;
532
+ const u = `${a}/${s}/read`;
533
533
  return this.fetchWithAuth(u, {
534
534
  method: "PUT",
535
535
  ...n ?? {}
536
536
  });
537
537
  }
538
538
  async orderReport(t, n) {
539
- const s = {}, i = t == null ? void 0 : t.version, a = y(this, E, N).call(this, i);
540
- Pt(t) && (s.include_fields = t.include_fields.toString());
541
- const o = new URLSearchParams(s).toString(), u = o ? `?${o}` : "", l = `${this.baseUrl}${a}${u}`;
539
+ const s = {}, i = t == null ? void 0 : t.version, o = y(this, v, W).call(this, i);
540
+ xt(t) && (s.include_fields = t.include_fields.toString());
541
+ const a = new URLSearchParams(s).toString(), u = a ? `?${a}` : "", l = `${this.baseUrl}${o}${u}`;
542
542
  return this.fetchWithAuth(l, {
543
543
  method: "POST",
544
544
  headers: {
@@ -552,26 +552,26 @@ const et = class et extends b {
552
552
  });
553
553
  }
554
554
  };
555
- tt = new WeakMap(), E = new WeakSet(), /**
555
+ rt = new WeakMap(), v = new WeakSet(), /**
556
556
  * Get the versioned API path for credit reports.
557
557
  * @param version The API version to use.
558
558
  * @returns The versioned API path.
559
559
  */
560
- N = function(t = "v1") {
561
- return `/${t}${c(et, tt)}`;
562
- }, h(et, tt, "/credit/reports");
563
- let gt = et;
560
+ W = function(t = "v1") {
561
+ return `/${t}${c(nt, rt)}`;
562
+ }, d(nt, rt, "/credit/reports");
563
+ let _t = nt;
564
564
  var w;
565
- const v = class v extends b {
565
+ const R = class R extends m {
566
566
  constructor(e) {
567
567
  super(e);
568
568
  }
569
569
  async getCustomerById(e, t) {
570
- const n = `${this.baseUrl}${c(v, w)}/${e.customer_id}`;
570
+ const n = `${this.baseUrl}${c(R, w)}/${e.customer_id}`;
571
571
  return this.fetchWithAuth(n, t);
572
572
  }
573
573
  async updateCustomer(e, t) {
574
- const { customer_id: n, ...s } = e, i = `${this.baseUrl}${c(v, w)}/${n}`;
574
+ const { customer_id: n, ...s } = e, i = `${this.baseUrl}${c(R, w)}/${n}`;
575
575
  return this.fetchWithAuth(i, {
576
576
  method: "PATCH",
577
577
  headers: {
@@ -583,14 +583,14 @@ const v = class v extends b {
583
583
  });
584
584
  }
585
585
  async deleteCustomer(e, t) {
586
- const n = `${this.baseUrl}${c(v, w)}/${e.customer_id}`;
586
+ const n = `${this.baseUrl}${c(R, w)}/${e.customer_id}`;
587
587
  return this.fetchWithAuth(n, {
588
588
  method: "DELETE",
589
589
  ...t ?? {}
590
590
  });
591
591
  }
592
592
  async createCustomer(e, t) {
593
- const n = `${this.baseUrl}${c(v, w)}`;
593
+ const n = `${this.baseUrl}${c(R, w)}`;
594
594
  return this.fetchWithAuth(n, {
595
595
  method: "POST",
596
596
  headers: {
@@ -602,7 +602,7 @@ const v = class v extends b {
602
602
  });
603
603
  }
604
604
  async searchCustomers(e, t) {
605
- const { next_cursor: n = "", ...s } = e, i = `${this.baseUrl}${c(v, w)}/search`;
605
+ const { next_cursor: n = "", ...s } = e, i = `${this.baseUrl}${c(R, w)}/search`;
606
606
  return this.fetchWithAuth(i, {
607
607
  method: "POST",
608
608
  headers: {
@@ -614,19 +614,19 @@ const v = class v extends b {
614
614
  });
615
615
  }
616
616
  };
617
- w = new WeakMap(), h(v, w, "/v1/customers");
618
- let $t = v;
619
- var K;
620
- const D = class D extends b {
617
+ w = new WeakMap(), d(R, w, "/v1/customers");
618
+ let St = R;
619
+ var X;
620
+ const K = class K extends m {
621
621
  constructor(e) {
622
622
  super(e);
623
623
  }
624
624
  async getAuthQuestions(e) {
625
- const t = `${this.baseUrl}${c(D, K)}/questions`;
625
+ const t = `${this.baseUrl}${c(K, X)}/questions`;
626
626
  return this.fetchWithAuth(t, e);
627
627
  }
628
628
  async submitAuthAnswers(e, t) {
629
- const n = `${this.baseUrl}${c(D, K)}/questions`;
629
+ const n = `${this.baseUrl}${c(K, X)}/questions`;
630
630
  return this.fetchWithAuth(n, {
631
631
  method: "POST",
632
632
  headers: {
@@ -638,15 +638,15 @@ const D = class D extends b {
638
638
  });
639
639
  }
640
640
  };
641
- K = new WeakMap(), h(D, K, "/v1/authentication");
642
- let ft = D;
643
- var rt;
644
- const nt = class nt extends b {
641
+ X = new WeakMap(), d(K, X, "/v1/authentication");
642
+ let At = K;
643
+ var st;
644
+ const it = class it extends m {
645
645
  constructor(e) {
646
646
  super(e);
647
647
  }
648
648
  async createRegistration(e, t) {
649
- const n = `${this.baseUrl}${c(nt, rt)}`;
649
+ const n = `${this.baseUrl}${c(it, st)}`;
650
650
  return this.fetchWithAuth(n, {
651
651
  method: "POST",
652
652
  headers: {
@@ -658,44 +658,52 @@ const nt = class nt extends b {
658
658
  });
659
659
  }
660
660
  };
661
- rt = new WeakMap(), h(nt, rt, "/v1/registrations");
662
- let mt = nt;
663
- var H;
664
- const J = class J extends b {
665
- constructor(e) {
666
- super(e);
661
+ st = new WeakMap(), d(it, st, "/v1/registrations");
662
+ let Tt = it;
663
+ var ct, z, Ut;
664
+ const ot = class ot extends m {
665
+ constructor(t) {
666
+ super(t);
667
+ d(this, z);
667
668
  }
668
- async getProductConfigs(e, t) {
669
- const { fromEntries: n, entries: s } = Object, { isArray: i } = Array, a = n(
670
- s(e).filter(([g, m]) => m != null).map(([g, m]) => [
671
- g,
672
- i(m) ? m.join(",") : m.toString()
669
+ async getProductConfigs(t, n) {
670
+ const { fromEntries: s, entries: i } = Object, { isArray: o } = Array, a = t == null ? void 0 : t.version, u = y(this, z, Ut).call(this, a), { version: l, ...g } = s(
671
+ i(t).filter(([Nt, L]) => L != null).map(([Nt, L]) => [
672
+ Nt,
673
+ o(L) ? L.join(",") : L.toString()
673
674
  ])
674
- ), o = new URLSearchParams(a).toString(), u = o ? `?${o}` : "", l = `${this.baseUrl}${c(J, H)}${u}`;
675
- return this.fetchWithAuth(l, {
676
- ...t || {}
675
+ ), T = new URLSearchParams(g).toString(), at = T ? `?${T}` : "", Xt = `${this.baseUrl}${u}${at}`;
676
+ return this.fetchWithAuth(Xt, {
677
+ ...n || {}
677
678
  });
678
679
  }
679
- async getProductConfigById(e, t) {
680
- const n = `${this.baseUrl}${c(J, H)}/${e.product_config_id}`;
681
- return this.fetchWithAuth(n, {
682
- ...t ?? {}
680
+ async getProductConfigById(t, n) {
681
+ const s = t == null ? void 0 : t.version, i = y(this, z, Ut).call(this, s), o = `${this.baseUrl}${i}/${t.product_config_id}`;
682
+ return this.fetchWithAuth(o, {
683
+ ...n ?? {}
683
684
  });
684
685
  }
685
686
  };
686
- H = new WeakMap(), h(J, H, "/v1/product-configs");
687
- let bt = J;
688
- var R;
689
- const P = class P extends b {
687
+ ct = new WeakMap(), z = new WeakSet(), /**
688
+ * Get the versioned API path for Product Config.
689
+ * @param version The API version to use.
690
+ * @returns The versioned API path.
691
+ */
692
+ Ut = function(t = "v1") {
693
+ return `/${t}${c(ot, ct)}`;
694
+ }, d(ot, ct, "/product-configs");
695
+ let pt = ot;
696
+ var E;
697
+ const P = class P extends m {
690
698
  constructor(e) {
691
699
  super(e);
692
700
  }
693
701
  async getSurvey(e) {
694
- const t = `${this.baseUrl}${c(P, R)}/surveys`;
702
+ const t = `${this.baseUrl}${c(P, E)}/surveys`;
695
703
  return this.fetchWithAuth(t, e);
696
704
  }
697
705
  async submitSurvey(e, t) {
698
- const n = `${this.baseUrl}${c(P, R)}/surveys`;
706
+ const n = `${this.baseUrl}${c(P, E)}/surveys`;
699
707
  return this.fetchWithAuth(n, {
700
708
  method: "POST",
701
709
  headers: {
@@ -707,7 +715,7 @@ const P = class P extends b {
707
715
  });
708
716
  }
709
717
  async getScore(e) {
710
- const t = `${this.baseUrl}${c(P, R)}/scores?latest=TRUE`;
718
+ const t = `${this.baseUrl}${c(P, E)}/scores?latest=TRUE`;
711
719
  return this.fetchWithAuth(t, e);
712
720
  }
713
721
  async getPlan(e, t) {
@@ -715,11 +723,11 @@ const P = class P extends b {
715
723
  action_status: e.action_status,
716
724
  ...e.cursor ? { cursor: e.cursor } : {},
717
725
  ...e.count ? { count: e.count.toString() } : {}
718
- }, s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", a = `${this.baseUrl}${c(P, R)}/plans${i}`;
719
- return this.fetchWithAuth(a, t);
726
+ }, s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", o = `${this.baseUrl}${c(P, E)}/plans${i}`;
727
+ return this.fetchWithAuth(o, t);
720
728
  }
721
729
  async createPlan(e) {
722
- const t = `${this.baseUrl}${c(P, R)}/plans`;
730
+ const t = `${this.baseUrl}${c(P, E)}/plans`;
723
731
  return this.fetchWithAuth(t, {
724
732
  method: "POST",
725
733
  headers: {
@@ -731,7 +739,7 @@ const P = class P extends b {
731
739
  });
732
740
  }
733
741
  async updateAction(e, t) {
734
- const { action_id: n, ...s } = e, i = `${this.baseUrl}${c(P, R)}/plans/actions/${n}`;
742
+ const { action_id: n, ...s } = e, i = `${this.baseUrl}${c(P, E)}/plans/actions/${n}`;
735
743
  return this.fetchWithAuth(i, {
736
744
  method: "PUT",
737
745
  headers: {
@@ -743,10 +751,10 @@ const P = class P extends b {
743
751
  });
744
752
  }
745
753
  };
746
- R = new WeakMap(), h(P, R, "/v1/ihs");
747
- let _t = P;
748
- var S;
749
- const _ = class _ extends b {
754
+ E = new WeakMap(), d(P, E, "/v1/ihs");
755
+ let Pt = P;
756
+ var _;
757
+ const b = class b extends m {
750
758
  constructor(e) {
751
759
  super(e);
752
760
  }
@@ -755,7 +763,7 @@ const _ = class _ extends b {
755
763
  * POST /v1/dim/scans
756
764
  */
757
765
  async createScan(e, t) {
758
- const n = `${this.baseUrl}${c(_, S)}/scans`;
766
+ const n = `${this.baseUrl}${c(b, _)}/scans`;
759
767
  return this.fetchWithAuth(n, {
760
768
  method: "POST",
761
769
  headers: {
@@ -775,15 +783,15 @@ const _ = class _ extends b {
775
783
  async getScans(e, t) {
776
784
  const n = {};
777
785
  e != null && e.product_config_id && (n.product_config_id = e.product_config_id), e != null && e.scan_between && (n.scan_between = e.scan_between), e != null && e.cursor && (n.cursor = e.cursor), e != null && e.count && (n.count = e.count.toString());
778
- const s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", a = `${this.baseUrl}${c(_, S)}/scans${i}`;
779
- return this.fetchWithAuth(a, t);
786
+ const s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", o = `${this.baseUrl}${c(b, _)}/scans${i}`;
787
+ return this.fetchWithAuth(o, t);
780
788
  }
781
789
  /**
782
790
  * Get scan by ID
783
791
  * GET /v1/dim/scans/{scan_id}
784
792
  */
785
793
  async getScanById(e, t) {
786
- const n = `${this.baseUrl}${c(_, S)}/scans/${e.scanId}`;
794
+ const n = `${this.baseUrl}${c(b, _)}/scans/${e.scanId}`;
787
795
  return this.fetchWithAuth(n, t);
788
796
  }
789
797
  /**
@@ -793,15 +801,15 @@ const _ = class _ extends b {
793
801
  async getScansMetadata(e, t) {
794
802
  const n = {};
795
803
  e != null && e.product_config_id && (n.product_config_id = e.product_config_id), e != null && e.scan_between && (n.scan_between = e.scan_between), e != null && e.most_recent && (n.most_recent = "TRUE");
796
- const s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", a = `${this.baseUrl}${c(_, S)}/scans/meta${i}`;
797
- return this.fetchWithAuth(a, t);
804
+ const s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", o = `${this.baseUrl}${c(b, _)}/scans/meta${i}`;
805
+ return this.fetchWithAuth(o, t);
798
806
  }
799
807
  /**
800
808
  * Get brokers details
801
809
  * GET /v1/dim/brokers
802
810
  */
803
811
  async getBrokers(e) {
804
- const t = `${this.baseUrl}${c(_, S)}/brokers`;
812
+ const t = `${this.baseUrl}${c(b, _)}/brokers`;
805
813
  return this.fetchWithAuth(t, e);
806
814
  }
807
815
  /**
@@ -809,7 +817,7 @@ const _ = class _ extends b {
809
817
  * GET /v1/dim/brokers/{broker_id}
810
818
  */
811
819
  async getBrokerById(e, t) {
812
- const n = `${this.baseUrl}${c(_, S)}/brokers/${e.brokerId}`;
820
+ const n = `${this.baseUrl}${c(b, _)}/brokers/${e.brokerId}`;
813
821
  return this.fetchWithAuth(n, t);
814
822
  }
815
823
  /**
@@ -817,7 +825,7 @@ const _ = class _ extends b {
817
825
  * GET /v1/dim/scans/{scan_id}/brokers
818
826
  */
819
827
  async getBrokersByScanId(e, t) {
820
- const n = `${this.baseUrl}${c(_, S)}/scans/${e.scanId}/brokers`;
828
+ const n = `${this.baseUrl}${c(b, _)}/scans/${e.scanId}/brokers`;
821
829
  return this.fetchWithAuth(n, t);
822
830
  }
823
831
  /**
@@ -825,7 +833,7 @@ const _ = class _ extends b {
825
833
  * GET /v1/dim/brokers/groups/{group_id}
826
834
  */
827
835
  async getBrokersByGroupId(e, t) {
828
- const n = `${this.baseUrl}${c(_, S)}/brokers/groups/${e.groupId}`;
836
+ const n = `${this.baseUrl}${c(b, _)}/brokers/groups/${e.groupId}`;
829
837
  return this.fetchWithAuth(n, t);
830
838
  }
831
839
  /**
@@ -835,7 +843,7 @@ const _ = class _ extends b {
835
843
  * Note: Per OAS 1.0.29, this endpoint doesn't accept a request body
836
844
  */
837
845
  async updateBrokerGroupAction(e, t) {
838
- const n = `${this.baseUrl}${c(_, S)}/brokers/groups/${e.groupId}/action`;
846
+ const n = `${this.baseUrl}${c(b, _)}/brokers/groups/${e.groupId}/action`;
839
847
  return this.fetchWithAuth(n, {
840
848
  method: "POST",
841
849
  headers: {
@@ -846,50 +854,102 @@ const _ = class _ extends b {
846
854
  });
847
855
  }
848
856
  };
849
- S = new WeakMap(), h(_, S, "/v1/dim");
850
- let St = _;
851
- const it = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
857
+ _ = new WeakMap(), d(b, _, "/v1/dim");
858
+ let Ct = b;
859
+ var B;
860
+ const V = class V extends m {
861
+ constructor(e) {
862
+ super(e);
863
+ }
864
+ /**
865
+ * Get the current credit lock status
866
+ */
867
+ async getCreditLockStatus(e, t) {
868
+ const n = new URLSearchParams({
869
+ product_config_id: e.product_config_id
870
+ }).toString(), s = n ? `?${n}` : "", i = `${this.baseUrl}${c(V, B)}/lock-status${s}`;
871
+ return this.fetchWithAuth(i, t);
872
+ }
873
+ /**
874
+ * Lock credit file
875
+ */
876
+ async lockCredit(e, t) {
877
+ const n = `${this.baseUrl}${c(V, B)}/lock`;
878
+ return this.fetchWithAuth(n, {
879
+ method: "POST",
880
+ headers: {
881
+ ...(t == null ? void 0 : t.headers) ?? {},
882
+ "Content-Type": "application/json"
883
+ },
884
+ body: JSON.stringify({
885
+ product_config_id: e.product_config_id
886
+ }),
887
+ ...t ?? {}
888
+ });
889
+ }
890
+ /**
891
+ * Unlock credit file
892
+ */
893
+ async unlockCredit(e, t) {
894
+ const n = `${this.baseUrl}${c(V, B)}/unlock`;
895
+ return this.fetchWithAuth(n, {
896
+ method: "POST",
897
+ headers: {
898
+ ...(t == null ? void 0 : t.headers) ?? {},
899
+ "Content-Type": "application/json"
900
+ },
901
+ body: JSON.stringify({
902
+ product_config_id: e.product_config_id
903
+ }),
904
+ ...t ?? {}
905
+ });
906
+ }
907
+ };
908
+ B = new WeakMap(), d(V, B, "/v1/credit");
909
+ let vt = V;
910
+ const dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
852
911
  __proto__: null,
853
- AlertsService: yt,
854
- CreditAttributesService: dt,
855
- CreditReportsService: gt,
856
- CreditScorePlannerService: lt,
857
- CreditScoreSimulatorService: ht,
858
- CreditScoresService: ot,
859
- CustomerAuthService: ft,
860
- CustomersService: $t,
861
- DigitalIdentityManagerService: St,
862
- EntitlementsService: ut,
863
- IdentityHealthScoreService: _t,
864
- ProductConfigsService: bt,
865
- RegistrationsService: mt
912
+ AlertsService: bt,
913
+ CreditAttributesService: $t,
914
+ CreditLockUnlockService: vt,
915
+ CreditReportsService: _t,
916
+ CreditScorePlannerService: mt,
917
+ CreditScoreSimulatorService: ft,
918
+ CreditScoresService: lt,
919
+ CustomerAuthService: At,
920
+ CustomersService: St,
921
+ DigitalIdentityManagerService: Ct,
922
+ EntitlementsService: gt,
923
+ IdentityHealthScoreService: Pt,
924
+ ProductConfigsService: pt,
925
+ RegistrationsService: Tt
866
926
  }, Symbol.toStringTag, { value: "Module" }));
867
- function qt(r) {
927
+ function ce(r) {
868
928
  return `${r[0].toLowerCase()}${r.substring(1)}`.replace(
869
929
  "Service",
870
930
  ""
871
931
  );
872
932
  }
873
- const Ot = typeof process < "u" && process.versions && process.versions.node && typeof window > "u";
874
- var A, L, X, p, Nt, pt, Wt, jt;
875
- const F = class F {
933
+ const oe = typeof process < "u" && process.versions && process.versions.node && typeof window > "u";
934
+ var S, D, Q, A, Dt, Rt, Jt, Ft;
935
+ const G = class G {
876
936
  constructor(e) {
877
- h(this, p);
878
- d(this, "config");
879
- h(this, A);
880
- h(this, L, null);
881
- d(this, "baseUrl", "");
882
- this.config = e, this.baseUrl = Rt[e.environment ?? "PRODUCTION"], V(this, A, /* @__PURE__ */ new Map());
937
+ d(this, A);
938
+ h(this, "config");
939
+ d(this, S);
940
+ d(this, D, null);
941
+ h(this, "baseUrl", "");
942
+ this.config = e, this.baseUrl = It[e.environment ?? "PRODUCTION"], J(this, S, /* @__PURE__ */ new Map());
883
943
  }
884
944
  async getAccessToken(e) {
885
- if (!Ot)
886
- throw T.generateError({
945
+ if (!oe)
946
+ throw p.generateError({
887
947
  type: "sdk_error",
888
948
  message: "getAccessToken is not supported in browser"
889
949
  });
890
950
  try {
891
951
  return {
892
- data: await y(this, p, Nt).call(this, e),
952
+ data: await y(this, A, Dt).call(this, e),
893
953
  errors: void 0,
894
954
  meta: {
895
955
  status: 200,
@@ -908,25 +968,25 @@ const F = class F {
908
968
  }
909
969
  }
910
970
  getCacheLength() {
911
- return c(this, A).size;
971
+ return c(this, S).size;
912
972
  }
913
973
  clearCache() {
914
- const e = `${this.baseUrl}${c(F, X)}`, t = Array.from(c(this, A).keys()).filter(
974
+ const e = `${this.baseUrl}${c(G, Q)}`, t = Array.from(c(this, S).keys()).filter(
915
975
  (n) => n.includes(e)
916
976
  );
917
977
  for (const n of t)
918
- c(this, A).delete(n);
978
+ c(this, S).delete(n);
919
979
  }
920
980
  };
921
- A = new WeakMap(), L = new WeakMap(), X = new WeakMap(), p = new WeakSet(), Nt = async function({
981
+ S = new WeakMap(), D = new WeakMap(), Q = new WeakMap(), A = new WeakSet(), Dt = async function({
922
982
  grantType: e,
923
983
  clientId: t,
924
984
  clientSecret: n,
925
985
  customerId: s
926
986
  }) {
927
987
  var l;
928
- y(this, p, Wt).call(this);
929
- const i = `${this.baseUrl}${c(F, X)}`, a = {
988
+ y(this, A, Jt).call(this);
989
+ const i = `${this.baseUrl}${c(G, Q)}`, o = {
930
990
  method: "POST",
931
991
  headers: { "content-type": "application/json" },
932
992
  credentials: "include",
@@ -936,237 +996,243 @@ A = new WeakMap(), L = new WeakMap(), X = new WeakMap(), p = new WeakSet(), Nt =
936
996
  client_secret: n,
937
997
  ...e === "trusted_partner" ? { partner_customer_id: s ?? "" } : {}
938
998
  })
939
- }, o = await y(this, p, jt).call(this, i, a);
940
- if (o != null && o.ok) {
941
- const m = await o.clone().json();
942
- return c(this, L) === null && y(this, p, pt).call(this, m.expires_in), m;
999
+ }, a = await y(this, A, Ft).call(this, i, o);
1000
+ if (a != null && a.ok) {
1001
+ const T = await a.clone().json();
1002
+ return c(this, D) === null && y(this, A, Rt).call(this, T.expires_in), T;
943
1003
  }
944
1004
  const u = {
945
1005
  type: "sdk_error",
946
1006
  // fallback
947
- status: o == null ? void 0 : o.status,
948
- message: (o == null ? void 0 : o.statusText) || "",
1007
+ status: a == null ? void 0 : a.status,
1008
+ message: (a == null ? void 0 : a.statusText) || "",
949
1009
  data: void 0
950
1010
  };
951
- if ((l = o == null ? void 0 : o.headers.get("content-type")) != null && l.includes("application/json")) {
952
- const m = await o.clone().json();
953
- u.data = m.error, u.type = Ct(m.error.type);
1011
+ if ((l = a == null ? void 0 : a.headers.get("content-type")) != null && l.includes("application/json")) {
1012
+ const T = await a.clone().json();
1013
+ u.data = T.error, u.type = jt(T.error.type);
954
1014
  } else
955
- u.type = Et(o == null ? void 0 : o.status);
956
- throw T.generateError(u);
957
- }, pt = function(e) {
1015
+ u.type = kt(a == null ? void 0 : a.status);
1016
+ throw p.generateError(u);
1017
+ }, Rt = function(e) {
958
1018
  const t = (/* @__PURE__ */ new Date()).getTime(), n = 60 * 60 * 1e3, s = t + n, i = e === null ? e : new Date(s).valueOf();
959
- V(this, L, i);
960
- }, Wt = function() {
961
- const e = new Date(Date.now()), t = new Date(c(this, L) ?? Number.NaN);
962
- te(e, t) && (y(this, p, pt).call(this, null), c(this, A).clear());
963
- }, jt = async function(e, t) {
1019
+ J(this, D, i);
1020
+ }, Jt = function() {
1021
+ const e = new Date(Date.now()), t = new Date(c(this, D) ?? Number.NaN);
1022
+ ae(e, t) && (y(this, A, Rt).call(this, null), c(this, S).clear());
1023
+ }, Ft = async function(e, t) {
964
1024
  const n = `${e}${JSON.stringify(t || {})}`;
965
- if (!c(this, A).has(n)) {
1025
+ if (!c(this, S).has(n)) {
966
1026
  const s = fetch(e, t ?? {});
967
- c(this, A).set(n, s);
1027
+ c(this, S).set(n, s);
968
1028
  }
969
- return await c(this, A).get(n);
970
- }, h(F, X, "/v1/oauth2/token");
971
- let At = F;
972
- function te(r, e) {
1029
+ return await c(this, S).get(n);
1030
+ }, d(G, Q, "/v1/oauth2/token");
1031
+ let Et = G;
1032
+ function ae(r, e) {
973
1033
  return r > e;
974
1034
  }
975
- var x;
976
- const C = class C extends b {
1035
+ var N;
1036
+ const C = class C extends m {
977
1037
  // constructor is private so that no other class can access it.
978
1038
  constructor(t) {
979
1039
  super(t);
980
- d(this, "alerts");
981
- d(this, "auth");
982
- d(this, "creditReports");
983
- d(this, "creditScores");
984
- d(this, "creditAttributes");
985
- d(this, "creditScorePlanner");
986
- d(this, "creditScoreSimulator");
987
- d(this, "customerAuth");
988
- d(this, "customers");
989
- d(this, "entitlements");
990
- d(this, "productConfigs");
991
- d(this, "registrations");
992
- d(this, "identityHealthScore");
993
- d(this, "digitalIdentityManager");
994
- for (const n in it)
995
- typeof it[n] == "function" && (this[qt(n)] = new it[n](t));
996
- this.auth = new At({
1040
+ h(this, "alerts");
1041
+ h(this, "auth");
1042
+ h(this, "creditReports");
1043
+ h(this, "creditScores");
1044
+ h(this, "creditAttributes");
1045
+ h(this, "creditScorePlanner");
1046
+ h(this, "creditScoreSimulator");
1047
+ h(this, "customerAuth");
1048
+ h(this, "customers");
1049
+ h(this, "entitlements");
1050
+ h(this, "productConfigs");
1051
+ h(this, "registrations");
1052
+ h(this, "identityHealthScore");
1053
+ h(this, "digitalIdentityManager");
1054
+ h(this, "creditLockUnlock");
1055
+ for (const n in dt)
1056
+ typeof dt[n] == "function" && (this[ce(n)] = new dt[n](t));
1057
+ this.auth = new Et({
997
1058
  environment: t.environment
998
1059
  });
999
1060
  }
1000
1061
  // new services go here
1001
1062
  // The method is static as we need to access the method only through the class here
1002
1063
  static getInstance(t) {
1003
- return c(C, x) || V(C, x, new C(t)), c(C, x);
1064
+ return c(C, N) || J(C, N, new C(t)), c(C, N);
1004
1065
  }
1005
1066
  static clearInstance() {
1006
- V(C, x, null);
1067
+ J(C, N, null);
1007
1068
  }
1008
1069
  };
1009
- x = new WeakMap(), h(C, x, null);
1010
- let Tt = C;
1011
- function he(r) {
1012
- return Tt.getInstance(r);
1070
+ N = new WeakMap(), d(C, N, null);
1071
+ let wt = C;
1072
+ function _e(r) {
1073
+ return wt.getInstance(r);
1013
1074
  }
1014
- function ee(r) {
1075
+ function ue(r) {
1015
1076
  return r.progress_status === "TARGET_NOT_MET" || r.progress_status === "COMPLETED";
1016
1077
  }
1017
- function le(r) {
1018
- return ee(r) || r.progress_status === "TARGET_SCORE_AND_PLAN_SET" || r.progress_status === "ON_TRACK" || r.progress_status === "OFF_TRACK";
1078
+ function Se(r) {
1079
+ return ue(r) || r.progress_status === "TARGET_SCORE_AND_PLAN_SET" || r.progress_status === "ON_TRACK" || r.progress_status === "OFF_TRACK";
1019
1080
  }
1020
- function ye(r) {
1081
+ function Ae(r) {
1021
1082
  return r.score_model.includes("VANTAGE");
1022
1083
  }
1023
- function ge(r) {
1084
+ function Te(r) {
1024
1085
  return r.score_model.includes("FICO");
1025
1086
  }
1026
- function $e(r) {
1087
+ function pe(r) {
1027
1088
  return r.target_score !== void 0;
1028
1089
  }
1029
- function fe(r) {
1090
+ function Ue(r) {
1030
1091
  return r.max_actions_per_plan !== void 0;
1031
1092
  }
1032
- function me(r) {
1093
+ function Pe(r) {
1033
1094
  return r.score_model.includes("FICO");
1034
1095
  }
1035
- function be(r) {
1096
+ function Ce(r) {
1036
1097
  return r.score_model.includes("VANTAGE");
1037
1098
  }
1038
- function _e(r) {
1099
+ function ve(r) {
1039
1100
  return !!(r && "best_action" in r);
1040
1101
  }
1041
- function Se(r) {
1102
+ function Ee(r) {
1042
1103
  return !!(r && "simulated_score" in r);
1043
1104
  }
1044
- function Ae(r) {
1105
+ function Re(r) {
1045
1106
  return !("simulated_score" in r);
1046
1107
  }
1047
- function pe(r) {
1108
+ function we(r) {
1048
1109
  return !!(r && "slider_min_value" in r && "slider_max_value" in r);
1049
1110
  }
1050
- function Te(r) {
1111
+ function Ne(r) {
1051
1112
  return !!(r && "value" in r && "simulated_score" in r);
1052
1113
  }
1053
- function Ue(r) {
1114
+ function We(r) {
1054
1115
  return r === "v1" || r === "v2";
1055
1116
  }
1056
- function It(r) {
1117
+ function Kt(r) {
1057
1118
  if (typeof r != "object" || r === null) return !1;
1058
1119
  const e = r;
1059
- return typeof e.score_id == "string" && Lt(e.bureau) && typeof e.score == "number" && typeof e.score_date == "string";
1120
+ return typeof e.score_id == "string" && Mt(e.bureau) && typeof e.score == "number" && typeof e.score_date == "string";
1060
1121
  }
1061
- function kt(r) {
1122
+ function Gt(r) {
1062
1123
  if (typeof r != "object" || r === null) return !1;
1063
1124
  const e = r;
1064
- return typeof e.id == "string" && Array.isArray(e.bureau_scores) && e.bureau_scores.every((t) => re(t));
1125
+ return typeof e.id == "string" && Array.isArray(e.bureau_scores) && e.bureau_scores.every((t) => de(t));
1065
1126
  }
1066
- function re(r) {
1127
+ function de(r) {
1067
1128
  if (typeof r != "object" || r === null) return !1;
1068
1129
  const e = r;
1069
- return Lt(e.bureau) && typeof e.score == "number" && typeof e.score_date == "string";
1130
+ return Mt(e.bureau) && typeof e.score == "number" && typeof e.score_date == "string";
1070
1131
  }
1071
- function Lt(r) {
1132
+ function Mt(r) {
1072
1133
  return r === "EXPERIAN" || r === "EQUIFAX" || r === "TRANSUNION";
1073
1134
  }
1074
- function ne(r) {
1135
+ function he(r) {
1075
1136
  return typeof r == "object" && r !== null && "items" in r && Array.isArray(r.items) && r.items.every(
1076
- (e) => kt(e)
1137
+ (e) => Gt(e)
1077
1138
  );
1078
1139
  }
1079
- function se(r) {
1080
- return Array.isArray(r) && r.every((e) => It(e));
1140
+ function le(r) {
1141
+ return Array.isArray(r) && r.every((e) => Kt(e));
1081
1142
  }
1082
- function Pe(r) {
1083
- return se(r);
1143
+ function xe(r) {
1144
+ return le(r);
1084
1145
  }
1085
- function Ce(r) {
1086
- return ne(r);
1146
+ function je(r) {
1147
+ return he(r);
1087
1148
  }
1088
- function Ee(r) {
1089
- return It(r);
1149
+ function ke(r) {
1150
+ return Kt(r);
1090
1151
  }
1091
- function Re(r) {
1092
- return kt(r);
1152
+ function Ie(r) {
1153
+ return Gt(r);
1093
1154
  }
1094
- function ie(r) {
1155
+ function ye(r) {
1095
1156
  if (typeof r != "object" || r === null) return !1;
1096
1157
  const e = r;
1097
- return Vt(e.bureau) && typeof e.reported_at == "string" && typeof e.categories == "object" && typeof e.attributes == "object";
1158
+ return Ht(e.bureau) && typeof e.reported_at == "string" && typeof e.categories == "object" && typeof e.attributes == "object";
1098
1159
  }
1099
- function ce(r) {
1160
+ function ge(r) {
1100
1161
  if (typeof r != "object" || r === null) return !1;
1101
1162
  const e = r;
1102
1163
  return typeof e.id == "string" && Array.isArray(e.bureau_attributes) && e.bureau_attributes.every(
1103
- (t) => oe(t)
1164
+ (t) => $e(t)
1104
1165
  );
1105
1166
  }
1106
- function oe(r) {
1167
+ function $e(r) {
1107
1168
  if (typeof r != "object" || r === null) return !1;
1108
1169
  const e = r;
1109
- return Vt(e.bureau) && typeof e.reported_at == "string" && typeof e.categories == "object" && typeof e.attributes == "object";
1170
+ return Ht(e.bureau) && typeof e.reported_at == "string" && typeof e.categories == "object" && typeof e.attributes == "object";
1110
1171
  }
1111
- function Vt(r) {
1172
+ function Ht(r) {
1112
1173
  return r === "EXPERIAN" || r === "EQUIFAX" || r === "TRANSUNION";
1113
1174
  }
1114
- function ae(r) {
1175
+ function fe(r) {
1115
1176
  return typeof r == "object" && r !== null && "items" in r && Array.isArray(r.items) && r.items.every(
1116
- (e) => ce(e)
1177
+ (e) => ge(e)
1117
1178
  );
1118
1179
  }
1119
- function ue(r) {
1120
- return Array.isArray(r) && r.every((e) => ie(e));
1180
+ function me(r) {
1181
+ return Array.isArray(r) && r.every((e) => ye(e));
1121
1182
  }
1122
- function ve(r) {
1123
- return ue(r);
1183
+ function Le(r) {
1184
+ return me(r);
1124
1185
  }
1125
- function we(r) {
1126
- return ae(r);
1186
+ function Ve(r) {
1187
+ return fe(r);
1127
1188
  }
1189
+ const Be = {
1190
+ LOCKED: "LOCKED",
1191
+ UNLOCKED: "UNLOCKED"
1192
+ };
1128
1193
  export {
1129
- Mt as ConnectedSolutionsClientAuthenticationError,
1130
- T as ConnectedSolutionsClientError,
1131
- Xt as ConnectedSolutionsClientRateLimitError,
1132
- Ht as ConnectedSolutionsClientSDKError,
1133
- Kt as ConnectedSolutionsClientServerSideError,
1134
- Gt as ConnectedSolutionsClientSideError,
1135
- he as createSDK,
1136
- he as default,
1137
- oe as isBureauAttribute,
1138
- re as isBureauScore,
1139
- ie as isCreditAttribute,
1140
- ue as isCreditAttributeArray,
1141
- ce as isCreditAttributeV2,
1142
- ae as isCreditAttributesV2,
1143
- It as isCreditScore,
1144
- se as isCreditScoreArray,
1145
- kt as isCreditScoreV2,
1146
- ne as isCreditScoresV2,
1147
- ge as isFicoPlan,
1148
- me as isFicoRevision,
1149
- $e as isFicoRevisionsRequest,
1150
- Ae as isFicoScenario,
1151
- pe as isFicoScenarioVariation,
1152
- _e as isFicoSimulator,
1153
- ee as isPlanCompleted,
1154
- le as isPlanSet,
1155
- ve as isV1GetCreditAttributesResponse,
1156
- Pe as isV1GetCreditScoresResponse,
1157
- Ee as isV1PostCreditScoresResponse,
1158
- we as isV2GetCreditAttributesResponse,
1159
- Ce as isV2GetCreditScoresResponse,
1160
- Re as isV2PostCreditScoresResponse,
1161
- Ue as isValidApiVersion,
1162
- Lt as isValidBureau,
1163
- Vt as isValidBureauAttribute,
1164
- ye as isVantagePlan,
1165
- be as isVantageRevision,
1166
- fe as isVantageRevisionsRequest,
1167
- Se as isVantageScenario,
1168
- Te as isVantageScenarioVariation,
1169
- Ct as mapApiErrorTypeToSDKErrorType,
1170
- Et as mapHttpStatusToSDKErrorType
1194
+ qt as ConnectedSolutionsClientAuthenticationError,
1195
+ p as ConnectedSolutionsClientError,
1196
+ ee as ConnectedSolutionsClientRateLimitError,
1197
+ te as ConnectedSolutionsClientSDKError,
1198
+ Ot as ConnectedSolutionsClientServerSideError,
1199
+ Zt as ConnectedSolutionsClientSideError,
1200
+ Be as LOCK_STATUS,
1201
+ _e as createSDK,
1202
+ _e as default,
1203
+ $e as isBureauAttribute,
1204
+ de as isBureauScore,
1205
+ ye as isCreditAttribute,
1206
+ me as isCreditAttributeArray,
1207
+ ge as isCreditAttributeV2,
1208
+ fe as isCreditAttributesV2,
1209
+ Kt as isCreditScore,
1210
+ le as isCreditScoreArray,
1211
+ Gt as isCreditScoreV2,
1212
+ he as isCreditScoresV2,
1213
+ Te as isFicoPlan,
1214
+ Pe as isFicoRevision,
1215
+ pe as isFicoRevisionsRequest,
1216
+ Re as isFicoScenario,
1217
+ we as isFicoScenarioVariation,
1218
+ ve as isFicoSimulator,
1219
+ ue as isPlanCompleted,
1220
+ Se as isPlanSet,
1221
+ Le as isV1GetCreditAttributesResponse,
1222
+ xe as isV1GetCreditScoresResponse,
1223
+ ke as isV1PostCreditScoresResponse,
1224
+ Ve as isV2GetCreditAttributesResponse,
1225
+ je as isV2GetCreditScoresResponse,
1226
+ Ie as isV2PostCreditScoresResponse,
1227
+ We as isValidApiVersion,
1228
+ Mt as isValidBureau,
1229
+ Ht as isValidBureauAttribute,
1230
+ Ae as isVantagePlan,
1231
+ Ce as isVantageRevision,
1232
+ Ue as isVantageRevisionsRequest,
1233
+ Ee as isVantageScenario,
1234
+ Ne as isVantageScenarioVariation,
1235
+ jt as mapApiErrorTypeToSDKErrorType,
1236
+ kt as mapHttpStatusToSDKErrorType
1171
1237
  };
1172
1238
  //# sourceMappingURL=index.mjs.map