@api7/portal-sdk 0.0.3 → 0.0.4

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.
@@ -4,51 +4,51 @@ const Y = ({
4
4
  onSseError: t,
5
5
  onSseEvent: r,
6
6
  responseTransformer: s,
7
- responseValidator: n,
7
+ responseValidator: i,
8
8
  sseDefaultRetryDelay: l,
9
9
  sseMaxRetryAttempts: c,
10
- sseMaxRetryDelay: i,
10
+ sseMaxRetryDelay: n,
11
11
  sseSleepFn: o,
12
12
  url: d,
13
13
  ...a
14
14
  }) => {
15
15
  let h;
16
- const b = o ?? ((m) => new Promise((y) => setTimeout(y, m)));
16
+ const m = o ?? ((b) => new Promise((y) => setTimeout(y, b)));
17
17
  return { stream: async function* () {
18
- let m = l ?? 3e3, y = 0;
19
- const A = a.signal ?? new AbortController().signal;
20
- for (; !A.aborted; ) {
18
+ let b = l ?? 3e3, y = 0;
19
+ const S = a.signal ?? new AbortController().signal;
20
+ for (; !S.aborted; ) {
21
21
  y++;
22
22
  const k = a.headers instanceof Headers ? a.headers : new Headers(a.headers);
23
23
  h !== void 0 && k.set("Last-Event-ID", h);
24
24
  try {
25
- const S = {
25
+ const j = {
26
26
  redirect: "follow",
27
27
  ...a,
28
28
  body: a.serializedBody,
29
29
  headers: k,
30
- signal: A
30
+ signal: S
31
31
  };
32
- let j = new Request(d, S);
33
- e && (j = await e(d, S));
34
- const v = await (a.fetch ?? globalThis.fetch)(j);
35
- if (!v.ok)
32
+ let v = new Request(d, j);
33
+ e && (v = await e(d, j));
34
+ const _ = await (a.fetch ?? globalThis.fetch)(v);
35
+ if (!_.ok)
36
36
  throw new Error(
37
- `SSE failed: ${v.status} ${v.statusText}`
37
+ `SSE failed: ${_.status} ${_.statusText}`
38
38
  );
39
- if (!v.body) throw new Error("No body in SSE response");
40
- const x = v.body.pipeThrough(new TextDecoderStream()).getReader();
39
+ if (!_.body) throw new Error("No body in SSE response");
40
+ const D = _.body.pipeThrough(new TextDecoderStream()).getReader();
41
41
  let C = "";
42
42
  const I = () => {
43
43
  try {
44
- x.cancel();
44
+ D.cancel();
45
45
  } catch {
46
46
  }
47
47
  };
48
- A.addEventListener("abort", I);
48
+ S.addEventListener("abort", I);
49
49
  try {
50
50
  for (; ; ) {
51
- const { done: J, value: G } = await x.read();
51
+ const { done: J, value: G } = await D.read();
52
52
  if (J) break;
53
53
  C += G, C = C.replace(/\r\n/g, `
54
54
  `).replace(/\r/g, `
@@ -73,7 +73,7 @@ const Y = ({
73
73
  f.replace(/^retry:\s*/, ""),
74
74
  10
75
75
  );
76
- Number.isNaN(B) || (m = B);
76
+ Number.isNaN(B) || (b = B);
77
77
  }
78
78
  let T, U = !1;
79
79
  if (R.length) {
@@ -85,26 +85,26 @@ const Y = ({
85
85
  T = f;
86
86
  }
87
87
  }
88
- U && (n && await n(T), s && (T = await s(T))), r?.({
88
+ U && (i && await i(T), s && (T = await s(T))), r?.({
89
89
  data: T,
90
90
  event: q,
91
91
  id: h,
92
- retry: m
92
+ retry: b
93
93
  }), R.length && (yield T);
94
94
  }
95
95
  }
96
96
  } finally {
97
- A.removeEventListener("abort", I), x.releaseLock();
97
+ S.removeEventListener("abort", I), D.releaseLock();
98
98
  }
99
99
  break;
100
- } catch (S) {
101
- if (t?.(S), c !== void 0 && y >= c)
100
+ } catch (j) {
101
+ if (t?.(j), c !== void 0 && y >= c)
102
102
  break;
103
- const j = Math.min(
104
- m * 2 ** (y - 1),
105
- i ?? 3e4
103
+ const v = Math.min(
104
+ b * 2 ** (y - 1),
105
+ n ?? 3e4
106
106
  );
107
- await b(j);
107
+ await m(v);
108
108
  }
109
109
  }
110
110
  }() };
@@ -146,28 +146,28 @@ const Y = ({
146
146
  explode: t,
147
147
  name: r,
148
148
  style: s,
149
- value: n
149
+ value: i
150
150
  }) => {
151
151
  if (!t) {
152
- const i = (e ? n : n.map((o) => encodeURIComponent(o))).join(ee(s));
152
+ const n = (e ? i : i.map((o) => encodeURIComponent(o))).join(ee(s));
153
153
  switch (s) {
154
154
  case "label":
155
- return `.${i}`;
155
+ return `.${n}`;
156
156
  case "matrix":
157
- return `;${r}=${i}`;
157
+ return `;${r}=${n}`;
158
158
  case "simple":
159
- return i;
159
+ return n;
160
160
  default:
161
- return `${r}=${i}`;
161
+ return `${r}=${n}`;
162
162
  }
163
163
  }
164
- const l = Z(s), c = n.map((i) => s === "label" || s === "simple" ? e ? i : encodeURIComponent(i) : E({
164
+ const l = Z(s), c = i.map((n) => s === "label" || s === "simple" ? e ? n : encodeURIComponent(n) : P({
165
165
  allowReserved: e,
166
166
  name: r,
167
- value: i
167
+ value: n
168
168
  })).join(l);
169
169
  return s === "label" || s === "matrix" ? l + c : c;
170
- }, E = ({
170
+ }, P = ({
171
171
  allowReserved: e,
172
172
  name: t,
173
173
  value: r
@@ -184,14 +184,14 @@ const Y = ({
184
184
  explode: t,
185
185
  name: r,
186
186
  style: s,
187
- value: n,
187
+ value: i,
188
188
  valueOnly: l
189
189
  }) => {
190
- if (n instanceof Date)
191
- return l ? n.toISOString() : `${r}=${n.toISOString()}`;
190
+ if (i instanceof Date)
191
+ return l ? i.toISOString() : `${r}=${i.toISOString()}`;
192
192
  if (s !== "deepObject" && !t) {
193
193
  let o = [];
194
- Object.entries(n).forEach(([a, h]) => {
194
+ Object.entries(i).forEach(([a, h]) => {
195
195
  o = [
196
196
  ...o,
197
197
  a,
@@ -210,48 +210,48 @@ const Y = ({
210
210
  return d;
211
211
  }
212
212
  }
213
- const c = te(s), i = Object.entries(n).map(
214
- ([o, d]) => E({
213
+ const c = te(s), n = Object.entries(i).map(
214
+ ([o, d]) => P({
215
215
  allowReserved: e,
216
216
  name: s === "deepObject" ? `${r}[${o}]` : o,
217
217
  value: d
218
218
  })
219
219
  ).join(c);
220
- return s === "label" || s === "matrix" ? c + i : i;
220
+ return s === "label" || s === "matrix" ? c + n : n;
221
221
  }, re = /\{[^{}]+\}/g, se = ({ path: e, url: t }) => {
222
222
  let r = t;
223
223
  const s = t.match(re);
224
224
  if (s)
225
- for (const n of s) {
226
- let l = !1, c = n.substring(1, n.length - 1), i = "simple";
227
- c.endsWith("*") && (l = !0, c = c.substring(0, c.length - 1)), c.startsWith(".") ? (c = c.substring(1), i = "label") : c.startsWith(";") && (c = c.substring(1), i = "matrix");
225
+ for (const i of s) {
226
+ let l = !1, c = i.substring(1, i.length - 1), n = "simple";
227
+ c.endsWith("*") && (l = !0, c = c.substring(0, c.length - 1)), c.startsWith(".") ? (c = c.substring(1), n = "label") : c.startsWith(";") && (c = c.substring(1), n = "matrix");
228
228
  const o = e[c];
229
229
  if (o == null)
230
230
  continue;
231
231
  if (Array.isArray(o)) {
232
232
  r = r.replace(
233
- n,
234
- W({ explode: l, name: c, style: i, value: o })
233
+ i,
234
+ W({ explode: l, name: c, style: n, value: o })
235
235
  );
236
236
  continue;
237
237
  }
238
238
  if (typeof o == "object") {
239
239
  r = r.replace(
240
- n,
240
+ i,
241
241
  H({
242
242
  explode: l,
243
243
  name: c,
244
- style: i,
244
+ style: n,
245
245
  value: o,
246
246
  valueOnly: !0
247
247
  })
248
248
  );
249
249
  continue;
250
250
  }
251
- if (i === "matrix") {
251
+ if (n === "matrix") {
252
252
  r = r.replace(
253
- n,
254
- `;${E({
253
+ i,
254
+ `;${P({
255
255
  name: c,
256
256
  value: o
257
257
  })}`
@@ -259,25 +259,25 @@ const Y = ({
259
259
  continue;
260
260
  }
261
261
  const d = encodeURIComponent(
262
- i === "label" ? `.${o}` : o
262
+ n === "label" ? `.${o}` : o
263
263
  );
264
- r = r.replace(n, d);
264
+ r = r.replace(i, d);
265
265
  }
266
266
  return r;
267
- }, ne = ({
267
+ }, ie = ({
268
268
  baseUrl: e,
269
269
  path: t,
270
270
  query: r,
271
271
  querySerializer: s,
272
- url: n
272
+ url: i
273
273
  }) => {
274
- const l = n.startsWith("/") ? n : `/${n}`;
274
+ const l = i.startsWith("/") ? i : `/${i}`;
275
275
  let c = (e ?? "") + l;
276
276
  t && (c = se({ path: t, url: c }));
277
- let i = r ? s(r) : "";
278
- return i.startsWith("?") && (i = i.substring(1)), i && (c += `?${i}`), c;
277
+ let n = r ? s(r) : "";
278
+ return n.startsWith("?") && (n = n.substring(1)), n && (c += `?${n}`), c;
279
279
  };
280
- function ie(e) {
280
+ function ne(e) {
281
281
  const t = e.body !== void 0;
282
282
  if (t && e.bodySerializer)
283
283
  return "serializedBody" in e ? e.serializedBody !== void 0 && e.serializedBody !== "" ? e.serializedBody : null : e.body !== "" ? e.body : null;
@@ -292,43 +292,43 @@ const ae = async (e, t) => {
292
292
  parameters: e = {},
293
293
  ...t
294
294
  } = {}) => (s) => {
295
- const n = [];
295
+ const i = [];
296
296
  if (s && typeof s == "object")
297
297
  for (const l in s) {
298
298
  const c = s[l];
299
299
  if (c == null)
300
300
  continue;
301
- const i = e[l] || t;
301
+ const n = e[l] || t;
302
302
  if (Array.isArray(c)) {
303
303
  const o = W({
304
- allowReserved: i.allowReserved,
304
+ allowReserved: n.allowReserved,
305
305
  explode: !0,
306
306
  name: l,
307
307
  style: "form",
308
308
  value: c,
309
- ...i.array
309
+ ...n.array
310
310
  });
311
- o && n.push(o);
311
+ o && i.push(o);
312
312
  } else if (typeof c == "object") {
313
313
  const o = H({
314
- allowReserved: i.allowReserved,
314
+ allowReserved: n.allowReserved,
315
315
  explode: !0,
316
316
  name: l,
317
317
  style: "deepObject",
318
318
  value: c,
319
- ...i.object
319
+ ...n.object
320
320
  });
321
- o && n.push(o);
321
+ o && i.push(o);
322
322
  } else {
323
- const o = E({
324
- allowReserved: i.allowReserved,
323
+ const o = P({
324
+ allowReserved: n.allowReserved,
325
325
  name: l,
326
326
  value: c
327
327
  });
328
- o && n.push(o);
328
+ o && i.push(o);
329
329
  }
330
330
  }
331
- return n.join("&");
331
+ return i.join("&");
332
332
  }, oe = (e, t) => t ? t in e.headers || e.query?.[t] ? !0 : "Cookie" in e.headers && e.headers.Cookie && typeof e.headers.Cookie == "string" ? e.headers.Cookie.includes(`${t}=`) : !1 : !1, le = async ({
333
333
  security: e,
334
334
  ...t
@@ -339,25 +339,25 @@ const ae = async (e, t) => {
339
339
  const s = await ae(r, t.auth);
340
340
  if (!s)
341
341
  continue;
342
- const n = r.name ?? "Authorization";
342
+ const i = r.name ?? "Authorization";
343
343
  switch (r.in) {
344
344
  case "query":
345
- t.query || (t.query = {}), t.query[n] = s;
345
+ t.query || (t.query = {}), t.query[i] = s;
346
346
  break;
347
347
  case "cookie": {
348
- const l = `${n}=${s}`;
348
+ const l = `${i}=${s}`;
349
349
  "Cookie" in t.headers && t.headers.Cookie ? t.headers.Cookie = `${t.headers.Cookie}; ${l}` : t.headers.Cookie = l;
350
350
  break;
351
351
  }
352
352
  case "header":
353
353
  default:
354
- t.headers[n] = s;
354
+ t.headers[i] = s;
355
355
  break;
356
356
  }
357
357
  }
358
358
  }, N = (e) => {
359
359
  const t = e.axios?.defaults?.baseURL, r = e.baseURL && typeof e.baseURL == "string" ? e.baseURL : t;
360
- return ne({
360
+ return ie({
361
361
  baseUrl: r,
362
362
  path: e.path,
363
363
  // let `paramsSerializer()` handle query params if it exists
@@ -382,20 +382,20 @@ const ae = async (e, t) => {
382
382
  if (!r || typeof r != "object")
383
383
  continue;
384
384
  const s = Object.entries(r);
385
- for (const [n, l] of s)
385
+ for (const [i, l] of s)
386
386
  if (pe.includes(
387
- n
387
+ i
388
388
  ) && typeof l == "object")
389
- t[n] = {
390
- ...t[n],
389
+ t[i] = {
390
+ ...t[i],
391
391
  ...l
392
392
  };
393
393
  else if (l === null)
394
- delete t[n];
394
+ delete t[i];
395
395
  else if (Array.isArray(l))
396
396
  for (const c of l)
397
- t[n] = [...t[n] ?? [], c];
398
- else l !== void 0 && (t[n] = typeof l == "object" ? JSON.stringify(l) : l);
397
+ t[i] = [...t[i] ?? [], c];
398
+ else l !== void 0 && (t[i] = typeof l == "object" ? JSON.stringify(l) : l);
399
399
  }
400
400
  return t;
401
401
  }, V = (e = {}) => ({
@@ -408,7 +408,7 @@ const ae = async (e, t) => {
408
408
  const { auth: d, ...a } = t;
409
409
  r = X.create(a);
410
410
  }
411
- const s = () => ({ ...t }), n = (d) => (t = L(t, d), r.defaults = {
411
+ const s = () => ({ ...t }), i = (d) => (t = L(t, d), r.defaults = {
412
412
  ...r.defaults,
413
413
  ...t,
414
414
  // @ts-expect-error
@@ -429,29 +429,29 @@ const ae = async (e, t) => {
429
429
  }, c = async (d) => {
430
430
  const { opts: a, url: h } = await l(d);
431
431
  try {
432
- const b = a.axios, { auth: w, ...z } = a, m = await b({
432
+ const m = a.axios, { auth: g, ...z } = a, b = await m({
433
433
  ...z,
434
434
  baseURL: "",
435
435
  // the baseURL is already included in `url`
436
- data: ie(a),
436
+ data: ne(a),
437
437
  headers: a.headers,
438
438
  // let `paramsSerializer()` handle query params if it exists
439
439
  params: a.paramsSerializer ? a.query : void 0,
440
440
  url: h
441
441
  });
442
- let { data: y } = m;
442
+ let { data: y } = b;
443
443
  return a.responseType === "json" && (a.responseValidator && await a.responseValidator(y), a.responseTransformer && (y = await a.responseTransformer(y))), {
444
- ...m,
444
+ ...b,
445
445
  data: y ?? {}
446
446
  };
447
- } catch (b) {
448
- const w = b;
447
+ } catch (m) {
448
+ const g = m;
449
449
  if (a.throwOnError)
450
- throw w;
451
- return w.error = w.response?.data ?? {}, w;
450
+ throw g;
451
+ return g.error = g.response?.data ?? {}, g;
452
452
  }
453
- }, i = (d) => (a) => c({ ...a, method: d }), o = (d) => async (a) => {
454
- const { opts: h, url: b } = await l(a);
453
+ }, n = (d) => (a) => c({ ...a, method: d }), o = (d) => async (a) => {
454
+ const { opts: h, url: m } = await l(a);
455
455
  return Y({
456
456
  ...h,
457
457
  body: h.body,
@@ -459,23 +459,23 @@ const ae = async (e, t) => {
459
459
  method: d,
460
460
  // @ts-expect-error
461
461
  signal: h.signal,
462
- url: b
462
+ url: m
463
463
  });
464
464
  };
465
465
  return {
466
466
  buildUrl: N,
467
- connect: i("CONNECT"),
468
- delete: i("DELETE"),
469
- get: i("GET"),
467
+ connect: n("CONNECT"),
468
+ delete: n("DELETE"),
469
+ get: n("GET"),
470
470
  getConfig: s,
471
- head: i("HEAD"),
471
+ head: n("HEAD"),
472
472
  instance: r,
473
- options: i("OPTIONS"),
474
- patch: i("PATCH"),
475
- post: i("POST"),
476
- put: i("PUT"),
473
+ options: n("OPTIONS"),
474
+ patch: n("PATCH"),
475
+ post: n("POST"),
476
+ put: n("PUT"),
477
477
  request: c,
478
- setConfig: n,
478
+ setConfig: i,
479
479
  sse: {
480
480
  connect: o("CONNECT"),
481
481
  delete: o("DELETE"),
@@ -487,14 +487,14 @@ const ae = async (e, t) => {
487
487
  put: o("PUT"),
488
488
  trace: o("TRACE")
489
489
  },
490
- trace: i("TRACE")
490
+ trace: n("TRACE")
491
491
  };
492
- }, u = ue(V()), g = (e) => (e = new Date(e), e), M = (e) => (e.last_active_at && (e.last_active_at = g(e.last_active_at)), e.created_at = g(e.created_at), e.updated_at = g(e.updated_at), e), de = async (e) => (e.list = e.list.map((t) => M(t)), e), he = async (e) => (e = M(e), e), fe = (e) => (e.subscribed_at = g(e.subscribed_at), e), ye = async (e) => (e.list = e.list.map((t) => fe(t)), e), F = (e) => (e.created_at = g(e.created_at), e.updated_at = g(e.updated_at), e), P = (e) => (e = F(e), e), me = (e) => (e = P(e), e), be = async (e) => (e.list = e.list.map((t) => me(t)), e), Te = async (e) => (e = P(e), e), ge = async (e) => (e = P(e), e), we = async (e) => (e = P(e), e), _ = (e) => (e = F(e), e), _e = async (e) => (e.list = e.list.map((t) => _(t)), e), ve = async (e) => (e = _(e), e), Ce = async (e) => (e = _(e), e), Ae = async (e) => (e = _(e), e), Se = async (e) => (e = _(e), e), je = (e) => (e.hour_timestamp = g(e.hour_timestamp), e), Re = async (e) => (e.list = e.list.map((t) => je(t)), e), De = async (e) => (e.list = e.list.map((t) => _(t)), e), Ee = (e) => (e?.client ?? u).get({
492
+ }, u = ue(V()), w = (e) => (e = new Date(e), e), M = (e) => (e.last_active_at && (e.last_active_at = w(e.last_active_at)), e.created_at = w(e.created_at), e.updated_at = w(e.updated_at), e), de = async (e) => (e.list = e.list.map((t) => M(t)), e), he = async (e) => (e = M(e), e), fe = (e) => (e.subscribed_at = w(e.subscribed_at), e), ye = async (e) => (e.list = e.list.map((t) => fe(t)), e), F = (e) => (e.created_at = w(e.created_at), e.updated_at = w(e.updated_at), e), x = (e) => (e = F(e), e), be = (e) => (e = x(e), e), me = async (e) => (e.list = e.list.map((t) => be(t)), e), Te = async (e) => (e = x(e), e), ge = async (e) => (e = x(e), e), we = async (e) => (e = x(e), e), A = (e) => (e = F(e), e), Ae = async (e) => (e.list = e.list.map((t) => A(t)), e), _e = async (e) => (e = A(e), e), Ce = async (e) => (e = A(e), e), Se = async (e) => (e = A(e), e), je = async (e) => (e = A(e), e), ve = async (e) => (e.list = e.list.map((t) => A(t)), e), Re = (e) => (e?.client ?? u).get({
493
493
  responseTransformer: de,
494
494
  responseType: "json",
495
495
  url: "/api/developers",
496
496
  ...e
497
- }), Pe = (e) => (e?.client ?? u).post({
497
+ }), Ee = (e) => (e?.client ?? u).post({
498
498
  responseTransformer: he,
499
499
  responseType: "json",
500
500
  url: "/api/developers",
@@ -503,39 +503,39 @@ const ae = async (e, t) => {
503
503
  "Content-Type": "application/json",
504
504
  ...e?.headers
505
505
  }
506
- }), xe = (e) => (e.client ?? u).delete({ url: "/api/developers/{developer_id}", ...e }), $e = (e) => (e?.client ?? u).get({
506
+ }), Pe = (e) => (e.client ?? u).delete({ url: "/api/developers/{developer_id}", ...e }), xe = (e) => (e?.client ?? u).get({
507
507
  responseType: "json",
508
508
  url: "/api/api_products",
509
509
  ...e
510
- }), ze = (e) => (e.client ?? u).get({
510
+ }), De = (e) => (e.client ?? u).get({
511
511
  responseType: "json",
512
512
  url: "/api/api_products/{api_product_id}",
513
513
  ...e
514
- }), ke = (e) => (e.client ?? u).post({
514
+ }), $e = (e) => (e.client ?? u).post({
515
515
  url: "/api/api_products/{api_product_id}/subscriptions",
516
516
  ...e,
517
517
  headers: {
518
518
  "Content-Type": "application/json",
519
519
  ...e.headers
520
520
  }
521
- }), Ie = (e) => (e?.client ?? u).get({
521
+ }), ze = (e) => (e?.client ?? u).get({
522
522
  responseTransformer: ye,
523
523
  responseType: "json",
524
524
  url: "/api/subscriptions",
525
525
  ...e
526
- }), Oe = (e) => (e?.client ?? u).post({
526
+ }), ke = (e) => (e?.client ?? u).post({
527
527
  url: "/api/subscriptions",
528
528
  ...e,
529
529
  headers: {
530
530
  "Content-Type": "application/json",
531
531
  ...e?.headers
532
532
  }
533
- }), qe = (e) => (e.client ?? u).delete({ url: "/api/subscriptions/{subscription_id}", ...e }), Ue = (e) => (e?.client ?? u).get({
534
- responseTransformer: be,
533
+ }), Ie = (e) => (e.client ?? u).delete({ url: "/api/subscriptions/{subscription_id}", ...e }), Oe = (e) => (e?.client ?? u).get({
534
+ responseTransformer: me,
535
535
  responseType: "json",
536
536
  url: "/api/applications",
537
537
  ...e
538
- }), Be = (e) => (e?.client ?? u).post({
538
+ }), qe = (e) => (e?.client ?? u).post({
539
539
  responseTransformer: Te,
540
540
  responseType: "json",
541
541
  url: "/api/applications",
@@ -544,12 +544,12 @@ const ae = async (e, t) => {
544
544
  "Content-Type": "application/json",
545
545
  ...e?.headers
546
546
  }
547
- }), Ne = (e) => (e.client ?? u).delete({ url: "/api/applications/{application_id}", ...e }), Le = (e) => (e.client ?? u).get({
547
+ }), Ue = (e) => (e.client ?? u).delete({ url: "/api/applications/{application_id}", ...e }), Be = (e) => (e.client ?? u).get({
548
548
  responseTransformer: ge,
549
549
  responseType: "json",
550
550
  url: "/api/applications/{application_id}",
551
551
  ...e
552
- }), We = (e) => (e.client ?? u).put({
552
+ }), Ne = (e) => (e.client ?? u).put({
553
553
  responseTransformer: we,
554
554
  responseType: "json",
555
555
  url: "/api/applications/{application_id}",
@@ -558,13 +558,13 @@ const ae = async (e, t) => {
558
558
  "Content-Type": "application/json",
559
559
  ...e.headers
560
560
  }
561
- }), He = (e) => (e.client ?? u).get({
562
- responseTransformer: _e,
561
+ }), Le = (e) => (e.client ?? u).get({
562
+ responseTransformer: Ae,
563
563
  responseType: "json",
564
564
  url: "/api/applications/{application_id}/credentials",
565
565
  ...e
566
- }), Ve = (e) => (e.client ?? u).post({
567
- responseTransformer: ve,
566
+ }), We = (e) => (e.client ?? u).post({
567
+ responseTransformer: _e,
568
568
  responseType: "json",
569
569
  url: "/api/applications/{application_id}/credentials",
570
570
  ...e,
@@ -572,13 +572,13 @@ const ae = async (e, t) => {
572
572
  "Content-Type": "application/json",
573
573
  ...e.headers
574
574
  }
575
- }), Me = (e) => (e.client ?? u).delete({ url: "/api/applications/{application_id}/credentials/{credential_id}", ...e }), Fe = (e) => (e.client ?? u).get({
575
+ }), He = (e) => (e.client ?? u).delete({ url: "/api/applications/{application_id}/credentials/{credential_id}", ...e }), Ve = (e) => (e.client ?? u).get({
576
576
  responseTransformer: Ce,
577
577
  responseType: "json",
578
578
  url: "/api/applications/{application_id}/credentials/{credential_id}",
579
579
  ...e
580
- }), Je = (e) => (e.client ?? u).put({
581
- responseTransformer: Ae,
580
+ }), Me = (e) => (e.client ?? u).put({
581
+ responseTransformer: Se,
582
582
  responseType: "json",
583
583
  url: "/api/applications/{application_id}/credentials/{credential_id}",
584
584
  ...e,
@@ -586,8 +586,8 @@ const ae = async (e, t) => {
586
586
  "Content-Type": "application/json",
587
587
  ...e.headers
588
588
  }
589
- }), Ge = (e) => (e.client ?? u).put({
590
- responseTransformer: Se,
589
+ }), Fe = (e) => (e.client ?? u).put({
590
+ responseTransformer: je,
591
591
  responseType: "json",
592
592
  url: "/api/applications/{application_id}/credentials/{credential_id}/regenerate",
593
593
  ...e,
@@ -595,37 +595,36 @@ const ae = async (e, t) => {
595
595
  "Content-Type": "application/json",
596
596
  ...e.headers
597
597
  }
598
- }), Ke = (e) => (e.client ?? u).get({
599
- responseTransformer: Re,
598
+ }), Je = (e) => (e.client ?? u).get({
600
599
  responseType: "json",
601
600
  url: "/api/applications/api_calls",
602
601
  ...e
603
- }), Qe = (e) => (e?.client ?? u).get({
604
- responseTransformer: De,
602
+ }), Ge = (e) => (e?.client ?? u).get({
603
+ responseTransformer: ve,
605
604
  responseType: "json",
606
605
  url: "/api/credentials",
607
606
  ...e
608
- }), Xe = (e) => (e.client ?? u).get({
607
+ }), Ke = (e) => (e.client ?? u).get({
609
608
  responseType: "json",
610
609
  url: "/api/labels/{resource_type}",
611
610
  ...e
612
- }), Ye = (e) => (e?.client ?? u).get({
611
+ }), Qe = (e) => (e?.client ?? u).get({
613
612
  responseType: "json",
614
613
  url: "/api/system_settings/public_access",
615
614
  ...e
616
- }), Ze = (e) => (e?.client ?? u).get({
615
+ }), Xe = (e) => (e?.client ?? u).get({
617
616
  responseType: "json",
618
617
  url: "/api/dcr_providers",
619
618
  ...e
620
619
  });
621
- class D extends Error {
622
- constructor(t, r, s, n, l) {
623
- super(t), this.message = t, this.status = r, this.method = s, this.url = n, this.stack = void 0, this.#e = l;
620
+ class E extends Error {
621
+ constructor(t, r, s, i, l) {
622
+ super(t), this.message = t, this.status = r, this.method = s, this.url = i, this.stack = void 0, this.#e = l;
624
623
  }
625
624
  #e;
626
625
  static fromAxiosError = (t) => {
627
626
  const r = t.error && t.error.error_msg;
628
- return new D(
627
+ return new E(
629
628
  `Request failed: ${r || (t.status ? `with status code ${t.status}` : t.message)}`,
630
629
  t.status ?? 0,
631
630
  t.config?.method?.toUpperCase() ?? "",
@@ -638,7 +637,7 @@ class D extends Error {
638
637
  * @param error The error to check.
639
638
  * @returns True if the error is an instance of APIError, false otherwise.
640
639
  */
641
- static isAPIError = (t) => t instanceof D;
640
+ static isAPIError = (t) => t instanceof E;
642
641
  /**
643
642
  * Get the original raw Axios error.
644
643
  * @returns {AxiosError} The original Axios error.
@@ -649,10 +648,10 @@ class D extends Error {
649
648
  }
650
649
  const p = (e) => {
651
650
  if (e.error || e.status && e.status >= 400)
652
- throw D.fromAxiosError(e);
651
+ throw E.fromAxiosError(e);
653
652
  return e.data;
654
653
  };
655
- class et {
654
+ class Ye {
656
655
  constructor(t) {
657
656
  this.client = t;
658
657
  }
@@ -665,7 +664,7 @@ class et {
665
664
  */
666
665
  async create(t, r) {
667
666
  return p(
668
- await Ve({
667
+ await We({
669
668
  client: this.client,
670
669
  path: { application_id: t },
671
670
  body: r
@@ -681,7 +680,7 @@ class et {
681
680
  */
682
681
  async list(t, r) {
683
682
  return p(
684
- await He({
683
+ await Le({
685
684
  client: this.client,
686
685
  path: { application_id: t },
687
686
  query: r
@@ -697,7 +696,7 @@ class et {
697
696
  */
698
697
  async get(t, r) {
699
698
  return p(
700
- await Fe({
699
+ await Ve({
701
700
  client: this.client,
702
701
  path: {
703
702
  application_id: t,
@@ -716,7 +715,7 @@ class et {
716
715
  */
717
716
  async update(t, r, s) {
718
717
  return p(
719
- await Je({
718
+ await Me({
720
719
  client: this.client,
721
720
  path: {
722
721
  application_id: t,
@@ -734,7 +733,7 @@ class et {
734
733
  */
735
734
  async delete(t, r) {
736
735
  return p(
737
- await Me({
736
+ await He({
738
737
  client: this.client,
739
738
  path: {
740
739
  application_id: t,
@@ -753,7 +752,7 @@ class et {
753
752
  */
754
753
  async regenerate(t, r, s) {
755
754
  return p(
756
- await Ge({
755
+ await Fe({
757
756
  client: this.client,
758
757
  path: {
759
758
  application_id: t,
@@ -764,7 +763,7 @@ class et {
764
763
  );
765
764
  }
766
765
  }
767
- class st {
766
+ class tt {
768
767
  constructor(t) {
769
768
  this.client = t;
770
769
  }
@@ -776,16 +775,16 @@ class st {
776
775
  */
777
776
  async list(t) {
778
777
  return p(
779
- await Qe({
778
+ await Ge({
780
779
  client: this.client,
781
780
  query: t
782
781
  })
783
782
  );
784
783
  }
785
784
  }
786
- class nt {
785
+ class rt {
787
786
  constructor(t) {
788
- this.client = t, this.credential = new et(this.client);
787
+ this.client = t, this.credential = new Ye(this.client);
789
788
  }
790
789
  credential;
791
790
  /**
@@ -796,7 +795,7 @@ class nt {
796
795
  */
797
796
  async create(t) {
798
797
  return p(
799
- await Be({
798
+ await qe({
800
799
  client: this.client,
801
800
  body: t
802
801
  })
@@ -810,7 +809,7 @@ class nt {
810
809
  */
811
810
  async list(t) {
812
811
  return p(
813
- await Ue({ client: this.client, query: t })
812
+ await Oe({ client: this.client, query: t })
814
813
  );
815
814
  }
816
815
  /**
@@ -821,7 +820,7 @@ class nt {
821
820
  */
822
821
  async get(t) {
823
822
  return p(
824
- await Le({
823
+ await Be({
825
824
  client: this.client,
826
825
  path: { application_id: t }
827
826
  })
@@ -836,7 +835,7 @@ class nt {
836
835
  */
837
836
  async update(t, r) {
838
837
  return p(
839
- await We({
838
+ await Ne({
840
839
  client: this.client,
841
840
  path: { application_id: t },
842
841
  body: r
@@ -850,7 +849,7 @@ class nt {
850
849
  */
851
850
  async delete(t) {
852
851
  p(
853
- await Ne({
852
+ await Ue({
854
853
  client: this.client,
855
854
  path: { application_id: t }
856
855
  })
@@ -864,14 +863,14 @@ class nt {
864
863
  */
865
864
  async apiCall(t) {
866
865
  return p(
867
- await Ke({
866
+ await Je({
868
867
  client: this.client,
869
868
  query: t
870
869
  })
871
870
  );
872
871
  }
873
872
  }
874
- class it {
873
+ class st {
875
874
  constructor(t) {
876
875
  this.client = t;
877
876
  }
@@ -882,11 +881,11 @@ class it {
882
881
  */
883
882
  async list(t) {
884
883
  return p(
885
- await Ze({ client: this.client, query: t })
884
+ await Xe({ client: this.client, query: t })
886
885
  );
887
886
  }
888
887
  }
889
- class at {
888
+ class it {
890
889
  constructor(t) {
891
890
  this.client = t;
892
891
  }
@@ -897,11 +896,11 @@ class at {
897
896
  */
898
897
  async getPublicAccess() {
899
898
  return p(
900
- await Ye({ client: this.client })
899
+ await Qe({ client: this.client })
901
900
  ).portal_public_access;
902
901
  }
903
902
  }
904
- class ct {
903
+ class nt {
905
904
  constructor(t) {
906
905
  this.client = t;
907
906
  }
@@ -913,11 +912,11 @@ class ct {
913
912
  */
914
913
  async listLabels(t) {
915
914
  return p(
916
- await Xe({ client: this.client, path: { resource_type: t } })
915
+ await Ke({ client: this.client, path: { resource_type: t } })
917
916
  );
918
917
  }
919
918
  }
920
- class ot {
919
+ class at {
921
920
  constructor(t) {
922
921
  this.client = t;
923
922
  }
@@ -929,7 +928,7 @@ class ot {
929
928
  */
930
929
  async create(t) {
931
930
  return p(
932
- await Pe({ client: this.client, body: t })
931
+ await Ee({ client: this.client, body: t })
933
932
  );
934
933
  }
935
934
  /**
@@ -940,7 +939,7 @@ class ot {
940
939
  */
941
940
  async list(t) {
942
941
  return p(
943
- await Ee({ client: this.client, query: t })
942
+ await Re({ client: this.client, query: t })
944
943
  );
945
944
  }
946
945
  /**
@@ -950,11 +949,11 @@ class ot {
950
949
  */
951
950
  async delete(t) {
952
951
  p(
953
- await xe({ client: this.client, path: { developer_id: t } })
952
+ await Pe({ client: this.client, path: { developer_id: t } })
954
953
  );
955
954
  }
956
955
  }
957
- class lt {
956
+ class ct {
958
957
  constructor(t) {
959
958
  this.client = t;
960
959
  }
@@ -966,7 +965,7 @@ class lt {
966
965
  */
967
966
  async list(t) {
968
967
  return p(
969
- await $e({ client: this.client, query: t })
968
+ await xe({ client: this.client, query: t })
970
969
  );
971
970
  }
972
971
  /**
@@ -977,7 +976,7 @@ class lt {
977
976
  */
978
977
  async get(t) {
979
978
  return p(
980
- await ze({
979
+ await De({
981
980
  client: this.client,
982
981
  path: { api_product_id: t }
983
982
  })
@@ -991,7 +990,7 @@ class lt {
991
990
  */
992
991
  async subscribe(t, r) {
993
992
  p(
994
- await ke({
993
+ await $e({
995
994
  client: this.client,
996
995
  path: { api_product_id: t },
997
996
  body: r
@@ -999,7 +998,7 @@ class lt {
999
998
  );
1000
999
  }
1001
1000
  }
1002
- class pt {
1001
+ class ot {
1003
1002
  constructor(t) {
1004
1003
  this.client = t;
1005
1004
  }
@@ -1011,7 +1010,7 @@ class pt {
1011
1010
  */
1012
1011
  async list(t) {
1013
1012
  return p(
1014
- await Ie({ client: this.client, query: t })
1013
+ await ze({ client: this.client, query: t })
1015
1014
  );
1016
1015
  }
1017
1016
  /**
@@ -1022,7 +1021,7 @@ class pt {
1022
1021
  */
1023
1022
  async bulkSubscribe(t) {
1024
1023
  p(
1025
- await Oe({ client: this.client, body: t })
1024
+ await ke({ client: this.client, body: t })
1026
1025
  );
1027
1026
  }
1028
1027
  /**
@@ -1033,7 +1032,7 @@ class pt {
1033
1032
  */
1034
1033
  async unsubscribe(t) {
1035
1034
  p(
1036
- await qe({
1035
+ await Ie({
1037
1036
  client: this.client,
1038
1037
  path: { subscription_id: t }
1039
1038
  })
@@ -1041,14 +1040,14 @@ class pt {
1041
1040
  }
1042
1041
  }
1043
1042
  export {
1044
- lt as A,
1045
- st as C,
1046
- it as D,
1047
- ct as M,
1048
- pt as S,
1049
- nt as a,
1050
- ot as b,
1043
+ ct as A,
1044
+ tt as C,
1045
+ st as D,
1046
+ nt as M,
1047
+ ot as S,
1048
+ rt as a,
1049
+ at as b,
1051
1050
  ue as c,
1052
- at as d,
1053
- D as e
1051
+ it as d,
1052
+ E as e
1054
1053
  };