@experian-ecs/connected-api-sdk 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -1
- package/dist/esm/index.mjs +354 -346
- package/dist/esm/index.mjs.map +1 -1
- package/dist/index.d.ts +57 -8
- package/dist/umd/index.umd.js +1 -1
- package/dist/umd/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.mjs
CHANGED
|
@@ -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
|
|
16
|
-
var
|
|
15
|
+
var Kt = Object.defineProperty;
|
|
16
|
+
var Rt = (r) => {
|
|
17
17
|
throw TypeError(r);
|
|
18
18
|
};
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var c = (r, e, t) => (
|
|
22
|
-
function
|
|
19
|
+
var Ht = (r, e, t) => e in r ? Kt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
20
|
+
var h = (r, e, t) => Ht(r, typeof e != "symbol" ? e + "" : e, t), ot = (r, e, t) => e.has(r) || Rt("Cannot " + t);
|
|
21
|
+
var c = (r, e, t) => (ot(r, e, "read from private field"), t ? t.call(r) : e.get(r)), d = (r, e, t) => e.has(r) ? Rt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), B = (r, e, t, n) => (ot(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), y = (r, e, t) => (ot(r, e, "access private method"), t);
|
|
22
|
+
function Xt(r) {
|
|
23
23
|
switch (r.type) {
|
|
24
24
|
case "client_side_error":
|
|
25
|
-
return new
|
|
25
|
+
return new zt(r);
|
|
26
26
|
case "authentication_error":
|
|
27
|
-
return new
|
|
27
|
+
return new Qt(r);
|
|
28
28
|
case "server_side_error":
|
|
29
|
-
return new
|
|
29
|
+
return new Yt(r);
|
|
30
30
|
case "rate_limit_error":
|
|
31
|
-
return new
|
|
31
|
+
return new qt(r);
|
|
32
32
|
default:
|
|
33
|
-
return new
|
|
33
|
+
return new Zt(r);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
class
|
|
36
|
+
class p extends Error {
|
|
37
37
|
constructor(t) {
|
|
38
38
|
var n;
|
|
39
39
|
super(t.message);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
-
|
|
47
|
-
class
|
|
46
|
+
h(p, "generateError", Xt);
|
|
47
|
+
class zt extends p {
|
|
48
48
|
constructor(e) {
|
|
49
49
|
super(e), this.name = "ConnectedSolutionsClientSideError";
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
class
|
|
52
|
+
class Qt extends p {
|
|
53
53
|
constructor(e) {
|
|
54
54
|
super(e), this.name = "ConnectedSolutionsClientAuthenticationError";
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
class
|
|
57
|
+
class Yt extends p {
|
|
58
58
|
constructor(e) {
|
|
59
59
|
super(e), this.name = "ConnectedSolutionsClientServerSideError";
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
class
|
|
62
|
+
class Zt extends p {
|
|
63
63
|
constructor(e) {
|
|
64
64
|
super(e), this.name = "ConnectedSolutionsClientSDKError";
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
class
|
|
67
|
+
class qt extends p {
|
|
68
68
|
constructor(e) {
|
|
69
69
|
super(e), this.name = "ConnectedSolutionsClientRateLimitError";
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function xt(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
|
|
86
|
+
function Nt(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
|
|
89
|
+
const Wt = {
|
|
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
|
-
},
|
|
95
|
+
}, Ot = {
|
|
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,
|
|
103
|
-
class
|
|
102
|
+
var k, ut, jt;
|
|
103
|
+
class m {
|
|
104
104
|
constructor(e) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
105
|
+
d(this, k);
|
|
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 =
|
|
110
|
+
this.config = e, this.baseUrl = Wt[n], this.contentstackUrl = Ot[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,
|
|
117
|
+
y(this, k, ut).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,
|
|
140
|
+
y(this, k, ut).call(this);
|
|
141
141
|
const s = await fetch(e, t);
|
|
142
142
|
if (!(s != null && s.ok)) {
|
|
143
|
-
let
|
|
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 =
|
|
151
|
+
u.data = g.error, u.type = xt(g.error.type);
|
|
152
152
|
} else
|
|
153
|
-
u.type =
|
|
154
|
-
throw
|
|
153
|
+
u.type = Nt(s == null ? void 0 : s.status);
|
|
154
|
+
throw p.generateError(u);
|
|
155
155
|
}
|
|
156
|
-
return y(this, k,
|
|
156
|
+
return y(this, k, jt).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(),
|
|
184
|
+
k = new WeakSet(), ut = 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
|
|
190
|
+
throw p.generateError(e);
|
|
191
191
|
}
|
|
192
|
-
},
|
|
192
|
+
}, jt = 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,
|
|
197
|
-
const Q = class Q extends
|
|
196
|
+
var z, G, ht;
|
|
197
|
+
const Q = class Q extends m {
|
|
198
198
|
constructor(t) {
|
|
199
199
|
super(t);
|
|
200
|
-
|
|
200
|
+
d(this, G);
|
|
201
201
|
}
|
|
202
202
|
async getCreditScores(t, n) {
|
|
203
|
-
const s = t == null ? void 0 : t.version, i = y(this, G,
|
|
203
|
+
const s = t == null ? void 0 : t.version, i = y(this, G, ht).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
|
-
},
|
|
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,
|
|
211
|
+
const s = t.version, i = y(this, G, ht).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
|
-
},
|
|
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: {
|
|
@@ -230,12 +230,12 @@ z = new WeakMap(), G = new WeakSet(), /**
|
|
|
230
230
|
* @param version The API version to use.
|
|
231
231
|
* @returns The versioned API path.
|
|
232
232
|
*/
|
|
233
|
-
|
|
233
|
+
ht = function(t = "v1") {
|
|
234
234
|
return `/${t}${c(Q, z)}`;
|
|
235
|
-
},
|
|
236
|
-
let
|
|
235
|
+
}, d(Q, z, "/credit/scores");
|
|
236
|
+
let dt = Q;
|
|
237
237
|
var f;
|
|
238
|
-
const $ = class $ extends
|
|
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,
|
|
308
|
-
return this.fetchWithAuth(
|
|
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,17 +340,17 @@ const $ = class $ extends b {
|
|
|
340
340
|
return this.fetchWithAuth(s, t);
|
|
341
341
|
}
|
|
342
342
|
};
|
|
343
|
-
f = new WeakMap(),
|
|
344
|
-
let
|
|
345
|
-
var Y, Z,
|
|
346
|
-
const q = class q extends
|
|
343
|
+
f = new WeakMap(), d($, f, "/v1/entitlements");
|
|
344
|
+
let lt = $;
|
|
345
|
+
var Y, Z, It;
|
|
346
|
+
const q = class q extends m {
|
|
347
347
|
constructor(t) {
|
|
348
348
|
super(t);
|
|
349
|
-
|
|
349
|
+
d(this, Z);
|
|
350
350
|
}
|
|
351
351
|
async getCreditAttributes(t, n) {
|
|
352
|
-
const s = t == null ? void 0 : t.version, i = y(this, Z,
|
|
353
|
-
return this.fetchWithAuth(
|
|
352
|
+
const s = t == null ? void 0 : t.version, i = y(this, Z, It).call(this, s), o = `${this.baseUrl}${i}`;
|
|
353
|
+
return this.fetchWithAuth(o, n);
|
|
354
354
|
}
|
|
355
355
|
};
|
|
356
356
|
Y = new WeakMap(), Z = new WeakSet(), /**
|
|
@@ -358,12 +358,12 @@ Y = new WeakMap(), Z = new WeakSet(), /**
|
|
|
358
358
|
* @param version The API version to use.
|
|
359
359
|
* @returns The versioned API path.
|
|
360
360
|
*/
|
|
361
|
-
|
|
361
|
+
It = function(t = "v1") {
|
|
362
362
|
return `/${t}${c(q, Y)}`;
|
|
363
|
-
},
|
|
364
|
-
let
|
|
363
|
+
}, d(q, Y, "/credit/attributes");
|
|
364
|
+
let yt = q;
|
|
365
365
|
var M;
|
|
366
|
-
const
|
|
366
|
+
const D = class D 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}` : "",
|
|
375
|
-
return this.fetchWithAuth(
|
|
374
|
+
}, s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", o = `${this.baseUrl}${c(D, M)}${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(),
|
|
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(
|
|
380
|
+
`${this.baseUrl}${c(D, M)}${o}`,
|
|
381
381
|
{
|
|
382
382
|
method: "POST",
|
|
383
383
|
headers: {
|
|
@@ -390,22 +390,22 @@ const B = class B extends b {
|
|
|
390
390
|
);
|
|
391
391
|
}
|
|
392
392
|
};
|
|
393
|
-
M = new WeakMap(),
|
|
394
|
-
let
|
|
393
|
+
M = new WeakMap(), d(D, M, "/v1/credit/tools/simulator");
|
|
394
|
+
let gt = D;
|
|
395
395
|
var j, O;
|
|
396
|
-
const
|
|
396
|
+
const P = class P extends m {
|
|
397
397
|
constructor(e) {
|
|
398
398
|
super(e);
|
|
399
399
|
}
|
|
400
400
|
async getCreditScorePlan(e, t) {
|
|
401
|
-
const n = new URLSearchParams(e).toString(), s = n ? `?${n}` : "", i = `${this.baseUrl}${c(
|
|
401
|
+
const n = new URLSearchParams(e).toString(), s = n ? `?${n}` : "", i = `${this.baseUrl}${c(P, j)}${s}`;
|
|
402
402
|
return this.fetchWithAuth(i, {
|
|
403
403
|
...t ?? {}
|
|
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(),
|
|
408
|
-
return this.fetchWithAuth(
|
|
407
|
+
const { product_config_id: n, ...s } = e, i = new URLSearchParams({ product_config_id: n }).toString(), o = i ? `?${i}` : "", a = `${this.baseUrl}${c(P, j)}${o}`;
|
|
408
|
+
return this.fetchWithAuth(a, {
|
|
409
409
|
method: "POST",
|
|
410
410
|
headers: {
|
|
411
411
|
...(t == null ? void 0 : t.headers) ?? {},
|
|
@@ -416,15 +416,15 @@ const U = class U extends b {
|
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
418
|
async deleteCreditScorePlan(e, t) {
|
|
419
|
-
const n = new URLSearchParams(e).toString(), s = n ? `?${n}` : "", i = `${this.baseUrl}${c(
|
|
419
|
+
const n = new URLSearchParams(e).toString(), s = n ? `?${n}` : "", i = `${this.baseUrl}${c(P, j)}${s}`;
|
|
420
420
|
return this.fetchWithAuth(i, {
|
|
421
421
|
method: "DELETE",
|
|
422
422
|
...t ?? {}
|
|
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(),
|
|
427
|
-
return this.fetchWithAuth(
|
|
426
|
+
const { product_config_id: n, ...s } = e, i = new URLSearchParams({ product_config_id: n }).toString(), o = i ? `?${i}` : "", a = `${this.baseUrl}${c(P, j)}${c(P, O)}${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(),
|
|
439
|
-
let
|
|
438
|
+
j = new WeakMap(), O = new WeakMap(), d(P, j, "/v1/credit/tools/planners"), d(P, O, "/revisions");
|
|
439
|
+
let $t = P;
|
|
440
440
|
var I;
|
|
441
|
-
const W = class W extends
|
|
441
|
+
const W = class W extends m {
|
|
442
442
|
constructor(e) {
|
|
443
443
|
super(e);
|
|
444
444
|
}
|
|
@@ -466,57 +466,57 @@ const W = class W extends b {
|
|
|
466
466
|
return this.fetchWithAuth(t, e);
|
|
467
467
|
}
|
|
468
468
|
};
|
|
469
|
-
I = new WeakMap(),
|
|
470
|
-
let
|
|
471
|
-
function
|
|
469
|
+
I = new WeakMap(), d(W, I, "/v1/events-alerts");
|
|
470
|
+
let ft = W;
|
|
471
|
+
function kt(r) {
|
|
472
472
|
return !(r != null && r.version) || (r == null ? void 0 : r.version) === "v1";
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function te(r) {
|
|
475
475
|
return (r == null ? void 0 : r.version) === "v2";
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
return r !== void 0 &&
|
|
477
|
+
function wt(r) {
|
|
478
|
+
return r !== void 0 && kt(r) && "include_fields" in r && typeof r.include_fields == "string";
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
return r !== void 0 &&
|
|
480
|
+
function ee(r) {
|
|
481
|
+
return r !== void 0 && kt(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
|
|
484
|
-
return r !== void 0 &&
|
|
483
|
+
function re(r) {
|
|
484
|
+
return r !== void 0 && te(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,
|
|
487
|
-
const et = class et extends
|
|
486
|
+
var tt, C, N;
|
|
487
|
+
const et = class et extends m {
|
|
488
488
|
constructor(t) {
|
|
489
489
|
super(t);
|
|
490
|
-
|
|
490
|
+
d(this, C);
|
|
491
491
|
}
|
|
492
492
|
async getReports(t, n) {
|
|
493
|
-
const s = t == null ? void 0 : t.version, i = y(this,
|
|
494
|
-
|
|
495
|
-
const
|
|
493
|
+
const s = t == null ? void 0 : t.version, i = y(this, C, N).call(this, s), o = {};
|
|
494
|
+
ee(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())), re(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,
|
|
500
|
-
|
|
501
|
-
const u = new URLSearchParams(
|
|
499
|
+
const { id: s, version: i } = t, o = y(this, C, N).call(this, i), a = {};
|
|
500
|
+
wt(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:
|
|
506
|
-
...
|
|
505
|
+
const { version: s, latest_only: i, report_read: o, ...a } = t ?? {}, u = y(this, C, N).call(this, s), l = {
|
|
506
|
+
...a ?? {},
|
|
507
507
|
...i ? { latest_only: i.toString() } : {},
|
|
508
|
-
...
|
|
509
|
-
}, g = new URLSearchParams(l).toString(),
|
|
510
|
-
return this.fetchWithAuth(
|
|
508
|
+
...o ? { report_read: o.toString() } : {}
|
|
509
|
+
}, g = new URLSearchParams(l).toString(), T = g ? `?${g}` : "", ct = `${this.baseUrl}${u}/meta${T}`;
|
|
510
|
+
return this.fetchWithAuth(ct, n);
|
|
511
511
|
}
|
|
512
512
|
async getReportMetaById(t, n) {
|
|
513
|
-
const { id: s, version: i, ...
|
|
513
|
+
const { id: s, version: i, ...o } = t, a = y(this, C, N).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,
|
|
517
|
+
const { id: s, version: i } = t, o = y(this, C, N).call(this, i), a = `${this.baseUrl}${o}`;
|
|
518
518
|
if (i === "v2") {
|
|
519
|
-
const l = `${
|
|
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 = `${
|
|
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,
|
|
540
|
-
|
|
541
|
-
const
|
|
539
|
+
const s = {}, i = t == null ? void 0 : t.version, o = y(this, C, N).call(this, i);
|
|
540
|
+
wt(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(),
|
|
555
|
+
tt = new WeakMap(), C = 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
560
|
N = function(t = "v1") {
|
|
561
561
|
return `/${t}${c(et, tt)}`;
|
|
562
|
-
},
|
|
563
|
-
let
|
|
562
|
+
}, d(et, tt, "/credit/reports");
|
|
563
|
+
let mt = et;
|
|
564
564
|
var w;
|
|
565
|
-
const
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(),
|
|
618
|
-
let
|
|
617
|
+
w = new WeakMap(), d(R, w, "/v1/customers");
|
|
618
|
+
let bt = R;
|
|
619
619
|
var K;
|
|
620
|
-
const
|
|
620
|
+
const J = class J extends m {
|
|
621
621
|
constructor(e) {
|
|
622
622
|
super(e);
|
|
623
623
|
}
|
|
624
624
|
async getAuthQuestions(e) {
|
|
625
|
-
const t = `${this.baseUrl}${c(
|
|
625
|
+
const t = `${this.baseUrl}${c(J, K)}/questions`;
|
|
626
626
|
return this.fetchWithAuth(t, e);
|
|
627
627
|
}
|
|
628
628
|
async submitAuthAnswers(e, t) {
|
|
629
|
-
const n = `${this.baseUrl}${c(
|
|
629
|
+
const n = `${this.baseUrl}${c(J, K)}/questions`;
|
|
630
630
|
return this.fetchWithAuth(n, {
|
|
631
631
|
method: "POST",
|
|
632
632
|
headers: {
|
|
@@ -638,10 +638,10 @@ const D = class D extends b {
|
|
|
638
638
|
});
|
|
639
639
|
}
|
|
640
640
|
};
|
|
641
|
-
K = new WeakMap(),
|
|
642
|
-
let
|
|
641
|
+
K = new WeakMap(), d(J, K, "/v1/authentication");
|
|
642
|
+
let _t = J;
|
|
643
643
|
var rt;
|
|
644
|
-
const nt = class nt extends
|
|
644
|
+
const nt = class nt extends m {
|
|
645
645
|
constructor(e) {
|
|
646
646
|
super(e);
|
|
647
647
|
}
|
|
@@ -658,44 +658,52 @@ const nt = class nt extends b {
|
|
|
658
658
|
});
|
|
659
659
|
}
|
|
660
660
|
};
|
|
661
|
-
rt = new WeakMap(),
|
|
662
|
-
let
|
|
663
|
-
var H;
|
|
664
|
-
const
|
|
665
|
-
constructor(
|
|
666
|
-
super(
|
|
661
|
+
rt = new WeakMap(), d(nt, rt, "/v1/registrations");
|
|
662
|
+
let St = nt;
|
|
663
|
+
var st, H, Tt;
|
|
664
|
+
const it = class it extends m {
|
|
665
|
+
constructor(t) {
|
|
666
|
+
super(t);
|
|
667
|
+
d(this, H);
|
|
667
668
|
}
|
|
668
|
-
async getProductConfigs(
|
|
669
|
-
const { fromEntries:
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
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, H, Tt).call(this, a), { version: l, ...g } = s(
|
|
671
|
+
i(t).filter(([Et, L]) => L != null).map(([Et, L]) => [
|
|
672
|
+
Et,
|
|
673
|
+
o(L) ? L.join(",") : L.toString()
|
|
673
674
|
])
|
|
674
|
-
),
|
|
675
|
-
return this.fetchWithAuth(
|
|
676
|
-
...
|
|
675
|
+
), T = new URLSearchParams(g).toString(), ct = T ? `?${T}` : "", Mt = `${this.baseUrl}${u}${ct}`;
|
|
676
|
+
return this.fetchWithAuth(Mt, {
|
|
677
|
+
...n || {}
|
|
677
678
|
});
|
|
678
679
|
}
|
|
679
|
-
async getProductConfigById(
|
|
680
|
-
const
|
|
681
|
-
return this.fetchWithAuth(
|
|
682
|
-
...
|
|
680
|
+
async getProductConfigById(t, n) {
|
|
681
|
+
const s = t == null ? void 0 : t.version, i = y(this, H, Tt).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
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
687
|
+
st = new WeakMap(), H = 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
|
+
Tt = function(t = "v1") {
|
|
693
|
+
return `/${t}${c(it, st)}`;
|
|
694
|
+
}, d(it, st, "/product-configs");
|
|
695
|
+
let At = it;
|
|
696
|
+
var E;
|
|
697
|
+
const U = class U extends m {
|
|
690
698
|
constructor(e) {
|
|
691
699
|
super(e);
|
|
692
700
|
}
|
|
693
701
|
async getSurvey(e) {
|
|
694
|
-
const t = `${this.baseUrl}${c(
|
|
702
|
+
const t = `${this.baseUrl}${c(U, E)}/surveys`;
|
|
695
703
|
return this.fetchWithAuth(t, e);
|
|
696
704
|
}
|
|
697
705
|
async submitSurvey(e, t) {
|
|
698
|
-
const n = `${this.baseUrl}${c(
|
|
706
|
+
const n = `${this.baseUrl}${c(U, 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(
|
|
718
|
+
const t = `${this.baseUrl}${c(U, 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}` : "",
|
|
719
|
-
return this.fetchWithAuth(
|
|
726
|
+
}, s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", o = `${this.baseUrl}${c(U, E)}/plans${i}`;
|
|
727
|
+
return this.fetchWithAuth(o, t);
|
|
720
728
|
}
|
|
721
729
|
async createPlan(e) {
|
|
722
|
-
const t = `${this.baseUrl}${c(
|
|
730
|
+
const t = `${this.baseUrl}${c(U, 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(
|
|
742
|
+
const { action_id: n, ...s } = e, i = `${this.baseUrl}${c(U, 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
|
-
|
|
747
|
-
let
|
|
748
|
-
var
|
|
749
|
-
const
|
|
754
|
+
E = new WeakMap(), d(U, E, "/v1/ihs");
|
|
755
|
+
let pt = U;
|
|
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(
|
|
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}` : "",
|
|
779
|
-
return this.fetchWithAuth(
|
|
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(
|
|
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}` : "",
|
|
797
|
-
return this.fetchWithAuth(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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,50 @@ const _ = class _ extends b {
|
|
|
846
854
|
});
|
|
847
855
|
}
|
|
848
856
|
};
|
|
849
|
-
|
|
850
|
-
let
|
|
851
|
-
const
|
|
857
|
+
_ = new WeakMap(), d(b, _, "/v1/dim");
|
|
858
|
+
let Pt = b;
|
|
859
|
+
const at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
852
860
|
__proto__: null,
|
|
853
|
-
AlertsService:
|
|
854
|
-
CreditAttributesService:
|
|
855
|
-
CreditReportsService:
|
|
856
|
-
CreditScorePlannerService:
|
|
857
|
-
CreditScoreSimulatorService:
|
|
858
|
-
CreditScoresService:
|
|
859
|
-
CustomerAuthService:
|
|
860
|
-
CustomersService:
|
|
861
|
-
DigitalIdentityManagerService:
|
|
862
|
-
EntitlementsService:
|
|
863
|
-
IdentityHealthScoreService:
|
|
864
|
-
ProductConfigsService:
|
|
865
|
-
RegistrationsService:
|
|
861
|
+
AlertsService: ft,
|
|
862
|
+
CreditAttributesService: yt,
|
|
863
|
+
CreditReportsService: mt,
|
|
864
|
+
CreditScorePlannerService: $t,
|
|
865
|
+
CreditScoreSimulatorService: gt,
|
|
866
|
+
CreditScoresService: dt,
|
|
867
|
+
CustomerAuthService: _t,
|
|
868
|
+
CustomersService: bt,
|
|
869
|
+
DigitalIdentityManagerService: Pt,
|
|
870
|
+
EntitlementsService: lt,
|
|
871
|
+
IdentityHealthScoreService: pt,
|
|
872
|
+
ProductConfigsService: At,
|
|
873
|
+
RegistrationsService: St
|
|
866
874
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
867
|
-
function
|
|
875
|
+
function ne(r) {
|
|
868
876
|
return `${r[0].toLowerCase()}${r.substring(1)}`.replace(
|
|
869
877
|
"Service",
|
|
870
878
|
""
|
|
871
879
|
);
|
|
872
880
|
}
|
|
873
|
-
const
|
|
874
|
-
var
|
|
881
|
+
const se = typeof process < "u" && process.versions && process.versions.node && typeof window > "u";
|
|
882
|
+
var S, V, X, A, Lt, vt, Vt, Bt;
|
|
875
883
|
const F = class F {
|
|
876
884
|
constructor(e) {
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
this.config = e, this.baseUrl =
|
|
885
|
+
d(this, A);
|
|
886
|
+
h(this, "config");
|
|
887
|
+
d(this, S);
|
|
888
|
+
d(this, V, null);
|
|
889
|
+
h(this, "baseUrl", "");
|
|
890
|
+
this.config = e, this.baseUrl = Wt[e.environment ?? "PRODUCTION"], B(this, S, /* @__PURE__ */ new Map());
|
|
883
891
|
}
|
|
884
892
|
async getAccessToken(e) {
|
|
885
|
-
if (!
|
|
886
|
-
throw
|
|
893
|
+
if (!se)
|
|
894
|
+
throw p.generateError({
|
|
887
895
|
type: "sdk_error",
|
|
888
896
|
message: "getAccessToken is not supported in browser"
|
|
889
897
|
});
|
|
890
898
|
try {
|
|
891
899
|
return {
|
|
892
|
-
data: await y(this,
|
|
900
|
+
data: await y(this, A, Lt).call(this, e),
|
|
893
901
|
errors: void 0,
|
|
894
902
|
meta: {
|
|
895
903
|
status: 200,
|
|
@@ -908,25 +916,25 @@ const F = class F {
|
|
|
908
916
|
}
|
|
909
917
|
}
|
|
910
918
|
getCacheLength() {
|
|
911
|
-
return c(this,
|
|
919
|
+
return c(this, S).size;
|
|
912
920
|
}
|
|
913
921
|
clearCache() {
|
|
914
|
-
const e = `${this.baseUrl}${c(F, X)}`, t = Array.from(c(this,
|
|
922
|
+
const e = `${this.baseUrl}${c(F, X)}`, t = Array.from(c(this, S).keys()).filter(
|
|
915
923
|
(n) => n.includes(e)
|
|
916
924
|
);
|
|
917
925
|
for (const n of t)
|
|
918
|
-
c(this,
|
|
926
|
+
c(this, S).delete(n);
|
|
919
927
|
}
|
|
920
928
|
};
|
|
921
|
-
|
|
929
|
+
S = new WeakMap(), V = new WeakMap(), X = new WeakMap(), A = new WeakSet(), Lt = async function({
|
|
922
930
|
grantType: e,
|
|
923
931
|
clientId: t,
|
|
924
932
|
clientSecret: n,
|
|
925
933
|
customerId: s
|
|
926
934
|
}) {
|
|
927
935
|
var l;
|
|
928
|
-
y(this,
|
|
929
|
-
const i = `${this.baseUrl}${c(F, X)}`,
|
|
936
|
+
y(this, A, Vt).call(this);
|
|
937
|
+
const i = `${this.baseUrl}${c(F, X)}`, o = {
|
|
930
938
|
method: "POST",
|
|
931
939
|
headers: { "content-type": "application/json" },
|
|
932
940
|
credentials: "include",
|
|
@@ -936,237 +944,237 @@ A = new WeakMap(), L = new WeakMap(), X = new WeakMap(), p = new WeakSet(), Nt =
|
|
|
936
944
|
client_secret: n,
|
|
937
945
|
...e === "trusted_partner" ? { partner_customer_id: s ?? "" } : {}
|
|
938
946
|
})
|
|
939
|
-
},
|
|
940
|
-
if (
|
|
941
|
-
const
|
|
942
|
-
return c(this,
|
|
947
|
+
}, a = await y(this, A, Bt).call(this, i, o);
|
|
948
|
+
if (a != null && a.ok) {
|
|
949
|
+
const T = await a.clone().json();
|
|
950
|
+
return c(this, V) === null && y(this, A, vt).call(this, T.expires_in), T;
|
|
943
951
|
}
|
|
944
952
|
const u = {
|
|
945
953
|
type: "sdk_error",
|
|
946
954
|
// fallback
|
|
947
|
-
status:
|
|
948
|
-
message: (
|
|
955
|
+
status: a == null ? void 0 : a.status,
|
|
956
|
+
message: (a == null ? void 0 : a.statusText) || "",
|
|
949
957
|
data: void 0
|
|
950
958
|
};
|
|
951
|
-
if ((l =
|
|
952
|
-
const
|
|
953
|
-
u.data =
|
|
959
|
+
if ((l = a == null ? void 0 : a.headers.get("content-type")) != null && l.includes("application/json")) {
|
|
960
|
+
const T = await a.clone().json();
|
|
961
|
+
u.data = T.error, u.type = xt(T.error.type);
|
|
954
962
|
} else
|
|
955
|
-
u.type =
|
|
956
|
-
throw
|
|
957
|
-
},
|
|
963
|
+
u.type = Nt(a == null ? void 0 : a.status);
|
|
964
|
+
throw p.generateError(u);
|
|
965
|
+
}, vt = function(e) {
|
|
958
966
|
const t = (/* @__PURE__ */ new Date()).getTime(), n = 60 * 60 * 1e3, s = t + n, i = e === null ? e : new Date(s).valueOf();
|
|
959
|
-
|
|
960
|
-
},
|
|
961
|
-
const e = new Date(Date.now()), t = new Date(c(this,
|
|
962
|
-
|
|
963
|
-
},
|
|
967
|
+
B(this, V, i);
|
|
968
|
+
}, Vt = function() {
|
|
969
|
+
const e = new Date(Date.now()), t = new Date(c(this, V) ?? Number.NaN);
|
|
970
|
+
ie(e, t) && (y(this, A, vt).call(this, null), c(this, S).clear());
|
|
971
|
+
}, Bt = async function(e, t) {
|
|
964
972
|
const n = `${e}${JSON.stringify(t || {})}`;
|
|
965
|
-
if (!c(this,
|
|
973
|
+
if (!c(this, S).has(n)) {
|
|
966
974
|
const s = fetch(e, t ?? {});
|
|
967
|
-
c(this,
|
|
975
|
+
c(this, S).set(n, s);
|
|
968
976
|
}
|
|
969
|
-
return await c(this,
|
|
970
|
-
},
|
|
971
|
-
let
|
|
972
|
-
function
|
|
977
|
+
return await c(this, S).get(n);
|
|
978
|
+
}, d(F, X, "/v1/oauth2/token");
|
|
979
|
+
let Ut = F;
|
|
980
|
+
function ie(r, e) {
|
|
973
981
|
return r > e;
|
|
974
982
|
}
|
|
975
983
|
var x;
|
|
976
|
-
const
|
|
984
|
+
const v = class v extends m {
|
|
977
985
|
// constructor is private so that no other class can access it.
|
|
978
986
|
constructor(t) {
|
|
979
987
|
super(t);
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
for (const n in
|
|
995
|
-
typeof
|
|
996
|
-
this.auth = new
|
|
988
|
+
h(this, "alerts");
|
|
989
|
+
h(this, "auth");
|
|
990
|
+
h(this, "creditReports");
|
|
991
|
+
h(this, "creditScores");
|
|
992
|
+
h(this, "creditAttributes");
|
|
993
|
+
h(this, "creditScorePlanner");
|
|
994
|
+
h(this, "creditScoreSimulator");
|
|
995
|
+
h(this, "customerAuth");
|
|
996
|
+
h(this, "customers");
|
|
997
|
+
h(this, "entitlements");
|
|
998
|
+
h(this, "productConfigs");
|
|
999
|
+
h(this, "registrations");
|
|
1000
|
+
h(this, "identityHealthScore");
|
|
1001
|
+
h(this, "digitalIdentityManager");
|
|
1002
|
+
for (const n in at)
|
|
1003
|
+
typeof at[n] == "function" && (this[ne(n)] = new at[n](t));
|
|
1004
|
+
this.auth = new Ut({
|
|
997
1005
|
environment: t.environment
|
|
998
1006
|
});
|
|
999
1007
|
}
|
|
1000
1008
|
// new services go here
|
|
1001
1009
|
// The method is static as we need to access the method only through the class here
|
|
1002
1010
|
static getInstance(t) {
|
|
1003
|
-
return c(
|
|
1011
|
+
return c(v, x) || B(v, x, new v(t)), c(v, x);
|
|
1004
1012
|
}
|
|
1005
1013
|
static clearInstance() {
|
|
1006
|
-
|
|
1014
|
+
B(v, x, null);
|
|
1007
1015
|
}
|
|
1008
1016
|
};
|
|
1009
|
-
x = new WeakMap(),
|
|
1010
|
-
let
|
|
1011
|
-
function
|
|
1012
|
-
return
|
|
1017
|
+
x = new WeakMap(), d(v, x, null);
|
|
1018
|
+
let Ct = v;
|
|
1019
|
+
function fe(r) {
|
|
1020
|
+
return Ct.getInstance(r);
|
|
1013
1021
|
}
|
|
1014
|
-
function
|
|
1022
|
+
function ce(r) {
|
|
1015
1023
|
return r.progress_status === "TARGET_NOT_MET" || r.progress_status === "COMPLETED";
|
|
1016
1024
|
}
|
|
1017
|
-
function
|
|
1018
|
-
return
|
|
1025
|
+
function me(r) {
|
|
1026
|
+
return ce(r) || r.progress_status === "TARGET_SCORE_AND_PLAN_SET" || r.progress_status === "ON_TRACK" || r.progress_status === "OFF_TRACK";
|
|
1019
1027
|
}
|
|
1020
|
-
function
|
|
1028
|
+
function be(r) {
|
|
1021
1029
|
return r.score_model.includes("VANTAGE");
|
|
1022
1030
|
}
|
|
1023
|
-
function
|
|
1031
|
+
function _e(r) {
|
|
1024
1032
|
return r.score_model.includes("FICO");
|
|
1025
1033
|
}
|
|
1026
|
-
function
|
|
1034
|
+
function Se(r) {
|
|
1027
1035
|
return r.target_score !== void 0;
|
|
1028
1036
|
}
|
|
1029
|
-
function
|
|
1037
|
+
function Ae(r) {
|
|
1030
1038
|
return r.max_actions_per_plan !== void 0;
|
|
1031
1039
|
}
|
|
1032
|
-
function
|
|
1040
|
+
function Te(r) {
|
|
1033
1041
|
return r.score_model.includes("FICO");
|
|
1034
1042
|
}
|
|
1035
|
-
function
|
|
1043
|
+
function pe(r) {
|
|
1036
1044
|
return r.score_model.includes("VANTAGE");
|
|
1037
1045
|
}
|
|
1038
|
-
function
|
|
1046
|
+
function Pe(r) {
|
|
1039
1047
|
return !!(r && "best_action" in r);
|
|
1040
1048
|
}
|
|
1041
|
-
function
|
|
1049
|
+
function Ue(r) {
|
|
1042
1050
|
return !!(r && "simulated_score" in r);
|
|
1043
1051
|
}
|
|
1044
|
-
function
|
|
1052
|
+
function ve(r) {
|
|
1045
1053
|
return !("simulated_score" in r);
|
|
1046
1054
|
}
|
|
1047
|
-
function
|
|
1055
|
+
function Ce(r) {
|
|
1048
1056
|
return !!(r && "slider_min_value" in r && "slider_max_value" in r);
|
|
1049
1057
|
}
|
|
1050
|
-
function
|
|
1058
|
+
function Ee(r) {
|
|
1051
1059
|
return !!(r && "value" in r && "simulated_score" in r);
|
|
1052
1060
|
}
|
|
1053
|
-
function
|
|
1061
|
+
function Re(r) {
|
|
1054
1062
|
return r === "v1" || r === "v2";
|
|
1055
1063
|
}
|
|
1056
|
-
function
|
|
1064
|
+
function Dt(r) {
|
|
1057
1065
|
if (typeof r != "object" || r === null) return !1;
|
|
1058
1066
|
const e = r;
|
|
1059
|
-
return typeof e.score_id == "string" &&
|
|
1067
|
+
return typeof e.score_id == "string" && Ft(e.bureau) && typeof e.score == "number" && typeof e.score_date == "string";
|
|
1060
1068
|
}
|
|
1061
|
-
function
|
|
1069
|
+
function Jt(r) {
|
|
1062
1070
|
if (typeof r != "object" || r === null) return !1;
|
|
1063
1071
|
const e = r;
|
|
1064
|
-
return typeof e.id == "string" && Array.isArray(e.bureau_scores) && e.bureau_scores.every((t) =>
|
|
1072
|
+
return typeof e.id == "string" && Array.isArray(e.bureau_scores) && e.bureau_scores.every((t) => oe(t));
|
|
1065
1073
|
}
|
|
1066
|
-
function
|
|
1074
|
+
function oe(r) {
|
|
1067
1075
|
if (typeof r != "object" || r === null) return !1;
|
|
1068
1076
|
const e = r;
|
|
1069
|
-
return
|
|
1077
|
+
return Ft(e.bureau) && typeof e.score == "number" && typeof e.score_date == "string";
|
|
1070
1078
|
}
|
|
1071
|
-
function
|
|
1079
|
+
function Ft(r) {
|
|
1072
1080
|
return r === "EXPERIAN" || r === "EQUIFAX" || r === "TRANSUNION";
|
|
1073
1081
|
}
|
|
1074
|
-
function
|
|
1082
|
+
function ae(r) {
|
|
1075
1083
|
return typeof r == "object" && r !== null && "items" in r && Array.isArray(r.items) && r.items.every(
|
|
1076
|
-
(e) =>
|
|
1084
|
+
(e) => Jt(e)
|
|
1077
1085
|
);
|
|
1078
1086
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return Array.isArray(r) && r.every((e) =>
|
|
1087
|
+
function ue(r) {
|
|
1088
|
+
return Array.isArray(r) && r.every((e) => Dt(e));
|
|
1081
1089
|
}
|
|
1082
|
-
function
|
|
1083
|
-
return
|
|
1090
|
+
function we(r) {
|
|
1091
|
+
return ue(r);
|
|
1084
1092
|
}
|
|
1085
|
-
function
|
|
1086
|
-
return
|
|
1093
|
+
function xe(r) {
|
|
1094
|
+
return ae(r);
|
|
1087
1095
|
}
|
|
1088
|
-
function
|
|
1089
|
-
return
|
|
1096
|
+
function Ne(r) {
|
|
1097
|
+
return Dt(r);
|
|
1090
1098
|
}
|
|
1091
|
-
function
|
|
1092
|
-
return
|
|
1099
|
+
function We(r) {
|
|
1100
|
+
return Jt(r);
|
|
1093
1101
|
}
|
|
1094
|
-
function
|
|
1102
|
+
function de(r) {
|
|
1095
1103
|
if (typeof r != "object" || r === null) return !1;
|
|
1096
1104
|
const e = r;
|
|
1097
|
-
return
|
|
1105
|
+
return Gt(e.bureau) && typeof e.reported_at == "string" && typeof e.categories == "object" && typeof e.attributes == "object";
|
|
1098
1106
|
}
|
|
1099
|
-
function
|
|
1107
|
+
function he(r) {
|
|
1100
1108
|
if (typeof r != "object" || r === null) return !1;
|
|
1101
1109
|
const e = r;
|
|
1102
1110
|
return typeof e.id == "string" && Array.isArray(e.bureau_attributes) && e.bureau_attributes.every(
|
|
1103
|
-
(t) =>
|
|
1111
|
+
(t) => le(t)
|
|
1104
1112
|
);
|
|
1105
1113
|
}
|
|
1106
|
-
function
|
|
1114
|
+
function le(r) {
|
|
1107
1115
|
if (typeof r != "object" || r === null) return !1;
|
|
1108
1116
|
const e = r;
|
|
1109
|
-
return
|
|
1117
|
+
return Gt(e.bureau) && typeof e.reported_at == "string" && typeof e.categories == "object" && typeof e.attributes == "object";
|
|
1110
1118
|
}
|
|
1111
|
-
function
|
|
1119
|
+
function Gt(r) {
|
|
1112
1120
|
return r === "EXPERIAN" || r === "EQUIFAX" || r === "TRANSUNION";
|
|
1113
1121
|
}
|
|
1114
|
-
function
|
|
1122
|
+
function ye(r) {
|
|
1115
1123
|
return typeof r == "object" && r !== null && "items" in r && Array.isArray(r.items) && r.items.every(
|
|
1116
|
-
(e) =>
|
|
1124
|
+
(e) => he(e)
|
|
1117
1125
|
);
|
|
1118
1126
|
}
|
|
1119
|
-
function
|
|
1120
|
-
return Array.isArray(r) && r.every((e) =>
|
|
1127
|
+
function ge(r) {
|
|
1128
|
+
return Array.isArray(r) && r.every((e) => de(e));
|
|
1121
1129
|
}
|
|
1122
|
-
function
|
|
1123
|
-
return
|
|
1130
|
+
function je(r) {
|
|
1131
|
+
return ge(r);
|
|
1124
1132
|
}
|
|
1125
|
-
function
|
|
1126
|
-
return
|
|
1133
|
+
function Ie(r) {
|
|
1134
|
+
return ye(r);
|
|
1127
1135
|
}
|
|
1128
1136
|
export {
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1137
|
+
Qt as ConnectedSolutionsClientAuthenticationError,
|
|
1138
|
+
p as ConnectedSolutionsClientError,
|
|
1139
|
+
qt as ConnectedSolutionsClientRateLimitError,
|
|
1140
|
+
Zt as ConnectedSolutionsClientSDKError,
|
|
1141
|
+
Yt as ConnectedSolutionsClientServerSideError,
|
|
1142
|
+
zt as ConnectedSolutionsClientSideError,
|
|
1143
|
+
fe as createSDK,
|
|
1144
|
+
fe as default,
|
|
1145
|
+
le as isBureauAttribute,
|
|
1146
|
+
oe as isBureauScore,
|
|
1147
|
+
de as isCreditAttribute,
|
|
1148
|
+
ge as isCreditAttributeArray,
|
|
1149
|
+
he as isCreditAttributeV2,
|
|
1150
|
+
ye as isCreditAttributesV2,
|
|
1151
|
+
Dt as isCreditScore,
|
|
1152
|
+
ue as isCreditScoreArray,
|
|
1153
|
+
Jt as isCreditScoreV2,
|
|
1154
|
+
ae as isCreditScoresV2,
|
|
1155
|
+
_e as isFicoPlan,
|
|
1156
|
+
Te as isFicoRevision,
|
|
1157
|
+
Se as isFicoRevisionsRequest,
|
|
1158
|
+
ve as isFicoScenario,
|
|
1159
|
+
Ce as isFicoScenarioVariation,
|
|
1160
|
+
Pe as isFicoSimulator,
|
|
1161
|
+
ce as isPlanCompleted,
|
|
1162
|
+
me as isPlanSet,
|
|
1163
|
+
je as isV1GetCreditAttributesResponse,
|
|
1164
|
+
we as isV1GetCreditScoresResponse,
|
|
1165
|
+
Ne as isV1PostCreditScoresResponse,
|
|
1166
|
+
Ie as isV2GetCreditAttributesResponse,
|
|
1167
|
+
xe as isV2GetCreditScoresResponse,
|
|
1168
|
+
We as isV2PostCreditScoresResponse,
|
|
1169
|
+
Re as isValidApiVersion,
|
|
1170
|
+
Ft as isValidBureau,
|
|
1171
|
+
Gt as isValidBureauAttribute,
|
|
1172
|
+
be as isVantagePlan,
|
|
1173
|
+
pe as isVantageRevision,
|
|
1174
|
+
Ae as isVantageRevisionsRequest,
|
|
1175
|
+
Ue as isVantageScenario,
|
|
1176
|
+
Ee as isVantageScenarioVariation,
|
|
1177
|
+
xt as mapApiErrorTypeToSDKErrorType,
|
|
1178
|
+
Nt as mapHttpStatusToSDKErrorType
|
|
1171
1179
|
};
|
|
1172
1180
|
//# sourceMappingURL=index.mjs.map
|