@experian-ecs/connected-api-sdk 1.2.0 → 1.3.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 +164 -1
- package/dist/esm/index.mjs +833 -499
- package/dist/esm/index.mjs.map +1 -1
- package/dist/index.d.ts +668 -48
- 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,1161 @@
|
|
|
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 Dt = Object.defineProperty;
|
|
16
|
+
var Ut = (r) => {
|
|
17
17
|
throw TypeError(r);
|
|
18
18
|
};
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
function
|
|
19
|
+
var Jt = (r, e, t) => e in r ? Dt(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
20
|
+
var d = (r, e, t) => Jt(r, typeof e != "symbol" ? e + "" : e, t), st = (r, e, t) => e.has(r) || Ut("Cannot " + t);
|
|
21
|
+
var c = (r, e, t) => (st(r, e, "read from private field"), t ? t.call(r) : e.get(r)), h = (r, e, t) => e.has(r) ? Ut("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(r) : e.set(r, t), V = (r, e, t, n) => (st(r, e, "write to private field"), n ? n.call(r, t) : e.set(r, t), t), y = (r, e, t) => (st(r, e, "access private method"), t);
|
|
22
|
+
function Ft(r) {
|
|
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 Gt(r);
|
|
26
|
+
case "authentication_error":
|
|
27
|
+
return new Mt(r);
|
|
28
|
+
case "server_side_error":
|
|
29
|
+
return new Kt(r);
|
|
30
|
+
case "rate_limit_error":
|
|
31
|
+
return new Xt(r);
|
|
30
32
|
default:
|
|
31
|
-
return new
|
|
33
|
+
return new Ht(r);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
class T extends Error {
|
|
37
|
+
constructor(t) {
|
|
38
|
+
var n;
|
|
39
|
+
super(t.message);
|
|
40
|
+
d(this, "message");
|
|
41
|
+
d(this, "data");
|
|
42
|
+
d(this, "status");
|
|
43
|
+
this.message = ((n = t.data) == null ? void 0 : n.message) || t.message || "", this.data = t.data, this.status = t.status;
|
|
32
44
|
}
|
|
33
45
|
}
|
|
34
|
-
|
|
46
|
+
d(T, "generateError", Ft);
|
|
47
|
+
class Gt extends T {
|
|
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 Mt extends T {
|
|
53
|
+
constructor(e) {
|
|
54
|
+
super(e), this.name = "ConnectedSolutionsClientAuthenticationError";
|
|
48
55
|
}
|
|
49
56
|
}
|
|
50
|
-
class
|
|
51
|
-
constructor(
|
|
52
|
-
super(
|
|
57
|
+
class Kt extends T {
|
|
58
|
+
constructor(e) {
|
|
59
|
+
super(e), this.name = "ConnectedSolutionsClientServerSideError";
|
|
53
60
|
}
|
|
54
61
|
}
|
|
55
|
-
class
|
|
56
|
-
constructor(
|
|
57
|
-
super(
|
|
62
|
+
class Ht extends T {
|
|
63
|
+
constructor(e) {
|
|
64
|
+
super(e), this.name = "ConnectedSolutionsClientSDKError";
|
|
58
65
|
}
|
|
59
66
|
}
|
|
60
|
-
class
|
|
61
|
-
constructor(
|
|
62
|
-
super(
|
|
67
|
+
class Xt extends T {
|
|
68
|
+
constructor(e) {
|
|
69
|
+
super(e), this.name = "ConnectedSolutionsClientRateLimitError";
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function Ct(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";
|
|
63
84
|
}
|
|
64
85
|
}
|
|
65
|
-
|
|
86
|
+
function Et(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 Rt = {
|
|
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
|
+
}, zt = {
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
this.config =
|
|
102
|
+
var k, ct, vt;
|
|
103
|
+
class b {
|
|
104
|
+
constructor(e) {
|
|
105
|
+
h(this, k);
|
|
106
|
+
d(this, "config");
|
|
107
|
+
d(this, "baseUrl", "");
|
|
108
|
+
d(this, "contentstackUrl", "");
|
|
109
|
+
const n = e.environment ?? "PRODUCTION";
|
|
110
|
+
this.config = e, this.baseUrl = Rt[n], this.contentstackUrl = zt[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, ct).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, ct).call(this);
|
|
141
|
+
const s = await fetch(e, t);
|
|
142
|
+
if (!(s != null && s.ok)) {
|
|
143
|
+
let o;
|
|
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 = Ct(g.error.type);
|
|
152
|
+
} else
|
|
153
|
+
u.type = Et(s == null ? void 0 : s.status);
|
|
154
|
+
throw T.generateError(u);
|
|
136
155
|
}
|
|
137
|
-
return
|
|
138
|
-
data: await
|
|
156
|
+
return y(this, k, vt).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(), ct = 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 T.generateError(e);
|
|
172
191
|
}
|
|
173
|
-
},
|
|
174
|
-
var
|
|
175
|
-
return ((
|
|
192
|
+
}, vt = 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, at;
|
|
197
|
+
const Q = class Q extends b {
|
|
179
198
|
constructor(t) {
|
|
180
199
|
super(t);
|
|
200
|
+
h(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, at).call(this, s), a = {
|
|
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
|
+
}, o = new URLSearchParams(a).toString(), u = o ? `?${o}` : "", 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, at).call(this, s), a = {
|
|
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
|
+
}, o = new URLSearchParams(a).toString(), u = o ? `?${o}` : "", 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
|
+
at = function(t = "v1") {
|
|
234
|
+
return `/${t}${c(Q, z)}`;
|
|
235
|
+
}, h(Q, z, "/credit/scores");
|
|
236
|
+
let ot = Q;
|
|
237
|
+
var f;
|
|
238
|
+
const $ = class $ extends b {
|
|
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, a = `${this.baseUrl}${c($, f)}/${s}/products/${n}/activate`;
|
|
308
|
+
return this.fetchWithAuth(a, {
|
|
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(), h($, f, "/v1/entitlements");
|
|
344
|
+
let ut = $;
|
|
345
|
+
var Y, Z, wt;
|
|
346
|
+
const q = class q extends b {
|
|
320
347
|
constructor(t) {
|
|
321
348
|
super(t);
|
|
349
|
+
h(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, wt).call(this, s), a = `${this.baseUrl}${i}`;
|
|
353
|
+
return this.fetchWithAuth(a, 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
|
+
wt = function(t = "v1") {
|
|
362
|
+
return `/${t}${c(q, Y)}`;
|
|
363
|
+
}, h(q, Y, "/credit/attributes");
|
|
364
|
+
let dt = q;
|
|
365
|
+
var M;
|
|
366
|
+
const B = class B extends b {
|
|
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}` : "", a = `${this.baseUrl}${c(B, M)}${i}`;
|
|
375
|
+
return this.fetchWithAuth(a, 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(), a = i ? `?${i}` : "";
|
|
347
379
|
return this.fetchWithAuth(
|
|
348
|
-
`${this.baseUrl}${
|
|
380
|
+
`${this.baseUrl}${c(B, M)}${a}`,
|
|
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(), h(B, M, "/v1/credit/tools/simulator");
|
|
394
|
+
let ht = B;
|
|
395
|
+
var j, O;
|
|
396
|
+
const U = class U extends b {
|
|
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(U, 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(), a = i ? `?${i}` : "", o = `${this.baseUrl}${c(U, j)}${a}`;
|
|
408
|
+
return this.fetchWithAuth(o, {
|
|
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(U, 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(), a = i ? `?${i}` : "", o = `${this.baseUrl}${c(U, j)}${c(U, O)}${a}`;
|
|
427
|
+
return this.fetchWithAuth(o, {
|
|
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(), h(U, j, "/v1/credit/tools/planners"), h(U, O, "/revisions");
|
|
439
|
+
let lt = U;
|
|
440
|
+
var I;
|
|
441
|
+
const W = class W extends b {
|
|
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(), h(W, I, "/v1/events-alerts");
|
|
470
|
+
let yt = W;
|
|
471
|
+
function xt(r) {
|
|
472
|
+
return !(r != null && r.version) || (r == null ? void 0 : r.version) === "v1";
|
|
473
|
+
}
|
|
474
|
+
function Qt(r) {
|
|
475
|
+
return (r == null ? void 0 : r.version) === "v2";
|
|
476
|
+
}
|
|
477
|
+
function Pt(r) {
|
|
478
|
+
return r !== void 0 && xt(r) && "include_fields" in r && typeof r.include_fields == "string";
|
|
479
|
+
}
|
|
480
|
+
function Yt(r) {
|
|
481
|
+
return r !== void 0 && xt(r) && ("include_fields" in r && typeof r.include_fields == "string" || "report_date" in r && typeof r.report_date == "string" || "product_config_id" in r && typeof r.product_config_id == "string" || "report_between" in r && typeof r.report_between == "string");
|
|
482
|
+
}
|
|
483
|
+
function Zt(r) {
|
|
484
|
+
return r !== void 0 && Qt(r) && ("product_config_id" in r && typeof r.product_config_id == "string" || "report_between" in r && typeof r.report_between == "string");
|
|
485
|
+
}
|
|
486
|
+
var tt, E, N;
|
|
487
|
+
const et = class et extends b {
|
|
441
488
|
constructor(t) {
|
|
442
489
|
super(t);
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
490
|
+
h(this, E);
|
|
491
|
+
}
|
|
492
|
+
async getReports(t, n) {
|
|
493
|
+
const s = t == null ? void 0 : t.version, i = y(this, E, N).call(this, s), a = {};
|
|
494
|
+
Yt(t) && (t.report_between && (a.report_between = t.report_between.toString()), t.include_fields && (a.include_fields = t.include_fields.toString()), t.report_date && (a.report_date = t.report_date.toString()), t.product_config_id && (a.product_config_id = t.product_config_id.toString())), Zt(t) && (t.product_config_id && (a.product_config_id = t.product_config_id.toString()), t.report_between && (a.report_between = t.report_between.toString()));
|
|
495
|
+
const o = new URLSearchParams(a).toString(), u = o ? `?${o}` : "", l = `${this.baseUrl}${i}${u}`;
|
|
496
|
+
return this.fetchWithAuth(l, n);
|
|
497
|
+
}
|
|
498
|
+
async getReportById(t, n) {
|
|
499
|
+
const { id: s, version: i } = t, a = y(this, E, N).call(this, i), o = {};
|
|
500
|
+
Pt(t) && (o.include_fields = t.include_fields.toString());
|
|
501
|
+
const u = new URLSearchParams(o).toString(), l = u ? `?${u}` : "", g = `${this.baseUrl}${a}/${s}${l}`;
|
|
502
|
+
return this.fetchWithAuth(g, n);
|
|
503
|
+
}
|
|
504
|
+
async getReportsMeta(t, n) {
|
|
505
|
+
const { version: s, latest_only: i, report_read: a, ...o } = t ?? {}, u = y(this, E, N).call(this, s), l = {
|
|
454
506
|
...o ?? {},
|
|
455
|
-
...
|
|
456
|
-
...
|
|
457
|
-
},
|
|
458
|
-
return this.fetchWithAuth(
|
|
459
|
-
}
|
|
460
|
-
async getReportMetaById(t,
|
|
461
|
-
const { id: s, ...
|
|
462
|
-
return this.fetchWithAuth(
|
|
463
|
-
}
|
|
464
|
-
async markReportAsRead(t,
|
|
465
|
-
const s = `${this.baseUrl}${a
|
|
466
|
-
|
|
507
|
+
...i ? { latest_only: i.toString() } : {},
|
|
508
|
+
...a ? { report_read: a.toString() } : {}
|
|
509
|
+
}, g = new URLSearchParams(l).toString(), m = g ? `?${g}` : "", Bt = `${this.baseUrl}${u}/meta${m}`;
|
|
510
|
+
return this.fetchWithAuth(Bt, n);
|
|
511
|
+
}
|
|
512
|
+
async getReportMetaById(t, n) {
|
|
513
|
+
const { id: s, version: i, ...a } = t, o = y(this, E, N).call(this, i), u = new URLSearchParams(a).toString(), l = u ? `?${u}` : "", g = `${this.baseUrl}${o}/${s}/meta${l}`;
|
|
514
|
+
return this.fetchWithAuth(g, n);
|
|
515
|
+
}
|
|
516
|
+
async markReportAsRead(t, n) {
|
|
517
|
+
const { id: s, version: i } = t, a = y(this, E, N).call(this, i), o = `${this.baseUrl}${a}`;
|
|
518
|
+
if (i === "v2") {
|
|
519
|
+
const l = `${o}/${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 = `${o}/${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, a = y(this, E, N).call(this, i);
|
|
540
|
+
Pt(t) && (s.include_fields = t.include_fields.toString());
|
|
541
|
+
const o = new URLSearchParams(s).toString(), u = o ? `?${o}` : "", l = `${this.baseUrl}${a}${u}`;
|
|
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(), E = 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
|
+
}, h(et, tt, "/credit/reports");
|
|
563
|
+
let gt = et;
|
|
564
|
+
var w;
|
|
565
|
+
const v = class v extends b {
|
|
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(v, 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(v, 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(v, 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(v, 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(v, 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 D = class D extends
|
|
547
|
-
constructor(
|
|
548
|
-
super(
|
|
617
|
+
w = new WeakMap(), h(v, w, "/v1/customers");
|
|
618
|
+
let $t = v;
|
|
619
|
+
var K;
|
|
620
|
+
const D = class D extends b {
|
|
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(D, 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(D, 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(), h(D, K, "/v1/authentication");
|
|
642
|
+
let ft = D;
|
|
643
|
+
var rt;
|
|
644
|
+
const nt = class nt extends b {
|
|
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
|
|
591
|
-
constructor(
|
|
592
|
-
super(
|
|
661
|
+
rt = new WeakMap(), h(nt, rt, "/v1/registrations");
|
|
662
|
+
let mt = nt;
|
|
663
|
+
var H;
|
|
664
|
+
const J = class J extends b {
|
|
665
|
+
constructor(e) {
|
|
666
|
+
super(e);
|
|
593
667
|
}
|
|
594
|
-
async getProductConfigs(
|
|
595
|
-
const { fromEntries:
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
668
|
+
async getProductConfigs(e, t) {
|
|
669
|
+
const { fromEntries: n, entries: s } = Object, { isArray: i } = Array, a = n(
|
|
670
|
+
s(e).filter(([g, m]) => m != null).map(([g, m]) => [
|
|
671
|
+
g,
|
|
672
|
+
i(m) ? m.join(",") : m.toString()
|
|
599
673
|
])
|
|
600
|
-
),
|
|
601
|
-
return this.fetchWithAuth(
|
|
602
|
-
...
|
|
674
|
+
), o = new URLSearchParams(a).toString(), u = o ? `?${o}` : "", l = `${this.baseUrl}${c(J, H)}${u}`;
|
|
675
|
+
return this.fetchWithAuth(l, {
|
|
676
|
+
...t || {}
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
async getProductConfigById(e, t) {
|
|
680
|
+
const n = `${this.baseUrl}${c(J, H)}/${e.product_config_id}`;
|
|
681
|
+
return this.fetchWithAuth(n, {
|
|
682
|
+
...t ?? {}
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
H = new WeakMap(), h(J, H, "/v1/product-configs");
|
|
687
|
+
let bt = J;
|
|
688
|
+
var R;
|
|
689
|
+
const P = class P extends b {
|
|
690
|
+
constructor(e) {
|
|
691
|
+
super(e);
|
|
692
|
+
}
|
|
693
|
+
async getSurvey(e) {
|
|
694
|
+
const t = `${this.baseUrl}${c(P, R)}/surveys`;
|
|
695
|
+
return this.fetchWithAuth(t, e);
|
|
696
|
+
}
|
|
697
|
+
async submitSurvey(e, t) {
|
|
698
|
+
const n = `${this.baseUrl}${c(P, R)}/surveys`;
|
|
699
|
+
return this.fetchWithAuth(n, {
|
|
700
|
+
method: "POST",
|
|
701
|
+
headers: {
|
|
702
|
+
...(t == null ? void 0 : t.headers) ?? {},
|
|
703
|
+
"Content-Type": "application/json"
|
|
704
|
+
},
|
|
705
|
+
body: JSON.stringify(e),
|
|
706
|
+
...t ?? {}
|
|
603
707
|
});
|
|
604
708
|
}
|
|
605
|
-
async
|
|
606
|
-
const
|
|
607
|
-
return this.fetchWithAuth(
|
|
709
|
+
async getScore(e) {
|
|
710
|
+
const t = `${this.baseUrl}${c(P, R)}/scores?latest=TRUE`;
|
|
711
|
+
return this.fetchWithAuth(t, e);
|
|
712
|
+
}
|
|
713
|
+
async getPlan(e, t) {
|
|
714
|
+
const n = {
|
|
715
|
+
action_status: e.action_status,
|
|
716
|
+
...e.cursor ? { cursor: e.cursor } : {},
|
|
717
|
+
...e.count ? { count: e.count.toString() } : {}
|
|
718
|
+
}, s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", a = `${this.baseUrl}${c(P, R)}/plans${i}`;
|
|
719
|
+
return this.fetchWithAuth(a, t);
|
|
720
|
+
}
|
|
721
|
+
async createPlan(e) {
|
|
722
|
+
const t = `${this.baseUrl}${c(P, R)}/plans`;
|
|
723
|
+
return this.fetchWithAuth(t, {
|
|
724
|
+
method: "POST",
|
|
725
|
+
headers: {
|
|
726
|
+
...(e == null ? void 0 : e.headers) ?? {},
|
|
727
|
+
"Content-Type": "application/json"
|
|
728
|
+
},
|
|
729
|
+
body: JSON.stringify({}),
|
|
608
730
|
...e ?? {}
|
|
609
731
|
});
|
|
610
732
|
}
|
|
733
|
+
async updateAction(e, t) {
|
|
734
|
+
const { action_id: n, ...s } = e, i = `${this.baseUrl}${c(P, R)}/plans/actions/${n}`;
|
|
735
|
+
return this.fetchWithAuth(i, {
|
|
736
|
+
method: "PUT",
|
|
737
|
+
headers: {
|
|
738
|
+
...(t == null ? void 0 : t.headers) ?? {},
|
|
739
|
+
"Content-Type": "application/json"
|
|
740
|
+
},
|
|
741
|
+
body: JSON.stringify(s),
|
|
742
|
+
...t ?? {}
|
|
743
|
+
});
|
|
744
|
+
}
|
|
611
745
|
};
|
|
612
|
-
|
|
613
|
-
let
|
|
614
|
-
|
|
746
|
+
R = new WeakMap(), h(P, R, "/v1/ihs");
|
|
747
|
+
let _t = P;
|
|
748
|
+
var S;
|
|
749
|
+
const _ = class _ extends b {
|
|
750
|
+
constructor(e) {
|
|
751
|
+
super(e);
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* Create a new discovery scan
|
|
755
|
+
* POST /v1/dim/scans
|
|
756
|
+
*/
|
|
757
|
+
async createScan(e, t) {
|
|
758
|
+
const n = `${this.baseUrl}${c(_, S)}/scans`;
|
|
759
|
+
return this.fetchWithAuth(n, {
|
|
760
|
+
method: "POST",
|
|
761
|
+
headers: {
|
|
762
|
+
...(t == null ? void 0 : t.headers) ?? {},
|
|
763
|
+
"Content-Type": "application/json"
|
|
764
|
+
},
|
|
765
|
+
body: JSON.stringify({
|
|
766
|
+
product_config_id: e.product_config_id
|
|
767
|
+
}),
|
|
768
|
+
...t ?? {}
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Get scan results
|
|
773
|
+
* GET /v1/dim/scans
|
|
774
|
+
*/
|
|
775
|
+
async getScans(e, t) {
|
|
776
|
+
const n = {};
|
|
777
|
+
e != null && e.product_config_id && (n.product_config_id = e.product_config_id), e != null && e.scan_between && (n.scan_between = e.scan_between), e != null && e.cursor && (n.cursor = e.cursor), e != null && e.count && (n.count = e.count.toString());
|
|
778
|
+
const s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", a = `${this.baseUrl}${c(_, S)}/scans${i}`;
|
|
779
|
+
return this.fetchWithAuth(a, t);
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Get scan by ID
|
|
783
|
+
* GET /v1/dim/scans/{scan_id}
|
|
784
|
+
*/
|
|
785
|
+
async getScanById(e, t) {
|
|
786
|
+
const n = `${this.baseUrl}${c(_, S)}/scans/${e.scanId}`;
|
|
787
|
+
return this.fetchWithAuth(n, t);
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Get scan meta data details
|
|
791
|
+
* GET /v1/dim/scans/meta
|
|
792
|
+
*/
|
|
793
|
+
async getScansMetadata(e, t) {
|
|
794
|
+
const n = {};
|
|
795
|
+
e != null && e.product_config_id && (n.product_config_id = e.product_config_id), e != null && e.scan_between && (n.scan_between = e.scan_between), e != null && e.most_recent && (n.most_recent = "TRUE");
|
|
796
|
+
const s = new URLSearchParams(n).toString(), i = s ? `?${s}` : "", a = `${this.baseUrl}${c(_, S)}/scans/meta${i}`;
|
|
797
|
+
return this.fetchWithAuth(a, t);
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* Get brokers details
|
|
801
|
+
* GET /v1/dim/brokers
|
|
802
|
+
*/
|
|
803
|
+
async getBrokers(e) {
|
|
804
|
+
const t = `${this.baseUrl}${c(_, S)}/brokers`;
|
|
805
|
+
return this.fetchWithAuth(t, e);
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Get a broker detail
|
|
809
|
+
* GET /v1/dim/brokers/{broker_id}
|
|
810
|
+
*/
|
|
811
|
+
async getBrokerById(e, t) {
|
|
812
|
+
const n = `${this.baseUrl}${c(_, S)}/brokers/${e.brokerId}`;
|
|
813
|
+
return this.fetchWithAuth(n, t);
|
|
814
|
+
}
|
|
815
|
+
/**
|
|
816
|
+
* Get brokers details for a scan
|
|
817
|
+
* GET /v1/dim/scans/{scan_id}/brokers
|
|
818
|
+
*/
|
|
819
|
+
async getBrokersByScanId(e, t) {
|
|
820
|
+
const n = `${this.baseUrl}${c(_, S)}/scans/${e.scanId}/brokers`;
|
|
821
|
+
return this.fetchWithAuth(n, t);
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Get brokers group detail
|
|
825
|
+
* GET /v1/dim/brokers/groups/{group_id}
|
|
826
|
+
*/
|
|
827
|
+
async getBrokersByGroupId(e, t) {
|
|
828
|
+
const n = `${this.baseUrl}${c(_, S)}/brokers/groups/${e.groupId}`;
|
|
829
|
+
return this.fetchWithAuth(n, t);
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* Update user action for removal (disposition a scan removal)
|
|
833
|
+
* POST /v1/dim/brokers/groups/{group_id}/action
|
|
834
|
+
* Returns 202 Accepted with group_id in response body
|
|
835
|
+
* Note: Per OAS 1.0.29, this endpoint doesn't accept a request body
|
|
836
|
+
*/
|
|
837
|
+
async updateBrokerGroupAction(e, t) {
|
|
838
|
+
const n = `${this.baseUrl}${c(_, S)}/brokers/groups/${e.groupId}/action`;
|
|
839
|
+
return this.fetchWithAuth(n, {
|
|
840
|
+
method: "POST",
|
|
841
|
+
headers: {
|
|
842
|
+
...(t == null ? void 0 : t.headers) ?? {},
|
|
843
|
+
"Content-Type": "application/json"
|
|
844
|
+
},
|
|
845
|
+
...t ?? {}
|
|
846
|
+
});
|
|
847
|
+
}
|
|
848
|
+
};
|
|
849
|
+
S = new WeakMap(), h(_, S, "/v1/dim");
|
|
850
|
+
let St = _;
|
|
851
|
+
const it = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
615
852
|
__proto__: null,
|
|
616
|
-
AlertsService:
|
|
617
|
-
CreditAttributesService:
|
|
618
|
-
CreditReportsService:
|
|
619
|
-
CreditScorePlannerService:
|
|
620
|
-
CreditScoreSimulatorService:
|
|
621
|
-
CreditScoresService:
|
|
622
|
-
CustomerAuthService:
|
|
623
|
-
CustomersService:
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
853
|
+
AlertsService: yt,
|
|
854
|
+
CreditAttributesService: dt,
|
|
855
|
+
CreditReportsService: gt,
|
|
856
|
+
CreditScorePlannerService: lt,
|
|
857
|
+
CreditScoreSimulatorService: ht,
|
|
858
|
+
CreditScoresService: ot,
|
|
859
|
+
CustomerAuthService: ft,
|
|
860
|
+
CustomersService: $t,
|
|
861
|
+
DigitalIdentityManagerService: St,
|
|
862
|
+
EntitlementsService: ut,
|
|
863
|
+
IdentityHealthScoreService: _t,
|
|
864
|
+
ProductConfigsService: bt,
|
|
865
|
+
RegistrationsService: mt
|
|
627
866
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
628
|
-
function
|
|
867
|
+
function qt(r) {
|
|
629
868
|
return `${r[0].toLowerCase()}${r.substring(1)}`.replace(
|
|
630
869
|
"Service",
|
|
631
870
|
""
|
|
632
871
|
);
|
|
633
872
|
}
|
|
634
|
-
const
|
|
635
|
-
var
|
|
636
|
-
const
|
|
637
|
-
constructor(
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
this.config =
|
|
644
|
-
}
|
|
645
|
-
async getAccessToken(
|
|
646
|
-
if (!
|
|
647
|
-
throw
|
|
873
|
+
const Ot = typeof process < "u" && process.versions && process.versions.node && typeof window > "u";
|
|
874
|
+
var A, L, X, p, Nt, pt, Wt, jt;
|
|
875
|
+
const F = class F {
|
|
876
|
+
constructor(e) {
|
|
877
|
+
h(this, p);
|
|
878
|
+
d(this, "config");
|
|
879
|
+
h(this, A);
|
|
880
|
+
h(this, L, null);
|
|
881
|
+
d(this, "baseUrl", "");
|
|
882
|
+
this.config = e, this.baseUrl = Rt[e.environment ?? "PRODUCTION"], V(this, A, /* @__PURE__ */ new Map());
|
|
883
|
+
}
|
|
884
|
+
async getAccessToken(e) {
|
|
885
|
+
if (!Ot)
|
|
886
|
+
throw T.generateError({
|
|
648
887
|
type: "sdk_error",
|
|
649
888
|
message: "getAccessToken is not supported in browser"
|
|
650
889
|
});
|
|
651
890
|
try {
|
|
652
891
|
return {
|
|
653
|
-
data: await
|
|
892
|
+
data: await y(this, p, Nt).call(this, e),
|
|
654
893
|
errors: void 0,
|
|
655
894
|
meta: {
|
|
656
895
|
status: 200,
|
|
657
896
|
statusText: "OK"
|
|
658
897
|
}
|
|
659
898
|
};
|
|
660
|
-
} catch (
|
|
899
|
+
} catch (n) {
|
|
661
900
|
return this.clearCache(), {
|
|
662
901
|
data: void 0,
|
|
663
|
-
error:
|
|
902
|
+
error: n,
|
|
664
903
|
meta: {
|
|
665
|
-
status:
|
|
666
|
-
statusText:
|
|
904
|
+
status: n.status,
|
|
905
|
+
statusText: n.message
|
|
667
906
|
}
|
|
668
907
|
};
|
|
669
908
|
}
|
|
670
909
|
}
|
|
671
910
|
getCacheLength() {
|
|
672
|
-
return
|
|
911
|
+
return c(this, A).size;
|
|
673
912
|
}
|
|
674
913
|
clearCache() {
|
|
675
|
-
const
|
|
676
|
-
(
|
|
914
|
+
const e = `${this.baseUrl}${c(F, X)}`, t = Array.from(c(this, A).keys()).filter(
|
|
915
|
+
(n) => n.includes(e)
|
|
677
916
|
);
|
|
678
|
-
for (const
|
|
679
|
-
|
|
917
|
+
for (const n of t)
|
|
918
|
+
c(this, A).delete(n);
|
|
680
919
|
}
|
|
681
920
|
};
|
|
682
|
-
|
|
683
|
-
grantType:
|
|
684
|
-
clientId:
|
|
685
|
-
clientSecret:
|
|
686
|
-
customerId:
|
|
921
|
+
A = new WeakMap(), L = new WeakMap(), X = new WeakMap(), p = new WeakSet(), Nt = async function({
|
|
922
|
+
grantType: e,
|
|
923
|
+
clientId: t,
|
|
924
|
+
clientSecret: n,
|
|
925
|
+
customerId: s
|
|
687
926
|
}) {
|
|
688
|
-
var
|
|
689
|
-
|
|
690
|
-
const
|
|
927
|
+
var l;
|
|
928
|
+
y(this, p, Wt).call(this);
|
|
929
|
+
const i = `${this.baseUrl}${c(F, X)}`, a = {
|
|
691
930
|
method: "POST",
|
|
692
931
|
headers: { "content-type": "application/json" },
|
|
693
932
|
credentials: "include",
|
|
694
933
|
body: JSON.stringify({
|
|
695
|
-
grant_type:
|
|
696
|
-
client_id:
|
|
697
|
-
client_secret:
|
|
698
|
-
...
|
|
934
|
+
grant_type: e,
|
|
935
|
+
client_id: t,
|
|
936
|
+
client_secret: n,
|
|
937
|
+
...e === "trusted_partner" ? { partner_customer_id: s ?? "" } : {}
|
|
699
938
|
})
|
|
700
|
-
},
|
|
701
|
-
if (
|
|
702
|
-
const
|
|
703
|
-
return
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
939
|
+
}, o = await y(this, p, jt).call(this, i, a);
|
|
940
|
+
if (o != null && o.ok) {
|
|
941
|
+
const m = await o.clone().json();
|
|
942
|
+
return c(this, L) === null && y(this, p, pt).call(this, m.expires_in), m;
|
|
943
|
+
}
|
|
944
|
+
const u = {
|
|
945
|
+
type: "sdk_error",
|
|
946
|
+
// fallback
|
|
947
|
+
status: o == null ? void 0 : o.status,
|
|
948
|
+
message: (o == null ? void 0 : o.statusText) || "",
|
|
709
949
|
data: void 0
|
|
710
950
|
};
|
|
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;
|
|
951
|
+
if ((l = o == null ? void 0 : o.headers.get("content-type")) != null && l.includes("application/json")) {
|
|
952
|
+
const m = await o.clone().json();
|
|
953
|
+
u.data = m.error, u.type = Ct(m.error.type);
|
|
954
|
+
} else
|
|
955
|
+
u.type = Et(o == null ? void 0 : o.status);
|
|
956
|
+
throw T.generateError(u);
|
|
957
|
+
}, pt = function(e) {
|
|
958
|
+
const t = (/* @__PURE__ */ new Date()).getTime(), n = 60 * 60 * 1e3, s = t + n, i = e === null ? e : new Date(s).valueOf();
|
|
959
|
+
V(this, L, i);
|
|
960
|
+
}, Wt = function() {
|
|
961
|
+
const e = new Date(Date.now()), t = new Date(c(this, L) ?? Number.NaN);
|
|
962
|
+
te(e, t) && (y(this, p, pt).call(this, null), c(this, A).clear());
|
|
963
|
+
}, jt = async function(e, t) {
|
|
964
|
+
const n = `${e}${JSON.stringify(t || {})}`;
|
|
965
|
+
if (!c(this, A).has(n)) {
|
|
966
|
+
const s = fetch(e, t ?? {});
|
|
967
|
+
c(this, A).set(n, s);
|
|
968
|
+
}
|
|
969
|
+
return await c(this, A).get(n);
|
|
970
|
+
}, h(F, X, "/v1/oauth2/token");
|
|
971
|
+
let At = F;
|
|
972
|
+
function te(r, e) {
|
|
973
|
+
return r > e;
|
|
739
974
|
}
|
|
740
975
|
var x;
|
|
741
|
-
const
|
|
976
|
+
const C = class C extends b {
|
|
742
977
|
// 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
|
-
|
|
978
|
+
constructor(t) {
|
|
979
|
+
super(t);
|
|
980
|
+
d(this, "alerts");
|
|
981
|
+
d(this, "auth");
|
|
982
|
+
d(this, "creditReports");
|
|
983
|
+
d(this, "creditScores");
|
|
984
|
+
d(this, "creditAttributes");
|
|
985
|
+
d(this, "creditScorePlanner");
|
|
986
|
+
d(this, "creditScoreSimulator");
|
|
987
|
+
d(this, "customerAuth");
|
|
988
|
+
d(this, "customers");
|
|
989
|
+
d(this, "entitlements");
|
|
990
|
+
d(this, "productConfigs");
|
|
991
|
+
d(this, "registrations");
|
|
992
|
+
d(this, "identityHealthScore");
|
|
993
|
+
d(this, "digitalIdentityManager");
|
|
994
|
+
for (const n in it)
|
|
995
|
+
typeof it[n] == "function" && (this[qt(n)] = new it[n](t));
|
|
996
|
+
this.auth = new At({
|
|
997
|
+
environment: t.environment
|
|
761
998
|
});
|
|
762
999
|
}
|
|
763
1000
|
// new services go here
|
|
764
1001
|
// The method is static as we need to access the method only through the class here
|
|
765
|
-
static getInstance(
|
|
766
|
-
return
|
|
1002
|
+
static getInstance(t) {
|
|
1003
|
+
return c(C, x) || V(C, x, new C(t)), c(C, x);
|
|
767
1004
|
}
|
|
768
1005
|
static clearInstance() {
|
|
769
|
-
|
|
1006
|
+
V(C, x, null);
|
|
770
1007
|
}
|
|
771
1008
|
};
|
|
772
|
-
x = new WeakMap(),
|
|
773
|
-
let
|
|
774
|
-
function
|
|
775
|
-
return
|
|
1009
|
+
x = new WeakMap(), h(C, x, null);
|
|
1010
|
+
let Tt = C;
|
|
1011
|
+
function he(r) {
|
|
1012
|
+
return Tt.getInstance(r);
|
|
776
1013
|
}
|
|
777
|
-
function
|
|
1014
|
+
function ee(r) {
|
|
778
1015
|
return r.progress_status === "TARGET_NOT_MET" || r.progress_status === "COMPLETED";
|
|
779
1016
|
}
|
|
780
|
-
function
|
|
781
|
-
return
|
|
1017
|
+
function le(r) {
|
|
1018
|
+
return ee(r) || r.progress_status === "TARGET_SCORE_AND_PLAN_SET" || r.progress_status === "ON_TRACK" || r.progress_status === "OFF_TRACK";
|
|
782
1019
|
}
|
|
783
|
-
function
|
|
1020
|
+
function ye(r) {
|
|
784
1021
|
return r.score_model.includes("VANTAGE");
|
|
785
1022
|
}
|
|
786
|
-
function
|
|
1023
|
+
function ge(r) {
|
|
787
1024
|
return r.score_model.includes("FICO");
|
|
788
1025
|
}
|
|
789
|
-
function
|
|
1026
|
+
function $e(r) {
|
|
790
1027
|
return r.target_score !== void 0;
|
|
791
1028
|
}
|
|
792
|
-
function
|
|
1029
|
+
function fe(r) {
|
|
793
1030
|
return r.max_actions_per_plan !== void 0;
|
|
794
1031
|
}
|
|
795
|
-
function
|
|
1032
|
+
function me(r) {
|
|
796
1033
|
return r.score_model.includes("FICO");
|
|
797
1034
|
}
|
|
798
|
-
function
|
|
1035
|
+
function be(r) {
|
|
799
1036
|
return r.score_model.includes("VANTAGE");
|
|
800
1037
|
}
|
|
801
|
-
function
|
|
1038
|
+
function _e(r) {
|
|
802
1039
|
return !!(r && "best_action" in r);
|
|
803
1040
|
}
|
|
804
|
-
function
|
|
1041
|
+
function Se(r) {
|
|
805
1042
|
return !!(r && "simulated_score" in r);
|
|
806
1043
|
}
|
|
807
|
-
function
|
|
1044
|
+
function Ae(r) {
|
|
808
1045
|
return !("simulated_score" in r);
|
|
809
1046
|
}
|
|
810
|
-
function
|
|
1047
|
+
function pe(r) {
|
|
811
1048
|
return !!(r && "slider_min_value" in r && "slider_max_value" in r);
|
|
812
1049
|
}
|
|
813
|
-
function
|
|
1050
|
+
function Te(r) {
|
|
814
1051
|
return !!(r && "value" in r && "simulated_score" in r);
|
|
815
1052
|
}
|
|
1053
|
+
function Ue(r) {
|
|
1054
|
+
return r === "v1" || r === "v2";
|
|
1055
|
+
}
|
|
1056
|
+
function It(r) {
|
|
1057
|
+
if (typeof r != "object" || r === null) return !1;
|
|
1058
|
+
const e = r;
|
|
1059
|
+
return typeof e.score_id == "string" && Lt(e.bureau) && typeof e.score == "number" && typeof e.score_date == "string";
|
|
1060
|
+
}
|
|
1061
|
+
function kt(r) {
|
|
1062
|
+
if (typeof r != "object" || r === null) return !1;
|
|
1063
|
+
const e = r;
|
|
1064
|
+
return typeof e.id == "string" && Array.isArray(e.bureau_scores) && e.bureau_scores.every((t) => re(t));
|
|
1065
|
+
}
|
|
1066
|
+
function re(r) {
|
|
1067
|
+
if (typeof r != "object" || r === null) return !1;
|
|
1068
|
+
const e = r;
|
|
1069
|
+
return Lt(e.bureau) && typeof e.score == "number" && typeof e.score_date == "string";
|
|
1070
|
+
}
|
|
1071
|
+
function Lt(r) {
|
|
1072
|
+
return r === "EXPERIAN" || r === "EQUIFAX" || r === "TRANSUNION";
|
|
1073
|
+
}
|
|
1074
|
+
function ne(r) {
|
|
1075
|
+
return typeof r == "object" && r !== null && "items" in r && Array.isArray(r.items) && r.items.every(
|
|
1076
|
+
(e) => kt(e)
|
|
1077
|
+
);
|
|
1078
|
+
}
|
|
1079
|
+
function se(r) {
|
|
1080
|
+
return Array.isArray(r) && r.every((e) => It(e));
|
|
1081
|
+
}
|
|
1082
|
+
function Pe(r) {
|
|
1083
|
+
return se(r);
|
|
1084
|
+
}
|
|
1085
|
+
function Ce(r) {
|
|
1086
|
+
return ne(r);
|
|
1087
|
+
}
|
|
1088
|
+
function Ee(r) {
|
|
1089
|
+
return It(r);
|
|
1090
|
+
}
|
|
1091
|
+
function Re(r) {
|
|
1092
|
+
return kt(r);
|
|
1093
|
+
}
|
|
1094
|
+
function ie(r) {
|
|
1095
|
+
if (typeof r != "object" || r === null) return !1;
|
|
1096
|
+
const e = r;
|
|
1097
|
+
return Vt(e.bureau) && typeof e.reported_at == "string" && typeof e.categories == "object" && typeof e.attributes == "object";
|
|
1098
|
+
}
|
|
1099
|
+
function ce(r) {
|
|
1100
|
+
if (typeof r != "object" || r === null) return !1;
|
|
1101
|
+
const e = r;
|
|
1102
|
+
return typeof e.id == "string" && Array.isArray(e.bureau_attributes) && e.bureau_attributes.every(
|
|
1103
|
+
(t) => oe(t)
|
|
1104
|
+
);
|
|
1105
|
+
}
|
|
1106
|
+
function oe(r) {
|
|
1107
|
+
if (typeof r != "object" || r === null) return !1;
|
|
1108
|
+
const e = r;
|
|
1109
|
+
return Vt(e.bureau) && typeof e.reported_at == "string" && typeof e.categories == "object" && typeof e.attributes == "object";
|
|
1110
|
+
}
|
|
1111
|
+
function Vt(r) {
|
|
1112
|
+
return r === "EXPERIAN" || r === "EQUIFAX" || r === "TRANSUNION";
|
|
1113
|
+
}
|
|
1114
|
+
function ae(r) {
|
|
1115
|
+
return typeof r == "object" && r !== null && "items" in r && Array.isArray(r.items) && r.items.every(
|
|
1116
|
+
(e) => ce(e)
|
|
1117
|
+
);
|
|
1118
|
+
}
|
|
1119
|
+
function ue(r) {
|
|
1120
|
+
return Array.isArray(r) && r.every((e) => ie(e));
|
|
1121
|
+
}
|
|
1122
|
+
function ve(r) {
|
|
1123
|
+
return ue(r);
|
|
1124
|
+
}
|
|
1125
|
+
function we(r) {
|
|
1126
|
+
return ae(r);
|
|
1127
|
+
}
|
|
816
1128
|
export {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
1129
|
+
Mt as ConnectedSolutionsClientAuthenticationError,
|
|
1130
|
+
T as ConnectedSolutionsClientError,
|
|
1131
|
+
Xt as ConnectedSolutionsClientRateLimitError,
|
|
1132
|
+
Ht as ConnectedSolutionsClientSDKError,
|
|
1133
|
+
Kt as ConnectedSolutionsClientServerSideError,
|
|
1134
|
+
Gt as ConnectedSolutionsClientSideError,
|
|
1135
|
+
he as createSDK,
|
|
1136
|
+
he as default,
|
|
1137
|
+
oe as isBureauAttribute,
|
|
1138
|
+
re as isBureauScore,
|
|
1139
|
+
ie as isCreditAttribute,
|
|
1140
|
+
ue as isCreditAttributeArray,
|
|
1141
|
+
ce as isCreditAttributeV2,
|
|
1142
|
+
ae as isCreditAttributesV2,
|
|
1143
|
+
It as isCreditScore,
|
|
1144
|
+
se as isCreditScoreArray,
|
|
1145
|
+
kt as isCreditScoreV2,
|
|
1146
|
+
ne as isCreditScoresV2,
|
|
1147
|
+
ge as isFicoPlan,
|
|
1148
|
+
me as isFicoRevision,
|
|
1149
|
+
$e as isFicoRevisionsRequest,
|
|
1150
|
+
Ae as isFicoScenario,
|
|
1151
|
+
pe as isFicoScenarioVariation,
|
|
1152
|
+
_e as isFicoSimulator,
|
|
1153
|
+
ee as isPlanCompleted,
|
|
1154
|
+
le as isPlanSet,
|
|
1155
|
+
ve as isV1GetCreditAttributesResponse,
|
|
1156
|
+
Pe as isV1GetCreditScoresResponse,
|
|
1157
|
+
Ee as isV1PostCreditScoresResponse,
|
|
1158
|
+
we as isV2GetCreditAttributesResponse,
|
|
1159
|
+
Ce as isV2GetCreditScoresResponse,
|
|
1160
|
+
Re as isV2PostCreditScoresResponse,
|
|
1161
|
+
Ue as isValidApiVersion,
|
|
1162
|
+
Lt as isValidBureau,
|
|
1163
|
+
Vt as isValidBureauAttribute,
|
|
1164
|
+
ye as isVantagePlan,
|
|
1165
|
+
be as isVantageRevision,
|
|
1166
|
+
fe as isVantageRevisionsRequest,
|
|
1167
|
+
Se as isVantageScenario,
|
|
1168
|
+
Te as isVantageScenarioVariation,
|
|
1169
|
+
Ct as mapApiErrorTypeToSDKErrorType,
|
|
1170
|
+
Et as mapHttpStatusToSDKErrorType
|
|
837
1171
|
};
|
|
838
1172
|
//# sourceMappingURL=index.mjs.map
|