@experian-ecs/connected-api-sdk 1.4.0 → 1.6.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 +26 -1
- package/dist/esm/index.mjs +379 -302
- package/dist/esm/index.mjs.map +1 -1
- package/dist/index.d.ts +111 -1
- 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,25 +12,25 @@
|
|
|
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 kt = (r) => {
|
|
17
17
|
throw TypeError(r);
|
|
18
18
|
};
|
|
19
|
-
var
|
|
20
|
-
var h = (r, e, t) =>
|
|
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), ht = (r, e, t) => e.has(r) || kt("Cannot " + t);
|
|
21
|
+
var c = (r, e, t) => (ht(r, e, "read from private field"), t ? t.call(r) : e.get(r)), d = (r, e, t) => e.has(r) ? kt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), J = (r, e, t, n) => (ht(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), y = (r, e, t) => (ht(r, e, "access private method"), t);
|
|
22
|
+
function Ot(r) {
|
|
23
23
|
switch (r.type) {
|
|
24
24
|
case "client_side_error":
|
|
25
|
-
return new
|
|
25
|
+
return new te(r);
|
|
26
26
|
case "authentication_error":
|
|
27
|
-
return new
|
|
27
|
+
return new ee(r);
|
|
28
28
|
case "server_side_error":
|
|
29
|
-
return new
|
|
29
|
+
return new re(r);
|
|
30
30
|
case "rate_limit_error":
|
|
31
|
-
return new
|
|
31
|
+
return new se(r);
|
|
32
32
|
default:
|
|
33
|
-
return new
|
|
33
|
+
return new ne(r);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
class p extends Error {
|
|
@@ -43,33 +43,33 @@ class p extends Error {
|
|
|
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
|
-
h(p, "generateError",
|
|
47
|
-
class
|
|
46
|
+
h(p, "generateError", Ot);
|
|
47
|
+
class te extends p {
|
|
48
48
|
constructor(e) {
|
|
49
49
|
super(e), this.name = "ConnectedSolutionsClientSideError";
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
class
|
|
52
|
+
class ee extends p {
|
|
53
53
|
constructor(e) {
|
|
54
54
|
super(e), this.name = "ConnectedSolutionsClientAuthenticationError";
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
class
|
|
57
|
+
class re extends p {
|
|
58
58
|
constructor(e) {
|
|
59
59
|
super(e), this.name = "ConnectedSolutionsClientServerSideError";
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
class
|
|
62
|
+
class ne extends p {
|
|
63
63
|
constructor(e) {
|
|
64
64
|
super(e), this.name = "ConnectedSolutionsClientSDKError";
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
class
|
|
67
|
+
class se extends p {
|
|
68
68
|
constructor(e) {
|
|
69
69
|
super(e), this.name = "ConnectedSolutionsClientRateLimitError";
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function It(r) {
|
|
73
73
|
switch (r) {
|
|
74
74
|
case "CLIENT_SIDE_ERROR":
|
|
75
75
|
return "client_side_error";
|
|
@@ -83,38 +83,38 @@ function xt(r) {
|
|
|
83
83
|
return "sdk_error";
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function Vt(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 Bt = {
|
|
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
|
+
}, ie = {
|
|
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 L, yt, Dt;
|
|
103
|
+
class g {
|
|
104
104
|
constructor(e) {
|
|
105
|
-
d(this,
|
|
105
|
+
d(this, L);
|
|
106
106
|
h(this, "config");
|
|
107
107
|
h(this, "baseUrl", "");
|
|
108
108
|
h(this, "contentstackUrl", "");
|
|
109
109
|
const n = e.environment ?? "PRODUCTION";
|
|
110
|
-
this.config = e, this.baseUrl =
|
|
110
|
+
this.config = e, this.baseUrl = Bt[n], this.contentstackUrl = ie[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, L, yt).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,7 +137,7 @@ class m {
|
|
|
137
137
|
async fetchRequest(e, t) {
|
|
138
138
|
var n;
|
|
139
139
|
try {
|
|
140
|
-
y(this,
|
|
140
|
+
y(this, L, yt).call(this);
|
|
141
141
|
const s = await fetch(e, t);
|
|
142
142
|
if (!(s != null && s.ok)) {
|
|
143
143
|
let a;
|
|
@@ -147,13 +147,13 @@ class m {
|
|
|
147
147
|
message: s == null ? void 0 : s.statusText
|
|
148
148
|
};
|
|
149
149
|
if ((n = s == null ? void 0 : s.headers.get("content-type")) != null && n.includes("application/json")) {
|
|
150
|
-
const
|
|
151
|
-
u.data =
|
|
150
|
+
const $ = await s.clone().json();
|
|
151
|
+
u.data = $.error, u.type = It($.error.type);
|
|
152
152
|
} else
|
|
153
|
-
u.type =
|
|
153
|
+
u.type = Vt(s == null ? void 0 : s.status);
|
|
154
154
|
throw p.generateError(u);
|
|
155
155
|
}
|
|
156
|
-
return y(this,
|
|
156
|
+
return y(this, L, Dt).call(this, s) ? {
|
|
157
157
|
data: await s.clone().json(),
|
|
158
158
|
error: void 0,
|
|
159
159
|
meta: {
|
|
@@ -181,7 +181,7 @@ class m {
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
|
|
184
|
+
L = new WeakSet(), yt = function() {
|
|
185
185
|
if (!this.config.token) {
|
|
186
186
|
const e = {
|
|
187
187
|
type: "sdk_error",
|
|
@@ -189,18 +189,18 @@ k = new WeakSet(), ut = function() {
|
|
|
189
189
|
};
|
|
190
190
|
throw p.generateError(e);
|
|
191
191
|
}
|
|
192
|
-
},
|
|
192
|
+
}, Dt = 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, $t;
|
|
197
|
+
const Z = class Z extends g {
|
|
198
198
|
constructor(t) {
|
|
199
199
|
super(t);
|
|
200
|
-
d(this,
|
|
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, $t).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() } : {}
|
|
@@ -208,7 +208,7 @@ const Q = class Q extends m {
|
|
|
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, $t).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}`;
|
|
@@ -225,35 +225,35 @@ const Q = class Q extends m {
|
|
|
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
|
-
}, d(
|
|
236
|
-
let
|
|
237
|
-
var
|
|
238
|
-
const
|
|
233
|
+
$t = function(t = "v1") {
|
|
234
|
+
return `/${t}${c(Z, Y)}`;
|
|
235
|
+
}, d(Z, Y, "/credit/scores");
|
|
236
|
+
let gt = Z;
|
|
237
|
+
var m;
|
|
238
|
+
const f = class f extends g {
|
|
239
239
|
constructor(e) {
|
|
240
240
|
super(e);
|
|
241
241
|
}
|
|
242
242
|
async getEntitlements(e, t) {
|
|
243
243
|
return this.fetchWithAuth(
|
|
244
|
-
`${this.baseUrl}${c(
|
|
244
|
+
`${this.baseUrl}${c(f, m)}?customer_id=${e.customer_id}`,
|
|
245
245
|
t
|
|
246
246
|
);
|
|
247
247
|
}
|
|
248
248
|
async getEntitlementById({ entitlement_id: e }, t) {
|
|
249
249
|
return this.fetchWithAuth(
|
|
250
|
-
`${this.baseUrl}${c(
|
|
250
|
+
`${this.baseUrl}${c(f, m)}/${e}`,
|
|
251
251
|
t
|
|
252
252
|
);
|
|
253
253
|
}
|
|
254
254
|
async createEntitlement(e, t) {
|
|
255
255
|
return this.fetchWithAuth(
|
|
256
|
-
`${this.baseUrl}${c(
|
|
256
|
+
`${this.baseUrl}${c(f, m)}`,
|
|
257
257
|
{
|
|
258
258
|
method: "POST",
|
|
259
259
|
headers: {
|
|
@@ -268,7 +268,7 @@ const $ = class $ extends m {
|
|
|
268
268
|
async updateEntitlement(e, t) {
|
|
269
269
|
const { entitlement_id: n, ...s } = e;
|
|
270
270
|
return this.fetchWithAuth(
|
|
271
|
-
`${this.baseUrl}${c(
|
|
271
|
+
`${this.baseUrl}${c(f, m)}/${n}`,
|
|
272
272
|
{
|
|
273
273
|
method: "PUT",
|
|
274
274
|
headers: {
|
|
@@ -282,7 +282,7 @@ const $ = class $ extends m {
|
|
|
282
282
|
}
|
|
283
283
|
async deleteEntitlement({ entitlement_id: e }, t) {
|
|
284
284
|
return this.fetchWithAuth(
|
|
285
|
-
`${this.baseUrl}${c(
|
|
285
|
+
`${this.baseUrl}${c(f, m)}/${e}`,
|
|
286
286
|
{
|
|
287
287
|
method: "DELETE",
|
|
288
288
|
...t ?? {}
|
|
@@ -290,21 +290,21 @@ const $ = class $ extends m {
|
|
|
290
290
|
);
|
|
291
291
|
}
|
|
292
292
|
async activateEntitlement({ entitlement_id: e }, t) {
|
|
293
|
-
const n = `${this.baseUrl}${c(
|
|
293
|
+
const n = `${this.baseUrl}${c(f, m)}/${e}/activate`;
|
|
294
294
|
return this.fetchWithAuth(n, {
|
|
295
295
|
method: "POST",
|
|
296
296
|
...t ?? {}
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
299
|
async deactivateEntitlement({ entitlement_id: e }, t) {
|
|
300
|
-
const n = `${this.baseUrl}${c(
|
|
300
|
+
const n = `${this.baseUrl}${c(f, m)}/${e}/deactivate`;
|
|
301
301
|
return this.fetchWithAuth(n, {
|
|
302
302
|
method: "POST",
|
|
303
303
|
...t ?? {}
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
306
|
async entitleCustomerToNewProduct(e, t) {
|
|
307
|
-
const { product_config_id: n, entitlement_id: s, customer_id: i } = e, o = `${this.baseUrl}${c(
|
|
307
|
+
const { product_config_id: n, entitlement_id: s, customer_id: i } = e, o = `${this.baseUrl}${c(f, m)}/${s}/products/${n}`;
|
|
308
308
|
return this.fetchWithAuth(o, {
|
|
309
309
|
method: "POST",
|
|
310
310
|
...t ?? {},
|
|
@@ -315,55 +315,55 @@ const $ = class $ extends m {
|
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
317
|
async activateProduct(e, t) {
|
|
318
|
-
const { product_config_id: n, entitlement_id: s } = e, i = `${this.baseUrl}${c(
|
|
318
|
+
const { product_config_id: n, entitlement_id: s } = e, i = `${this.baseUrl}${c(f, m)}/${s}/products/${n}/activate`;
|
|
319
319
|
return this.fetchWithAuth(i, {
|
|
320
320
|
method: "POST",
|
|
321
321
|
...t ?? {}
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
async deactivateProduct(e, t) {
|
|
325
|
-
const { product_config_id: n, entitlement_id: s } = e, i = `${this.baseUrl}${c(
|
|
325
|
+
const { product_config_id: n, entitlement_id: s } = e, i = `${this.baseUrl}${c(f, m)}/${s}/products/${n}/deactivate`;
|
|
326
326
|
return this.fetchWithAuth(i, {
|
|
327
327
|
method: "POST",
|
|
328
328
|
...t ?? {}
|
|
329
329
|
});
|
|
330
330
|
}
|
|
331
331
|
async removeProductFromEntitlement(e, t) {
|
|
332
|
-
const { product_config_id: n, entitlement_id: s } = e, i = `${this.baseUrl}${c(
|
|
332
|
+
const { product_config_id: n, entitlement_id: s } = e, i = `${this.baseUrl}${c(f, m)}/${s}/products/${n}`;
|
|
333
333
|
return this.fetchWithAuth(i, {
|
|
334
334
|
method: "DELETE",
|
|
335
335
|
...t ?? {}
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
async getProductEligibility(e, t) {
|
|
339
|
-
const n = new URLSearchParams(e).toString(), s = `${this.baseUrl}${c(
|
|
339
|
+
const n = new URLSearchParams(e).toString(), s = `${this.baseUrl}${c(f, m)}/eligibility?${n}`;
|
|
340
340
|
return this.fetchWithAuth(s, t);
|
|
341
341
|
}
|
|
342
342
|
};
|
|
343
|
-
|
|
344
|
-
let
|
|
345
|
-
var
|
|
346
|
-
const
|
|
343
|
+
m = new WeakMap(), d(f, m, "/v1/entitlements");
|
|
344
|
+
let ft = f;
|
|
345
|
+
var q, O, Jt;
|
|
346
|
+
const tt = class tt extends g {
|
|
347
347
|
constructor(t) {
|
|
348
348
|
super(t);
|
|
349
|
-
d(this,
|
|
349
|
+
d(this, O);
|
|
350
350
|
}
|
|
351
351
|
async getCreditAttributes(t, n) {
|
|
352
|
-
const s = t == null ? void 0 : t.version, i = y(this,
|
|
352
|
+
const s = t == null ? void 0 : t.version, i = y(this, O, Jt).call(this, s), o = `${this.baseUrl}${i}`;
|
|
353
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
|
-
}, d(
|
|
364
|
-
let
|
|
365
|
-
var
|
|
366
|
-
const
|
|
361
|
+
Jt = function(t = "v1") {
|
|
362
|
+
return `/${t}${c(tt, q)}`;
|
|
363
|
+
}, d(tt, q, "/credit/attributes");
|
|
364
|
+
let mt = tt;
|
|
365
|
+
var H;
|
|
366
|
+
const F = class F extends g {
|
|
367
367
|
constructor(e) {
|
|
368
368
|
super(e);
|
|
369
369
|
}
|
|
@@ -371,13 +371,13 @@ const D = class D extends m {
|
|
|
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}` : "", o = `${this.baseUrl}${c(
|
|
374
|
+
}, s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", o = `${this.baseUrl}${c(F, H)}${i}`;
|
|
375
375
|
return this.fetchWithAuth(o, t);
|
|
376
376
|
}
|
|
377
377
|
async simulateScenario(e, t) {
|
|
378
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,21 +390,21 @@ const D = class D extends m {
|
|
|
390
390
|
);
|
|
391
391
|
}
|
|
392
392
|
};
|
|
393
|
-
|
|
394
|
-
let
|
|
395
|
-
var j,
|
|
396
|
-
const
|
|
393
|
+
H = new WeakMap(), d(F, H, "/v1/credit/tools/simulator");
|
|
394
|
+
let bt = F;
|
|
395
|
+
var j, et;
|
|
396
|
+
const U = class U extends g {
|
|
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(U, 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(), o = i ? `?${i}` : "", a = `${this.baseUrl}${c(
|
|
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
408
|
return this.fetchWithAuth(a, {
|
|
409
409
|
method: "POST",
|
|
410
410
|
headers: {
|
|
@@ -416,14 +416,14 @@ const P = class P extends m {
|
|
|
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(U, 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(), o = i ? `?${i}` : "", a = `${this.baseUrl}${c(
|
|
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
427
|
return this.fetchWithAuth(a, {
|
|
428
428
|
method: "POST",
|
|
429
429
|
body: JSON.stringify(s),
|
|
@@ -435,10 +435,10 @@ const P = class P extends m {
|
|
|
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 _t = U;
|
|
440
|
+
var k;
|
|
441
|
+
const x = class x extends g {
|
|
442
442
|
constructor(e) {
|
|
443
443
|
super(e);
|
|
444
444
|
}
|
|
@@ -447,76 +447,76 @@ const W = class W extends m {
|
|
|
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 St = x;
|
|
471
|
+
function Ft(r) {
|
|
472
472
|
return !(r != null && r.version) || (r == null ? void 0 : r.version) === "v1";
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function ce(r) {
|
|
475
475
|
return (r == null ? void 0 : r.version) === "v2";
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
return r !== void 0 &&
|
|
477
|
+
function Lt(r) {
|
|
478
|
+
return r !== void 0 && Ft(r) && "include_fields" in r && typeof r.include_fields == "string";
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
return r !== void 0 &&
|
|
480
|
+
function oe(r) {
|
|
481
|
+
return r !== void 0 && Ft(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 ae(r) {
|
|
484
|
+
return r !== void 0 && ce(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, E, W;
|
|
487
|
+
const nt = class nt extends g {
|
|
488
488
|
constructor(t) {
|
|
489
489
|
super(t);
|
|
490
|
-
d(this,
|
|
490
|
+
d(this, E);
|
|
491
491
|
}
|
|
492
492
|
async getReports(t, n) {
|
|
493
|
-
const s = t == null ? void 0 : t.version, i = y(this,
|
|
494
|
-
|
|
493
|
+
const s = t == null ? void 0 : t.version, i = y(this, E, W).call(this, s), o = {};
|
|
494
|
+
oe(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())), ae(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
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, o = y(this,
|
|
500
|
-
|
|
501
|
-
const u = new URLSearchParams(a).toString(), l = u ? `?${u}` : "",
|
|
502
|
-
return this.fetchWithAuth(
|
|
499
|
+
const { id: s, version: i } = t, o = y(this, E, W).call(this, i), a = {};
|
|
500
|
+
Lt(t) && (a.include_fields = t.include_fields.toString());
|
|
501
|
+
const u = new URLSearchParams(a).toString(), l = u ? `?${u}` : "", $ = `${this.baseUrl}${o}/${s}${l}`;
|
|
502
|
+
return this.fetchWithAuth($, n);
|
|
503
503
|
}
|
|
504
504
|
async getReportsMeta(t, n) {
|
|
505
|
-
const { version: s, latest_only: i, report_read: o, ...a } = t ?? {}, u = y(this,
|
|
505
|
+
const { version: s, latest_only: i, report_read: o, ...a } = t ?? {}, u = y(this, E, W).call(this, s), l = {
|
|
506
506
|
...a ?? {},
|
|
507
507
|
...i ? { latest_only: i.toString() } : {},
|
|
508
508
|
...o ? { report_read: o.toString() } : {}
|
|
509
|
-
},
|
|
510
|
-
return this.fetchWithAuth(
|
|
509
|
+
}, $ = new URLSearchParams(l).toString(), T = $ ? `?${$}` : "", dt = `${this.baseUrl}${u}/meta${T}`;
|
|
510
|
+
return this.fetchWithAuth(dt, n);
|
|
511
511
|
}
|
|
512
512
|
async getReportMetaById(t, n) {
|
|
513
|
-
const { id: s, version: i, ...o } = t, a = y(this,
|
|
514
|
-
return this.fetchWithAuth(
|
|
513
|
+
const { id: s, version: i, ...o } = t, a = y(this, E, W).call(this, i), u = new URLSearchParams(o).toString(), l = u ? `?${u}` : "", $ = `${this.baseUrl}${a}/${s}/meta${l}`;
|
|
514
|
+
return this.fetchWithAuth($, n);
|
|
515
515
|
}
|
|
516
516
|
async markReportAsRead(t, n) {
|
|
517
|
-
const { id: s, version: i } = t, o = y(this,
|
|
517
|
+
const { id: s, version: i } = t, o = y(this, E, W).call(this, i), a = `${this.baseUrl}${o}`;
|
|
518
518
|
if (i === "v2") {
|
|
519
|
-
const l = `${a}/${s}/disposition`,
|
|
519
|
+
const l = `${a}/${s}/disposition`, $ = t;
|
|
520
520
|
return this.fetchWithAuth(l, {
|
|
521
521
|
method: "PATCH",
|
|
522
522
|
headers: {
|
|
@@ -524,7 +524,7 @@ const et = class et extends m {
|
|
|
524
524
|
"Content-Type": "application/json"
|
|
525
525
|
},
|
|
526
526
|
body: JSON.stringify({
|
|
527
|
-
disposition:
|
|
527
|
+
disposition: $.disposition
|
|
528
528
|
}),
|
|
529
529
|
...n ?? {}
|
|
530
530
|
});
|
|
@@ -536,8 +536,8 @@ const et = class et extends m {
|
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
538
|
async orderReport(t, n) {
|
|
539
|
-
const s = {}, i = t == null ? void 0 : t.version, o = y(this,
|
|
540
|
-
|
|
539
|
+
const s = {}, i = t == null ? void 0 : t.version, o = y(this, E, W).call(this, i);
|
|
540
|
+
Lt(t) && (s.include_fields = t.include_fields.toString());
|
|
541
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",
|
|
@@ -552,17 +552,17 @@ const et = class et extends m {
|
|
|
552
552
|
});
|
|
553
553
|
}
|
|
554
554
|
};
|
|
555
|
-
|
|
555
|
+
rt = new WeakMap(), E = 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
|
-
}, d(
|
|
563
|
-
let
|
|
560
|
+
W = function(t = "v1") {
|
|
561
|
+
return `/${t}${c(nt, rt)}`;
|
|
562
|
+
}, d(nt, rt, "/credit/reports");
|
|
563
|
+
let At = nt;
|
|
564
564
|
var w;
|
|
565
|
-
const R = class R extends
|
|
565
|
+
const R = class R extends g {
|
|
566
566
|
constructor(e) {
|
|
567
567
|
super(e);
|
|
568
568
|
}
|
|
@@ -615,18 +615,18 @@ const R = class R extends m {
|
|
|
615
615
|
}
|
|
616
616
|
};
|
|
617
617
|
w = new WeakMap(), d(R, w, "/v1/customers");
|
|
618
|
-
let
|
|
619
|
-
var
|
|
620
|
-
const
|
|
618
|
+
let Tt = R;
|
|
619
|
+
var X;
|
|
620
|
+
const K = class K extends g {
|
|
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 J = class J extends m {
|
|
|
638
638
|
});
|
|
639
639
|
}
|
|
640
640
|
};
|
|
641
|
-
|
|
642
|
-
let
|
|
643
|
-
var
|
|
644
|
-
const
|
|
641
|
+
X = new WeakMap(), d(K, X, "/v1/authentication");
|
|
642
|
+
let pt = K;
|
|
643
|
+
var st;
|
|
644
|
+
const it = class it extends g {
|
|
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,52 +658,52 @@ const nt = class nt extends m {
|
|
|
658
658
|
});
|
|
659
659
|
}
|
|
660
660
|
};
|
|
661
|
-
|
|
662
|
-
let
|
|
663
|
-
var
|
|
664
|
-
const
|
|
661
|
+
st = new WeakMap(), d(it, st, "/v1/registrations");
|
|
662
|
+
let Ut = it;
|
|
663
|
+
var ct, z, Ct;
|
|
664
|
+
const ot = class ot extends g {
|
|
665
665
|
constructor(t) {
|
|
666
666
|
super(t);
|
|
667
|
-
d(this,
|
|
667
|
+
d(this, z);
|
|
668
668
|
}
|
|
669
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,
|
|
671
|
-
i(t).filter(([
|
|
672
|
-
|
|
673
|
-
o(
|
|
670
|
+
const { fromEntries: s, entries: i } = Object, { isArray: o } = Array, a = t == null ? void 0 : t.version, u = y(this, z, Ct).call(this, a), { version: l, ...$ } = s(
|
|
671
|
+
i(t).filter(([jt, I]) => I != null).map(([jt, I]) => [
|
|
672
|
+
jt,
|
|
673
|
+
o(I) ? I.join(",") : I.toString()
|
|
674
674
|
])
|
|
675
|
-
), T = new URLSearchParams(
|
|
676
|
-
return this.fetchWithAuth(
|
|
675
|
+
), T = new URLSearchParams($).toString(), dt = T ? `?${T}` : "", Yt = `${this.baseUrl}${u}${dt}`;
|
|
676
|
+
return this.fetchWithAuth(Yt, {
|
|
677
677
|
...n || {}
|
|
678
678
|
});
|
|
679
679
|
}
|
|
680
680
|
async getProductConfigById(t, n) {
|
|
681
|
-
const s = t == null ? void 0 : t.version, i = y(this,
|
|
681
|
+
const s = t == null ? void 0 : t.version, i = y(this, z, Ct).call(this, s), o = `${this.baseUrl}${i}/${t.product_config_id}`;
|
|
682
682
|
return this.fetchWithAuth(o, {
|
|
683
683
|
...n ?? {}
|
|
684
684
|
});
|
|
685
685
|
}
|
|
686
686
|
};
|
|
687
|
-
|
|
687
|
+
ct = new WeakMap(), z = new WeakSet(), /**
|
|
688
688
|
* Get the versioned API path for Product Config.
|
|
689
689
|
* @param version The API version to use.
|
|
690
690
|
* @returns The versioned API path.
|
|
691
691
|
*/
|
|
692
|
-
|
|
693
|
-
return `/${t}${c(
|
|
694
|
-
}, d(
|
|
695
|
-
let
|
|
696
|
-
var
|
|
697
|
-
const
|
|
692
|
+
Ct = function(t = "v1") {
|
|
693
|
+
return `/${t}${c(ot, ct)}`;
|
|
694
|
+
}, d(ot, ct, "/product-configs");
|
|
695
|
+
let Pt = ot;
|
|
696
|
+
var v;
|
|
697
|
+
const P = class P extends g {
|
|
698
698
|
constructor(e) {
|
|
699
699
|
super(e);
|
|
700
700
|
}
|
|
701
701
|
async getSurvey(e) {
|
|
702
|
-
const t = `${this.baseUrl}${c(
|
|
702
|
+
const t = `${this.baseUrl}${c(P, v)}/surveys`;
|
|
703
703
|
return this.fetchWithAuth(t, e);
|
|
704
704
|
}
|
|
705
705
|
async submitSurvey(e, t) {
|
|
706
|
-
const n = `${this.baseUrl}${c(
|
|
706
|
+
const n = `${this.baseUrl}${c(P, v)}/surveys`;
|
|
707
707
|
return this.fetchWithAuth(n, {
|
|
708
708
|
method: "POST",
|
|
709
709
|
headers: {
|
|
@@ -715,7 +715,7 @@ const U = class U extends m {
|
|
|
715
715
|
});
|
|
716
716
|
}
|
|
717
717
|
async getScore(e) {
|
|
718
|
-
const t = `${this.baseUrl}${c(
|
|
718
|
+
const t = `${this.baseUrl}${c(P, v)}/scores?latest=TRUE`;
|
|
719
719
|
return this.fetchWithAuth(t, e);
|
|
720
720
|
}
|
|
721
721
|
async getPlan(e, t) {
|
|
@@ -723,11 +723,11 @@ const U = class U extends m {
|
|
|
723
723
|
action_status: e.action_status,
|
|
724
724
|
...e.cursor ? { cursor: e.cursor } : {},
|
|
725
725
|
...e.count ? { count: e.count.toString() } : {}
|
|
726
|
-
}, s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", o = `${this.baseUrl}${c(
|
|
726
|
+
}, s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", o = `${this.baseUrl}${c(P, v)}/plans${i}`;
|
|
727
727
|
return this.fetchWithAuth(o, t);
|
|
728
728
|
}
|
|
729
729
|
async createPlan(e) {
|
|
730
|
-
const t = `${this.baseUrl}${c(
|
|
730
|
+
const t = `${this.baseUrl}${c(P, v)}/plans`;
|
|
731
731
|
return this.fetchWithAuth(t, {
|
|
732
732
|
method: "POST",
|
|
733
733
|
headers: {
|
|
@@ -739,7 +739,7 @@ const U = class U extends m {
|
|
|
739
739
|
});
|
|
740
740
|
}
|
|
741
741
|
async updateAction(e, t) {
|
|
742
|
-
const { action_id: n, ...s } = e, i = `${this.baseUrl}${c(
|
|
742
|
+
const { action_id: n, ...s } = e, i = `${this.baseUrl}${c(P, v)}/plans/actions/${n}`;
|
|
743
743
|
return this.fetchWithAuth(i, {
|
|
744
744
|
method: "PUT",
|
|
745
745
|
headers: {
|
|
@@ -751,10 +751,10 @@ const U = class U extends m {
|
|
|
751
751
|
});
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
|
-
|
|
755
|
-
let
|
|
754
|
+
v = new WeakMap(), d(P, v, "/v1/ihs");
|
|
755
|
+
let Et = P;
|
|
756
756
|
var _;
|
|
757
|
-
const b = class b extends
|
|
757
|
+
const b = class b extends g {
|
|
758
758
|
constructor(e) {
|
|
759
759
|
super(e);
|
|
760
760
|
}
|
|
@@ -855,49 +855,119 @@ const b = class b extends m {
|
|
|
855
855
|
}
|
|
856
856
|
};
|
|
857
857
|
_ = new WeakMap(), d(b, _, "/v1/dim");
|
|
858
|
-
let
|
|
859
|
-
|
|
858
|
+
let vt = b;
|
|
859
|
+
var B;
|
|
860
|
+
const V = class V extends g {
|
|
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 Rt = V;
|
|
910
|
+
var at;
|
|
911
|
+
const ut = class ut extends g {
|
|
912
|
+
constructor(e) {
|
|
913
|
+
super(e);
|
|
914
|
+
}
|
|
915
|
+
async getOffers(e, t) {
|
|
916
|
+
const n = new URLSearchParams(
|
|
917
|
+
Object.entries(e).filter(([, i]) => i != null).map(([i, o]) => [i, o.toString()])
|
|
918
|
+
).toString(), s = n ? `?${n}` : "";
|
|
919
|
+
return this.fetchWithAuth(
|
|
920
|
+
`${this.baseUrl}${c(ut, at)}${s}`,
|
|
921
|
+
t
|
|
922
|
+
);
|
|
923
|
+
}
|
|
924
|
+
};
|
|
925
|
+
at = new WeakMap(), d(ut, at, "/v1/offers/credit-cards");
|
|
926
|
+
let wt = ut;
|
|
927
|
+
const lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
860
928
|
__proto__: null,
|
|
861
|
-
AlertsService:
|
|
862
|
-
CreditAttributesService:
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
929
|
+
AlertsService: St,
|
|
930
|
+
CreditAttributesService: mt,
|
|
931
|
+
CreditLockUnlockService: Rt,
|
|
932
|
+
CreditReportsService: At,
|
|
933
|
+
CreditScorePlannerService: _t,
|
|
934
|
+
CreditScoreSimulatorService: bt,
|
|
935
|
+
CreditScoresService: gt,
|
|
936
|
+
CustomerAuthService: pt,
|
|
937
|
+
CustomersService: Tt,
|
|
938
|
+
DigitalIdentityManagerService: vt,
|
|
939
|
+
EntitlementsService: ft,
|
|
940
|
+
IdentityHealthScoreService: Et,
|
|
941
|
+
OffersService: wt,
|
|
942
|
+
ProductConfigsService: Pt,
|
|
943
|
+
RegistrationsService: Ut
|
|
874
944
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
875
|
-
function
|
|
945
|
+
function ue(r) {
|
|
876
946
|
return `${r[0].toLowerCase()}${r.substring(1)}`.replace(
|
|
877
947
|
"Service",
|
|
878
948
|
""
|
|
879
949
|
);
|
|
880
950
|
}
|
|
881
|
-
const
|
|
882
|
-
var S,
|
|
883
|
-
const
|
|
951
|
+
const de = typeof process < "u" && process.versions && process.versions.node && typeof window > "u";
|
|
952
|
+
var S, D, Q, A, Kt, Wt, Gt, Mt;
|
|
953
|
+
const G = class G {
|
|
884
954
|
constructor(e) {
|
|
885
955
|
d(this, A);
|
|
886
956
|
h(this, "config");
|
|
887
957
|
d(this, S);
|
|
888
|
-
d(this,
|
|
958
|
+
d(this, D, null);
|
|
889
959
|
h(this, "baseUrl", "");
|
|
890
|
-
this.config = e, this.baseUrl =
|
|
960
|
+
this.config = e, this.baseUrl = Bt[e.environment ?? "PRODUCTION"], J(this, S, /* @__PURE__ */ new Map());
|
|
891
961
|
}
|
|
892
962
|
async getAccessToken(e) {
|
|
893
|
-
if (!
|
|
963
|
+
if (!de)
|
|
894
964
|
throw p.generateError({
|
|
895
965
|
type: "sdk_error",
|
|
896
966
|
message: "getAccessToken is not supported in browser"
|
|
897
967
|
});
|
|
898
968
|
try {
|
|
899
969
|
return {
|
|
900
|
-
data: await y(this, A,
|
|
970
|
+
data: await y(this, A, Kt).call(this, e),
|
|
901
971
|
errors: void 0,
|
|
902
972
|
meta: {
|
|
903
973
|
status: 200,
|
|
@@ -919,22 +989,22 @@ const F = class F {
|
|
|
919
989
|
return c(this, S).size;
|
|
920
990
|
}
|
|
921
991
|
clearCache() {
|
|
922
|
-
const e = `${this.baseUrl}${c(
|
|
992
|
+
const e = `${this.baseUrl}${c(G, Q)}`, t = Array.from(c(this, S).keys()).filter(
|
|
923
993
|
(n) => n.includes(e)
|
|
924
994
|
);
|
|
925
995
|
for (const n of t)
|
|
926
996
|
c(this, S).delete(n);
|
|
927
997
|
}
|
|
928
998
|
};
|
|
929
|
-
S = new WeakMap(),
|
|
999
|
+
S = new WeakMap(), D = new WeakMap(), Q = new WeakMap(), A = new WeakSet(), Kt = async function({
|
|
930
1000
|
grantType: e,
|
|
931
1001
|
clientId: t,
|
|
932
1002
|
clientSecret: n,
|
|
933
1003
|
customerId: s
|
|
934
1004
|
}) {
|
|
935
1005
|
var l;
|
|
936
|
-
y(this, A,
|
|
937
|
-
const i = `${this.baseUrl}${c(
|
|
1006
|
+
y(this, A, Gt).call(this);
|
|
1007
|
+
const i = `${this.baseUrl}${c(G, Q)}`, o = {
|
|
938
1008
|
method: "POST",
|
|
939
1009
|
headers: { "content-type": "application/json" },
|
|
940
1010
|
credentials: "include",
|
|
@@ -944,10 +1014,10 @@ S = new WeakMap(), V = new WeakMap(), X = new WeakMap(), A = new WeakSet(), Lt =
|
|
|
944
1014
|
client_secret: n,
|
|
945
1015
|
...e === "trusted_partner" ? { partner_customer_id: s ?? "" } : {}
|
|
946
1016
|
})
|
|
947
|
-
}, a = await y(this, A,
|
|
1017
|
+
}, a = await y(this, A, Mt).call(this, i, o);
|
|
948
1018
|
if (a != null && a.ok) {
|
|
949
1019
|
const T = await a.clone().json();
|
|
950
|
-
return c(this,
|
|
1020
|
+
return c(this, D) === null && y(this, A, Wt).call(this, T.expires_in), T;
|
|
951
1021
|
}
|
|
952
1022
|
const u = {
|
|
953
1023
|
type: "sdk_error",
|
|
@@ -958,30 +1028,30 @@ S = new WeakMap(), V = new WeakMap(), X = new WeakMap(), A = new WeakSet(), Lt =
|
|
|
958
1028
|
};
|
|
959
1029
|
if ((l = a == null ? void 0 : a.headers.get("content-type")) != null && l.includes("application/json")) {
|
|
960
1030
|
const T = await a.clone().json();
|
|
961
|
-
u.data = T.error, u.type =
|
|
1031
|
+
u.data = T.error, u.type = It(T.error.type);
|
|
962
1032
|
} else
|
|
963
|
-
u.type =
|
|
1033
|
+
u.type = Vt(a == null ? void 0 : a.status);
|
|
964
1034
|
throw p.generateError(u);
|
|
965
|
-
},
|
|
1035
|
+
}, Wt = function(e) {
|
|
966
1036
|
const t = (/* @__PURE__ */ new Date()).getTime(), n = 60 * 60 * 1e3, s = t + n, i = e === null ? e : new Date(s).valueOf();
|
|
967
|
-
|
|
968
|
-
},
|
|
969
|
-
const e = new Date(Date.now()), t = new Date(c(this,
|
|
970
|
-
|
|
971
|
-
},
|
|
1037
|
+
J(this, D, i);
|
|
1038
|
+
}, Gt = function() {
|
|
1039
|
+
const e = new Date(Date.now()), t = new Date(c(this, D) ?? Number.NaN);
|
|
1040
|
+
he(e, t) && (y(this, A, Wt).call(this, null), c(this, S).clear());
|
|
1041
|
+
}, Mt = async function(e, t) {
|
|
972
1042
|
const n = `${e}${JSON.stringify(t || {})}`;
|
|
973
1043
|
if (!c(this, S).has(n)) {
|
|
974
1044
|
const s = fetch(e, t ?? {});
|
|
975
1045
|
c(this, S).set(n, s);
|
|
976
1046
|
}
|
|
977
1047
|
return await c(this, S).get(n);
|
|
978
|
-
}, d(
|
|
979
|
-
let
|
|
980
|
-
function
|
|
1048
|
+
}, d(G, Q, "/v1/oauth2/token");
|
|
1049
|
+
let Nt = G;
|
|
1050
|
+
function he(r, e) {
|
|
981
1051
|
return r > e;
|
|
982
1052
|
}
|
|
983
|
-
var
|
|
984
|
-
const
|
|
1053
|
+
var N;
|
|
1054
|
+
const C = class C extends g {
|
|
985
1055
|
// constructor is private so that no other class can access it.
|
|
986
1056
|
constructor(t) {
|
|
987
1057
|
super(t);
|
|
@@ -999,182 +1069,189 @@ const v = class v extends m {
|
|
|
999
1069
|
h(this, "registrations");
|
|
1000
1070
|
h(this, "identityHealthScore");
|
|
1001
1071
|
h(this, "digitalIdentityManager");
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1072
|
+
h(this, "creditLockUnlock");
|
|
1073
|
+
h(this, "offers");
|
|
1074
|
+
for (const n in lt)
|
|
1075
|
+
typeof lt[n] == "function" && (this[ue(n)] = new lt[n](t));
|
|
1076
|
+
this.auth = new Nt({
|
|
1005
1077
|
environment: t.environment
|
|
1006
1078
|
});
|
|
1007
1079
|
}
|
|
1008
1080
|
// new services go here
|
|
1009
1081
|
// The method is static as we need to access the method only through the class here
|
|
1010
1082
|
static getInstance(t) {
|
|
1011
|
-
return c(
|
|
1083
|
+
return c(C, N) || J(C, N, new C(t)), c(C, N);
|
|
1012
1084
|
}
|
|
1013
1085
|
static clearInstance() {
|
|
1014
|
-
|
|
1086
|
+
J(C, N, null);
|
|
1015
1087
|
}
|
|
1016
1088
|
};
|
|
1017
|
-
|
|
1018
|
-
let
|
|
1019
|
-
function
|
|
1020
|
-
return
|
|
1089
|
+
N = new WeakMap(), d(C, N, null);
|
|
1090
|
+
let xt = C;
|
|
1091
|
+
function Te(r) {
|
|
1092
|
+
return xt.getInstance(r);
|
|
1021
1093
|
}
|
|
1022
|
-
function
|
|
1094
|
+
function le(r) {
|
|
1023
1095
|
return r.progress_status === "TARGET_NOT_MET" || r.progress_status === "COMPLETED";
|
|
1024
1096
|
}
|
|
1025
|
-
function
|
|
1026
|
-
return
|
|
1097
|
+
function pe(r) {
|
|
1098
|
+
return le(r) || r.progress_status === "TARGET_SCORE_AND_PLAN_SET" || r.progress_status === "ON_TRACK" || r.progress_status === "OFF_TRACK";
|
|
1027
1099
|
}
|
|
1028
|
-
function
|
|
1100
|
+
function Ue(r) {
|
|
1029
1101
|
return r.score_model.includes("VANTAGE");
|
|
1030
1102
|
}
|
|
1031
|
-
function
|
|
1103
|
+
function Pe(r) {
|
|
1032
1104
|
return r.score_model.includes("FICO");
|
|
1033
1105
|
}
|
|
1034
|
-
function
|
|
1106
|
+
function Ce(r) {
|
|
1035
1107
|
return r.target_score !== void 0;
|
|
1036
1108
|
}
|
|
1037
|
-
function
|
|
1109
|
+
function Ee(r) {
|
|
1038
1110
|
return r.max_actions_per_plan !== void 0;
|
|
1039
1111
|
}
|
|
1040
|
-
function
|
|
1112
|
+
function ve(r) {
|
|
1041
1113
|
return r.score_model.includes("FICO");
|
|
1042
1114
|
}
|
|
1043
|
-
function
|
|
1115
|
+
function Re(r) {
|
|
1044
1116
|
return r.score_model.includes("VANTAGE");
|
|
1045
1117
|
}
|
|
1046
|
-
function
|
|
1118
|
+
function we(r) {
|
|
1047
1119
|
return !!(r && "best_action" in r);
|
|
1048
1120
|
}
|
|
1049
|
-
function
|
|
1121
|
+
function Ne(r) {
|
|
1050
1122
|
return !!(r && "simulated_score" in r);
|
|
1051
1123
|
}
|
|
1052
|
-
function
|
|
1124
|
+
function We(r) {
|
|
1053
1125
|
return !("simulated_score" in r);
|
|
1054
1126
|
}
|
|
1055
|
-
function
|
|
1127
|
+
function xe(r) {
|
|
1056
1128
|
return !!(r && "slider_min_value" in r && "slider_max_value" in r);
|
|
1057
1129
|
}
|
|
1058
|
-
function
|
|
1130
|
+
function je(r) {
|
|
1059
1131
|
return !!(r && "value" in r && "simulated_score" in r);
|
|
1060
1132
|
}
|
|
1061
|
-
function
|
|
1133
|
+
function ke(r) {
|
|
1062
1134
|
return r === "v1" || r === "v2";
|
|
1063
1135
|
}
|
|
1064
|
-
function
|
|
1136
|
+
function Ht(r) {
|
|
1065
1137
|
if (typeof r != "object" || r === null) return !1;
|
|
1066
1138
|
const e = r;
|
|
1067
|
-
return typeof e.score_id == "string" &&
|
|
1139
|
+
return typeof e.score_id == "string" && zt(e.bureau) && typeof e.score == "number" && typeof e.score_date == "string";
|
|
1068
1140
|
}
|
|
1069
|
-
function
|
|
1141
|
+
function Xt(r) {
|
|
1070
1142
|
if (typeof r != "object" || r === null) return !1;
|
|
1071
1143
|
const e = r;
|
|
1072
|
-
return typeof e.id == "string" && Array.isArray(e.bureau_scores) && e.bureau_scores.every((t) =>
|
|
1144
|
+
return typeof e.id == "string" && Array.isArray(e.bureau_scores) && e.bureau_scores.every((t) => ye(t));
|
|
1073
1145
|
}
|
|
1074
|
-
function
|
|
1146
|
+
function ye(r) {
|
|
1075
1147
|
if (typeof r != "object" || r === null) return !1;
|
|
1076
1148
|
const e = r;
|
|
1077
|
-
return
|
|
1149
|
+
return zt(e.bureau) && typeof e.score == "number" && typeof e.score_date == "string";
|
|
1078
1150
|
}
|
|
1079
|
-
function
|
|
1151
|
+
function zt(r) {
|
|
1080
1152
|
return r === "EXPERIAN" || r === "EQUIFAX" || r === "TRANSUNION";
|
|
1081
1153
|
}
|
|
1082
|
-
function
|
|
1154
|
+
function ge(r) {
|
|
1083
1155
|
return typeof r == "object" && r !== null && "items" in r && Array.isArray(r.items) && r.items.every(
|
|
1084
|
-
(e) =>
|
|
1156
|
+
(e) => Xt(e)
|
|
1085
1157
|
);
|
|
1086
1158
|
}
|
|
1087
|
-
function
|
|
1088
|
-
return Array.isArray(r) && r.every((e) =>
|
|
1159
|
+
function $e(r) {
|
|
1160
|
+
return Array.isArray(r) && r.every((e) => Ht(e));
|
|
1089
1161
|
}
|
|
1090
|
-
function
|
|
1091
|
-
return
|
|
1162
|
+
function Le(r) {
|
|
1163
|
+
return $e(r);
|
|
1092
1164
|
}
|
|
1093
|
-
function
|
|
1094
|
-
return
|
|
1165
|
+
function Ie(r) {
|
|
1166
|
+
return ge(r);
|
|
1095
1167
|
}
|
|
1096
|
-
function
|
|
1097
|
-
return
|
|
1168
|
+
function Ve(r) {
|
|
1169
|
+
return Ht(r);
|
|
1098
1170
|
}
|
|
1099
|
-
function
|
|
1100
|
-
return
|
|
1171
|
+
function Be(r) {
|
|
1172
|
+
return Xt(r);
|
|
1101
1173
|
}
|
|
1102
|
-
function
|
|
1174
|
+
function fe(r) {
|
|
1103
1175
|
if (typeof r != "object" || r === null) return !1;
|
|
1104
1176
|
const e = r;
|
|
1105
|
-
return
|
|
1177
|
+
return Qt(e.bureau) && typeof e.reported_at == "string" && typeof e.categories == "object" && typeof e.attributes == "object";
|
|
1106
1178
|
}
|
|
1107
|
-
function
|
|
1179
|
+
function me(r) {
|
|
1108
1180
|
if (typeof r != "object" || r === null) return !1;
|
|
1109
1181
|
const e = r;
|
|
1110
1182
|
return typeof e.id == "string" && Array.isArray(e.bureau_attributes) && e.bureau_attributes.every(
|
|
1111
|
-
(t) =>
|
|
1183
|
+
(t) => be(t)
|
|
1112
1184
|
);
|
|
1113
1185
|
}
|
|
1114
|
-
function
|
|
1186
|
+
function be(r) {
|
|
1115
1187
|
if (typeof r != "object" || r === null) return !1;
|
|
1116
1188
|
const e = r;
|
|
1117
|
-
return
|
|
1189
|
+
return Qt(e.bureau) && typeof e.reported_at == "string" && typeof e.categories == "object" && typeof e.attributes == "object";
|
|
1118
1190
|
}
|
|
1119
|
-
function
|
|
1191
|
+
function Qt(r) {
|
|
1120
1192
|
return r === "EXPERIAN" || r === "EQUIFAX" || r === "TRANSUNION";
|
|
1121
1193
|
}
|
|
1122
|
-
function
|
|
1194
|
+
function _e(r) {
|
|
1123
1195
|
return typeof r == "object" && r !== null && "items" in r && Array.isArray(r.items) && r.items.every(
|
|
1124
|
-
(e) =>
|
|
1196
|
+
(e) => me(e)
|
|
1125
1197
|
);
|
|
1126
1198
|
}
|
|
1127
|
-
function
|
|
1128
|
-
return Array.isArray(r) && r.every((e) =>
|
|
1199
|
+
function Se(r) {
|
|
1200
|
+
return Array.isArray(r) && r.every((e) => fe(e));
|
|
1129
1201
|
}
|
|
1130
|
-
function
|
|
1131
|
-
return
|
|
1202
|
+
function De(r) {
|
|
1203
|
+
return Se(r);
|
|
1132
1204
|
}
|
|
1133
|
-
function
|
|
1134
|
-
return
|
|
1205
|
+
function Je(r) {
|
|
1206
|
+
return _e(r);
|
|
1135
1207
|
}
|
|
1208
|
+
const Fe = {
|
|
1209
|
+
LOCKED: "LOCKED",
|
|
1210
|
+
UNLOCKED: "UNLOCKED"
|
|
1211
|
+
};
|
|
1136
1212
|
export {
|
|
1137
|
-
|
|
1213
|
+
ee as ConnectedSolutionsClientAuthenticationError,
|
|
1138
1214
|
p as ConnectedSolutionsClientError,
|
|
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
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1215
|
+
se as ConnectedSolutionsClientRateLimitError,
|
|
1216
|
+
ne as ConnectedSolutionsClientSDKError,
|
|
1217
|
+
re as ConnectedSolutionsClientServerSideError,
|
|
1218
|
+
te as ConnectedSolutionsClientSideError,
|
|
1219
|
+
Fe as LOCK_STATUS,
|
|
1220
|
+
Te as createSDK,
|
|
1221
|
+
Te as default,
|
|
1222
|
+
be as isBureauAttribute,
|
|
1223
|
+
ye as isBureauScore,
|
|
1224
|
+
fe as isCreditAttribute,
|
|
1225
|
+
Se as isCreditAttributeArray,
|
|
1226
|
+
me as isCreditAttributeV2,
|
|
1227
|
+
_e as isCreditAttributesV2,
|
|
1228
|
+
Ht as isCreditScore,
|
|
1229
|
+
$e as isCreditScoreArray,
|
|
1230
|
+
Xt as isCreditScoreV2,
|
|
1231
|
+
ge as isCreditScoresV2,
|
|
1232
|
+
Pe as isFicoPlan,
|
|
1233
|
+
ve as isFicoRevision,
|
|
1234
|
+
Ce as isFicoRevisionsRequest,
|
|
1235
|
+
We as isFicoScenario,
|
|
1236
|
+
xe as isFicoScenarioVariation,
|
|
1237
|
+
we as isFicoSimulator,
|
|
1238
|
+
le as isPlanCompleted,
|
|
1239
|
+
pe as isPlanSet,
|
|
1240
|
+
De as isV1GetCreditAttributesResponse,
|
|
1241
|
+
Le as isV1GetCreditScoresResponse,
|
|
1242
|
+
Ve as isV1PostCreditScoresResponse,
|
|
1243
|
+
Je as isV2GetCreditAttributesResponse,
|
|
1244
|
+
Ie as isV2GetCreditScoresResponse,
|
|
1245
|
+
Be as isV2PostCreditScoresResponse,
|
|
1246
|
+
ke as isValidApiVersion,
|
|
1247
|
+
zt as isValidBureau,
|
|
1248
|
+
Qt as isValidBureauAttribute,
|
|
1249
|
+
Ue as isVantagePlan,
|
|
1250
|
+
Re as isVantageRevision,
|
|
1251
|
+
Ee as isVantageRevisionsRequest,
|
|
1252
|
+
Ne as isVantageScenario,
|
|
1253
|
+
je as isVantageScenarioVariation,
|
|
1254
|
+
It as mapApiErrorTypeToSDKErrorType,
|
|
1255
|
+
Vt as mapHttpStatusToSDKErrorType
|
|
1179
1256
|
};
|
|
1180
1257
|
//# sourceMappingURL=index.mjs.map
|