@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.
- package/README.md +24 -1
- package/dist/esm/index.mjs +428 -362
- package/dist/esm/index.mjs.map +1 -1
- package/dist/index.d.ts +94 -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 zt = Object.defineProperty;
|
|
16
|
+
var Wt = (r) => {
|
|
17
17
|
throw TypeError(r);
|
|
18
18
|
};
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var c = (r, e, t) => (
|
|
22
|
-
function
|
|
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
|
|
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 Ot(r);
|
|
30
30
|
case "rate_limit_error":
|
|
31
|
-
return new
|
|
31
|
+
return new ee(r);
|
|
32
32
|
default:
|
|
33
|
-
return new
|
|
33
|
+
return new te(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", Yt);
|
|
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 Ot extends p {
|
|
58
58
|
constructor(e) {
|
|
59
59
|
super(e), this.name = "ConnectedSolutionsClientServerSideError";
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
class
|
|
62
|
+
class te extends p {
|
|
63
63
|
constructor(e) {
|
|
64
64
|
super(e), this.name = "ConnectedSolutionsClientSDKError";
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
class
|
|
67
|
+
class ee extends p {
|
|
68
68
|
constructor(e) {
|
|
69
69
|
super(e), this.name = "ConnectedSolutionsClientRateLimitError";
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
function
|
|
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
|
|
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
|
|
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
|
-
},
|
|
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
|
|
103
|
-
class
|
|
102
|
+
var I, ht, Lt;
|
|
103
|
+
class m {
|
|
104
104
|
constructor(e) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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 =
|
|
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,
|
|
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,
|
|
140
|
+
y(this, I, ht).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 = jt(g.error.type);
|
|
152
152
|
} else
|
|
153
|
-
u.type =
|
|
154
|
-
throw
|
|
153
|
+
u.type = kt(s == null ? void 0 : s.status);
|
|
154
|
+
throw p.generateError(u);
|
|
155
155
|
}
|
|
156
|
-
return y(this,
|
|
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
|
-
|
|
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
|
|
190
|
+
throw p.generateError(e);
|
|
191
191
|
}
|
|
192
|
-
},
|
|
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
|
|
197
|
-
const
|
|
196
|
+
var Y, M, yt;
|
|
197
|
+
const Z = class Z extends m {
|
|
198
198
|
constructor(t) {
|
|
199
199
|
super(t);
|
|
200
|
-
|
|
200
|
+
d(this, M);
|
|
201
201
|
}
|
|
202
202
|
async getCreditScores(t, n) {
|
|
203
|
-
const s = t == null ? void 0 : t.version, i = y(this,
|
|
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
|
-
},
|
|
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,
|
|
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
|
-
},
|
|
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
|
-
|
|
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
|
-
|
|
234
|
-
return `/${t}${c(
|
|
235
|
-
},
|
|
236
|
-
let
|
|
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
|
|
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,30 +340,30 @@ const $ = class $ extends b {
|
|
|
340
340
|
return this.fetchWithAuth(s, t);
|
|
341
341
|
}
|
|
342
342
|
};
|
|
343
|
-
f = new WeakMap(),
|
|
344
|
-
let
|
|
345
|
-
var
|
|
346
|
-
const
|
|
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
|
-
|
|
349
|
+
d(this, O);
|
|
350
350
|
}
|
|
351
351
|
async getCreditAttributes(t, n) {
|
|
352
|
-
const s = t == null ? void 0 : t.version, i = y(this,
|
|
353
|
-
return this.fetchWithAuth(
|
|
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
|
-
|
|
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
|
-
|
|
362
|
-
return `/${t}${c(
|
|
363
|
-
},
|
|
364
|
-
let
|
|
365
|
-
var
|
|
366
|
-
const
|
|
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}` : "",
|
|
375
|
-
return this.fetchWithAuth(
|
|
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(),
|
|
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(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
|
-
|
|
394
|
-
let
|
|
395
|
-
var j,
|
|
396
|
-
const U = class U extends
|
|
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(),
|
|
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(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(),
|
|
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(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(),
|
|
439
|
-
let
|
|
440
|
-
var
|
|
441
|
-
const
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
465
|
+
const t = `${this.baseUrl}${c(x, k)}/counts`;
|
|
466
466
|
return this.fetchWithAuth(t, e);
|
|
467
467
|
}
|
|
468
468
|
};
|
|
469
|
-
|
|
470
|
-
let
|
|
471
|
-
function
|
|
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
|
|
474
|
+
function ne(r) {
|
|
475
475
|
return (r == null ? void 0 : r.version) === "v2";
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
return r !== void 0 &&
|
|
477
|
+
function xt(r) {
|
|
478
|
+
return r !== void 0 && Bt(r) && "include_fields" in r && typeof r.include_fields == "string";
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
return r !== void 0 &&
|
|
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
|
|
484
|
-
return r !== void 0 &&
|
|
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
|
|
487
|
-
const
|
|
486
|
+
var rt, v, W;
|
|
487
|
+
const nt = class nt extends m {
|
|
488
488
|
constructor(t) {
|
|
489
489
|
super(t);
|
|
490
|
-
|
|
490
|
+
d(this, v);
|
|
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, 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,
|
|
500
|
-
|
|
501
|
-
const u = new URLSearchParams(
|
|
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:
|
|
506
|
-
...
|
|
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
|
-
...
|
|
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}` : "", 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, ...
|
|
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,
|
|
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 = `${
|
|
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, 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
|
-
|
|
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
|
-
|
|
561
|
-
return `/${t}${c(
|
|
562
|
-
},
|
|
563
|
-
let
|
|
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
|
|
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
|
|
619
|
-
var
|
|
620
|
-
const
|
|
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(
|
|
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(
|
|
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
|
-
|
|
642
|
-
let
|
|
643
|
-
var
|
|
644
|
-
const
|
|
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(
|
|
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
|
-
|
|
662
|
-
let
|
|
663
|
-
var
|
|
664
|
-
const
|
|
665
|
-
constructor(
|
|
666
|
-
super(
|
|
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(
|
|
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, 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
|
-
),
|
|
675
|
-
return this.fetchWithAuth(
|
|
676
|
-
...
|
|
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(
|
|
680
|
-
const
|
|
681
|
-
return this.fetchWithAuth(
|
|
682
|
-
...
|
|
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
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
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,
|
|
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,
|
|
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,
|
|
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}` : "",
|
|
719
|
-
return this.fetchWithAuth(
|
|
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,
|
|
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,
|
|
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
|
-
|
|
747
|
-
let
|
|
748
|
-
var
|
|
749
|
-
const
|
|
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(
|
|
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,102 @@ const _ = class _ extends b {
|
|
|
846
854
|
});
|
|
847
855
|
}
|
|
848
856
|
};
|
|
849
|
-
|
|
850
|
-
let
|
|
851
|
-
|
|
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:
|
|
854
|
-
CreditAttributesService:
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
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
|
|
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
|
|
874
|
-
var
|
|
875
|
-
const
|
|
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
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
this.config = e, this.baseUrl =
|
|
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 (!
|
|
886
|
-
throw
|
|
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,
|
|
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,
|
|
971
|
+
return c(this, S).size;
|
|
912
972
|
}
|
|
913
973
|
clearCache() {
|
|
914
|
-
const e = `${this.baseUrl}${c(
|
|
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,
|
|
978
|
+
c(this, S).delete(n);
|
|
919
979
|
}
|
|
920
980
|
};
|
|
921
|
-
|
|
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,
|
|
929
|
-
const i = `${this.baseUrl}${c(
|
|
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
|
-
},
|
|
940
|
-
if (
|
|
941
|
-
const
|
|
942
|
-
return c(this,
|
|
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:
|
|
948
|
-
message: (
|
|
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 =
|
|
952
|
-
const
|
|
953
|
-
u.data =
|
|
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 =
|
|
956
|
-
throw
|
|
957
|
-
},
|
|
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
|
-
|
|
960
|
-
},
|
|
961
|
-
const e = new Date(Date.now()), t = new Date(c(this,
|
|
962
|
-
|
|
963
|
-
},
|
|
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,
|
|
1025
|
+
if (!c(this, S).has(n)) {
|
|
966
1026
|
const s = fetch(e, t ?? {});
|
|
967
|
-
c(this,
|
|
1027
|
+
c(this, S).set(n, s);
|
|
968
1028
|
}
|
|
969
|
-
return await c(this,
|
|
970
|
-
},
|
|
971
|
-
let
|
|
972
|
-
function
|
|
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
|
|
976
|
-
const C = class C extends
|
|
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
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
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,
|
|
1064
|
+
return c(C, N) || J(C, N, new C(t)), c(C, N);
|
|
1004
1065
|
}
|
|
1005
1066
|
static clearInstance() {
|
|
1006
|
-
|
|
1067
|
+
J(C, N, null);
|
|
1007
1068
|
}
|
|
1008
1069
|
};
|
|
1009
|
-
|
|
1010
|
-
let
|
|
1011
|
-
function
|
|
1012
|
-
return
|
|
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
|
|
1075
|
+
function ue(r) {
|
|
1015
1076
|
return r.progress_status === "TARGET_NOT_MET" || r.progress_status === "COMPLETED";
|
|
1016
1077
|
}
|
|
1017
|
-
function
|
|
1018
|
-
return
|
|
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
|
|
1081
|
+
function Ae(r) {
|
|
1021
1082
|
return r.score_model.includes("VANTAGE");
|
|
1022
1083
|
}
|
|
1023
|
-
function
|
|
1084
|
+
function Te(r) {
|
|
1024
1085
|
return r.score_model.includes("FICO");
|
|
1025
1086
|
}
|
|
1026
|
-
function
|
|
1087
|
+
function pe(r) {
|
|
1027
1088
|
return r.target_score !== void 0;
|
|
1028
1089
|
}
|
|
1029
|
-
function
|
|
1090
|
+
function Ue(r) {
|
|
1030
1091
|
return r.max_actions_per_plan !== void 0;
|
|
1031
1092
|
}
|
|
1032
|
-
function
|
|
1093
|
+
function Pe(r) {
|
|
1033
1094
|
return r.score_model.includes("FICO");
|
|
1034
1095
|
}
|
|
1035
|
-
function
|
|
1096
|
+
function Ce(r) {
|
|
1036
1097
|
return r.score_model.includes("VANTAGE");
|
|
1037
1098
|
}
|
|
1038
|
-
function
|
|
1099
|
+
function ve(r) {
|
|
1039
1100
|
return !!(r && "best_action" in r);
|
|
1040
1101
|
}
|
|
1041
|
-
function
|
|
1102
|
+
function Ee(r) {
|
|
1042
1103
|
return !!(r && "simulated_score" in r);
|
|
1043
1104
|
}
|
|
1044
|
-
function
|
|
1105
|
+
function Re(r) {
|
|
1045
1106
|
return !("simulated_score" in r);
|
|
1046
1107
|
}
|
|
1047
|
-
function
|
|
1108
|
+
function we(r) {
|
|
1048
1109
|
return !!(r && "slider_min_value" in r && "slider_max_value" in r);
|
|
1049
1110
|
}
|
|
1050
|
-
function
|
|
1111
|
+
function Ne(r) {
|
|
1051
1112
|
return !!(r && "value" in r && "simulated_score" in r);
|
|
1052
1113
|
}
|
|
1053
|
-
function
|
|
1114
|
+
function We(r) {
|
|
1054
1115
|
return r === "v1" || r === "v2";
|
|
1055
1116
|
}
|
|
1056
|
-
function
|
|
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" &&
|
|
1120
|
+
return typeof e.score_id == "string" && Mt(e.bureau) && typeof e.score == "number" && typeof e.score_date == "string";
|
|
1060
1121
|
}
|
|
1061
|
-
function
|
|
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) =>
|
|
1125
|
+
return typeof e.id == "string" && Array.isArray(e.bureau_scores) && e.bureau_scores.every((t) => de(t));
|
|
1065
1126
|
}
|
|
1066
|
-
function
|
|
1127
|
+
function de(r) {
|
|
1067
1128
|
if (typeof r != "object" || r === null) return !1;
|
|
1068
1129
|
const e = r;
|
|
1069
|
-
return
|
|
1130
|
+
return Mt(e.bureau) && typeof e.score == "number" && typeof e.score_date == "string";
|
|
1070
1131
|
}
|
|
1071
|
-
function
|
|
1132
|
+
function Mt(r) {
|
|
1072
1133
|
return r === "EXPERIAN" || r === "EQUIFAX" || r === "TRANSUNION";
|
|
1073
1134
|
}
|
|
1074
|
-
function
|
|
1135
|
+
function he(r) {
|
|
1075
1136
|
return typeof r == "object" && r !== null && "items" in r && Array.isArray(r.items) && r.items.every(
|
|
1076
|
-
(e) =>
|
|
1137
|
+
(e) => Gt(e)
|
|
1077
1138
|
);
|
|
1078
1139
|
}
|
|
1079
|
-
function
|
|
1080
|
-
return Array.isArray(r) && r.every((e) =>
|
|
1140
|
+
function le(r) {
|
|
1141
|
+
return Array.isArray(r) && r.every((e) => Kt(e));
|
|
1081
1142
|
}
|
|
1082
|
-
function
|
|
1083
|
-
return
|
|
1143
|
+
function xe(r) {
|
|
1144
|
+
return le(r);
|
|
1084
1145
|
}
|
|
1085
|
-
function
|
|
1086
|
-
return
|
|
1146
|
+
function je(r) {
|
|
1147
|
+
return he(r);
|
|
1087
1148
|
}
|
|
1088
|
-
function
|
|
1089
|
-
return
|
|
1149
|
+
function ke(r) {
|
|
1150
|
+
return Kt(r);
|
|
1090
1151
|
}
|
|
1091
|
-
function
|
|
1092
|
-
return
|
|
1152
|
+
function Ie(r) {
|
|
1153
|
+
return Gt(r);
|
|
1093
1154
|
}
|
|
1094
|
-
function
|
|
1155
|
+
function ye(r) {
|
|
1095
1156
|
if (typeof r != "object" || r === null) return !1;
|
|
1096
1157
|
const e = r;
|
|
1097
|
-
return
|
|
1158
|
+
return Ht(e.bureau) && typeof e.reported_at == "string" && typeof e.categories == "object" && typeof e.attributes == "object";
|
|
1098
1159
|
}
|
|
1099
|
-
function
|
|
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) =>
|
|
1164
|
+
(t) => $e(t)
|
|
1104
1165
|
);
|
|
1105
1166
|
}
|
|
1106
|
-
function
|
|
1167
|
+
function $e(r) {
|
|
1107
1168
|
if (typeof r != "object" || r === null) return !1;
|
|
1108
1169
|
const e = r;
|
|
1109
|
-
return
|
|
1170
|
+
return Ht(e.bureau) && typeof e.reported_at == "string" && typeof e.categories == "object" && typeof e.attributes == "object";
|
|
1110
1171
|
}
|
|
1111
|
-
function
|
|
1172
|
+
function Ht(r) {
|
|
1112
1173
|
return r === "EXPERIAN" || r === "EQUIFAX" || r === "TRANSUNION";
|
|
1113
1174
|
}
|
|
1114
|
-
function
|
|
1175
|
+
function fe(r) {
|
|
1115
1176
|
return typeof r == "object" && r !== null && "items" in r && Array.isArray(r.items) && r.items.every(
|
|
1116
|
-
(e) =>
|
|
1177
|
+
(e) => ge(e)
|
|
1117
1178
|
);
|
|
1118
1179
|
}
|
|
1119
|
-
function
|
|
1120
|
-
return Array.isArray(r) && r.every((e) =>
|
|
1180
|
+
function me(r) {
|
|
1181
|
+
return Array.isArray(r) && r.every((e) => ye(e));
|
|
1121
1182
|
}
|
|
1122
|
-
function
|
|
1123
|
-
return
|
|
1183
|
+
function Le(r) {
|
|
1184
|
+
return me(r);
|
|
1124
1185
|
}
|
|
1125
|
-
function
|
|
1126
|
-
return
|
|
1186
|
+
function Ve(r) {
|
|
1187
|
+
return fe(r);
|
|
1127
1188
|
}
|
|
1189
|
+
const Be = {
|
|
1190
|
+
LOCKED: "LOCKED",
|
|
1191
|
+
UNLOCKED: "UNLOCKED"
|
|
1192
|
+
};
|
|
1128
1193
|
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
|
-
|
|
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
|