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