bt-core-app 1.4.874 → 1.4.876

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.
@@ -8256,15 +8256,15 @@ function TL(e) {
8256
8256
  let b = Ct(m.url) ?? void 0, p = Ct(m.id);
8257
8257
  return b == null && (e == null ? void 0 : e.findPath) != null && (b = e.findPath(m.nav)), m.additionalUrl != null && (b == null ? b = m.additionalUrl : b = pn(b, m.additionalUrl)), p != null && (b != null && b.includes("{id}") ? b = b.replaceAll("{id}", p) : b = pn(b, p)), m.params != null && (b = `${b}?${a(m.params)}`), m.finalUrl = b, m.finalUrl ?? "";
8258
8258
  }
8259
- function o(m) {
8260
- var p, C;
8261
- let b = { ...m.headers };
8262
- return m.proxyID && (b.ManagedCompanyAccountID ?? (b.ManagedCompanyAccountID = m.proxyID)), (e == null ? void 0 : e.useBearerToken) != !1 && ((p = e == null ? void 0 : e.auth) == null ? void 0 : p.isLoggedIn.value) == !0 && (b.authorization ?? (b.authorization = `bearer ${(C = e == null ? void 0 : e.auth) == null ? void 0 : C.credentials.value.token}`)), b["Content-Type"] ?? (b["Content-Type"] = m.contentType ?? (e == null ? void 0 : e.defaultContentType) ?? "application/json"), b;
8259
+ function o(m, b) {
8260
+ var C, k;
8261
+ let p = { ...m.headers };
8262
+ return m.proxyID && (p.ManagedCompanyAccountID ?? (p.ManagedCompanyAccountID = m.proxyID)), (b == null ? void 0 : b.useBearerToken) != !1 && ((C = b == null ? void 0 : b.auth) == null ? void 0 : C.isLoggedIn.value) == !0 && (p.authorization ?? (p.authorization = `bearer ${(k = b == null ? void 0 : b.auth) == null ? void 0 : k.credentials.value.token}`)), p["Content-Type"] ?? (p["Content-Type"] = m.contentType ?? (b == null ? void 0 : b.defaultContentType) ?? "application/json"), p;
8263
8263
  }
8264
8264
  async function s(m) {
8265
8265
  var C;
8266
8266
  let b = m.finalUrl, p = m.headers;
8267
- return b == null && (b = n(m)), l != null && l.isDemoing.value ? (console.log(`DEMO: Get from ${b}`), l.get(m)) : (console.log(`Get from ${b}`), await ((C = e == null ? void 0 : e.auth) == null ? void 0 : C.tryRefreshToken()), m.overrideHeaders !== !0 && (p = t(m)), fetch(b, {
8267
+ return b == null && (b = n(m)), l != null && l.isDemoing.value ? (console.log(`DEMO: Get from ${b}`), l.get(m)) : (console.log(`Get from ${b}`), await ((C = e == null ? void 0 : e.auth) == null ? void 0 : C.tryRefreshToken()), m.overrideHeaders !== !0 && (p = t(m, e)), fetch(b, {
8268
8268
  method: "GET",
8269
8269
  mode: "cors",
8270
8270
  cache: "no-cache",
@@ -8280,7 +8280,7 @@ function TL(e) {
8280
8280
  try {
8281
8281
  if (l != null && l.isDemoing.value)
8282
8282
  return console.log(`DEMO: Get from ${k}`), l.get(m);
8283
- if (console.log(`Get from ${k}`), await ((S = e == null ? void 0 : e.auth) == null ? void 0 : S.tryRefreshToken()), m.overrideHeaders !== !0 && (w = t(m)), x = await fetch(k, {
8283
+ if (console.log(`Get from ${k}`), await ((S = e == null ? void 0 : e.auth) == null ? void 0 : S.tryRefreshToken()), m.overrideHeaders !== !0 && (w = t(m, e)), x = await fetch(k, {
8284
8284
  method: "GET",
8285
8285
  mode: "cors",
8286
8286
  cache: "no-cache",
@@ -8324,7 +8324,7 @@ function TL(e) {
8324
8324
  try {
8325
8325
  if (l != null && l.isDemoing.value)
8326
8326
  return console.log(`DEMO: Get all from ${k}`), l.getAll(m);
8327
- if (console.log(`Get all from ${k}`), await ((S = e == null ? void 0 : e.auth) == null ? void 0 : S.tryRefreshToken()), m.overrideHeaders !== !0 && (w = t(m)), x = await fetch(k, {
8327
+ if (console.log(`Get all from ${k}`), await ((S = e == null ? void 0 : e.auth) == null ? void 0 : S.tryRefreshToken()), m.overrideHeaders !== !0 && (w = t(m, e)), x = await fetch(k, {
8328
8328
  method: "GET",
8329
8329
  mode: "cors",
8330
8330
  cache: "no-cache",
@@ -8368,7 +8368,7 @@ function TL(e) {
8368
8368
  try {
8369
8369
  if (l != null && l.isDemoing.value)
8370
8370
  return console.log(`DEMO: Post to ${k}`), l.post(m);
8371
- if (console.log(`Post to ${k}`), await ((S = e == null ? void 0 : e.auth) == null ? void 0 : S.tryRefreshToken()), m.overrideHeaders !== !0 && (w = t(m)), x = await fetch(k, {
8371
+ if (console.log(`Post to ${k}`), await ((S = e == null ? void 0 : e.auth) == null ? void 0 : S.tryRefreshToken()), m.overrideHeaders !== !0 && (w = t(m, e)), x = await fetch(k, {
8372
8372
  method: "POST",
8373
8373
  mode: "cors",
8374
8374
  cache: "no-cache",
@@ -8413,7 +8413,7 @@ function TL(e) {
8413
8413
  try {
8414
8414
  if (l != null && l.isDemoing.value)
8415
8415
  return console.log(`DEMO: Patch to ${k}`), l.patch(m);
8416
- if (console.log(`Patch to ${k}`), await ((S = e == null ? void 0 : e.auth) == null ? void 0 : S.tryRefreshToken()), m.overrideHeaders !== !0 && (w = t(m)), x = await fetch(k, {
8416
+ if (console.log(`Patch to ${k}`), await ((S = e == null ? void 0 : e.auth) == null ? void 0 : S.tryRefreshToken()), m.overrideHeaders !== !0 && (w = t(m, e)), x = await fetch(k, {
8417
8417
  method: "PATCH",
8418
8418
  mode: "cors",
8419
8419
  cache: "no-cache",
@@ -8458,7 +8458,7 @@ function TL(e) {
8458
8458
  try {
8459
8459
  if (l != null && l.isDemoing.value)
8460
8460
  return console.log(`DEMO: Delete ${p}`), l.deleteItem(m);
8461
- if (console.log(`Delete to ${p}`), await ((w = e == null ? void 0 : e.auth) == null ? void 0 : w.tryRefreshToken()), m.overrideHeaders !== !0 && (C = t(m)), k = await fetch(p, {
8461
+ if (console.log(`Delete to ${p}`), await ((w = e == null ? void 0 : e.auth) == null ? void 0 : w.tryRefreshToken()), m.overrideHeaders !== !0 && (C = t(m, e)), k = await fetch(p, {
8462
8462
  method: "DELETE",
8463
8463
  mode: "cors",
8464
8464
  cache: "no-cache",
@@ -8490,7 +8490,7 @@ function TL(e) {
8490
8490
  var S;
8491
8491
  const b = m.throwError ?? (e == null ? void 0 : e.defaultThrowError) ?? !0, p = m.returnJson ?? (e == null ? void 0 : e.defaultReturnJson) ?? !0, C = m.returnText ?? (e == null ? void 0 : e.defaultReturnText) ?? !1;
8492
8492
  let k = m.finalUrl, w = m.headers;
8493
- if (k == null && (k = n(m)), m.overrideHeaders !== !0 && (w = t(m)), l != null && l.isDemoing.value)
8493
+ if (k == null && (k = n(m)), m.overrideHeaders !== !0 && (w = t(m, e)), l != null && l.isDemoing.value)
8494
8494
  return console.log(`DEMO: Uploading image to ${k}`), l.post(m);
8495
8495
  console.log(`Upload image to ${k}`);
8496
8496
  let x;
@@ -8529,7 +8529,7 @@ function TL(e) {
8529
8529
  let p = m.finalUrl, C = m.headers;
8530
8530
  p == null && (p = n(m));
8531
8531
  try {
8532
- return l != null && l.isDemoing.value ? (console.log(`DEMO: Get from ${p}`), l.get(m)) : (console.log(`Get from ${p}`), await ((k = e == null ? void 0 : e.auth) == null ? void 0 : k.tryRefreshToken()), m.overrideHeaders !== !0 && (C = t(m)), await fetch(p, {
8532
+ return l != null && l.isDemoing.value ? (console.log(`DEMO: Get from ${p}`), l.get(m)) : (console.log(`Get from ${p}`), await ((k = e == null ? void 0 : e.auth) == null ? void 0 : k.tryRefreshToken()), m.overrideHeaders !== !0 && (C = t(m, e)), await fetch(p, {
8533
8533
  method: m.method,
8534
8534
  mode: "cors",
8535
8535
  cache: "no-cache",
@@ -36621,7 +36621,7 @@ const xm = lt()({
36621
36621
  set(g) {
36622
36622
  n("update:modelValue", g), n("select", g);
36623
36623
  }
36624
- }), r = Qe("isEditing", () => G(!1), !0), i = T(() => a.isEditing ?? r.value), o = Qe("isMobile", () => G(!1), !0), s = Qe("viewVariant", "underlined"), c = T(() => s.value == "list-item" ? "underlined" : s), u = Qe("editVariant", "outlined"), d = T(() => a.isMobile ?? o.value ? !1 : a.lg), v = T(() => a.isMobile ?? o.value ? !1 : a.md), f = T(() => a.isMobile ?? o.value ? !1 : a.sm);
36624
+ }), r = Qe("isEditing", () => G(!1), !0), i = T(() => a.isEditing ?? r.value), o = Qe("isMobile", () => G(!1), !0), s = Qe("viewVariant", "underlined"), c = T(() => s == "list-item" ? "underlined" : s), u = Qe("editVariant", "outlined"), d = T(() => a.isMobile ?? o.value ? !1 : a.lg), v = T(() => a.isMobile ?? o.value ? !1 : a.md), f = T(() => a.isMobile ?? o.value ? !1 : a.sm);
36625
36625
  return (g, h) => {
36626
36626
  const m = gn("bt-select");
36627
36627
  return N(), ue(Tt, {
package/dist/index.d.ts CHANGED
@@ -198,7 +198,7 @@ export declare interface BTActions {
198
198
  }
199
199
 
200
200
  export declare interface BTApi {
201
- buildHeaders: (options: PathOptions) => HeadersInit;
201
+ buildHeaders: (options: PathOptions, createOptions?: UseApiOptions) => HeadersInit;
202
202
  buildQuery: (params: any) => string;
203
203
  buildUrl: (path: PathOptions) => string;
204
204
  deleteItem: <T>(pathOptions: PathOptions) => Promise<T | undefined>;
@@ -1747,7 +1747,7 @@ export declare function useApi(): BTApi;
1747
1747
  export declare interface UseApiOptions {
1748
1748
  auth?: BTAuth;
1749
1749
  /**overrides the default */
1750
- buildHeaders?: (path: PathOptions) => HeadersInit;
1750
+ buildHeaders?: (path: PathOptions, createOptions?: UseApiOptions) => HeadersInit;
1751
1751
  /**build a query. Overrides the default */
1752
1752
  buildQuery?: (params: any) => string;
1753
1753
  /**overrides the default */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-core-app",
3
- "version": "1.4.874",
3
+ "version": "1.4.876",
4
4
  "description": "Core app tools for some basic features like navigation, authentication, server apis, and cosmetics",
5
5
  "homepage": "https://github.com/BlitzItTech/bt-core",
6
6
  "bugs": {