bt-core-app 1.4.255 → 1.4.257

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.
@@ -7147,7 +7147,7 @@ function xb(e) {
7147
7147
  if (k != null && (e.api == null || parseFloat(k.meta.storedOn) > t - 7))
7148
7148
  return n.value[u] = k, k;
7149
7149
  }
7150
- if (e.api == null)
7150
+ if (e.api == null || h.localOnly)
7151
7151
  return n.value[u];
7152
7152
  try {
7153
7153
  let k = a.value[u];
@@ -7188,7 +7188,7 @@ function xb(e) {
7188
7188
  if (x != null && (e.api == null || parseFloat(((k = x.meta) == null ? void 0 : k.storedOn) ?? "0") > t - 7))
7189
7189
  return n.value[u] = x, { data: x.data };
7190
7190
  }
7191
- if (e.api == null)
7191
+ if (e.api == null || h.localOnly)
7192
7192
  return n.value[u];
7193
7193
  try {
7194
7194
  let x = a.value[u];
@@ -7218,7 +7218,7 @@ function xb(e) {
7218
7218
  h.additionalUrl ?? (h.additionalUrl = "/patch"), l(h);
7219
7219
  const u = i(h);
7220
7220
  let g;
7221
- if (e.api != null)
7221
+ if (e.api != null && h.localOnly !== !0)
7222
7222
  try {
7223
7223
  let x = await e.api.patch(h);
7224
7224
  g = x == null ? void 0 : x.data;
@@ -7248,7 +7248,7 @@ function xb(e) {
7248
7248
  h.additionalUrl ?? (h.additionalUrl = "/post"), l(h);
7249
7249
  const u = i(h);
7250
7250
  let g;
7251
- if (e.api != null)
7251
+ if (e.api != null && h.localOnly !== !0)
7252
7252
  try {
7253
7253
  let k = await e.api.post(h);
7254
7254
  g = k == null ? void 0 : k.data;
@@ -7270,7 +7270,7 @@ function xb(e) {
7270
7270
  var k;
7271
7271
  h.additionalUrl ?? (h.additionalUrl = "/delete"), l(h);
7272
7272
  const u = i(h);
7273
- if (e.api != null)
7273
+ if (e.api != null && h.localOnly !== !0)
7274
7274
  try {
7275
7275
  let x = await e.api.deleteItem(h);
7276
7276
  if (x != null)
@@ -7291,7 +7291,7 @@ function xb(e) {
7291
7291
  }), r == !0 && await Sn().removeItem(u);
7292
7292
  }
7293
7293
  async function m(h) {
7294
- if (h.additionalUrl ?? (h.additionalUrl = `/patch/restore?id=${h.data.id}`), l(h), e.api != null)
7294
+ if (h.additionalUrl ?? (h.additionalUrl = `/patch/restore?id=${h.data.id}`), l(h), e.api != null && h.localOnly !== !0)
7295
7295
  try {
7296
7296
  let u = await e.api.patch(h);
7297
7297
  return u == null ? void 0 : u.data;
@@ -7381,7 +7381,7 @@ function gd(e) {
7381
7381
  filters: []
7382
7382
  };
7383
7383
  }
7384
- if (e.api == null)
7384
+ if (e.api == null || k.localOnly)
7385
7385
  return {
7386
7386
  count: (w = t.value) == null ? void 0 : w.length,
7387
7387
  data: t.value ?? [],
@@ -7419,7 +7419,7 @@ function gd(e) {
7419
7419
  return { data: D };
7420
7420
  }
7421
7421
  }
7422
- if (e.api == null)
7422
+ if (e.api == null || k.localOnly)
7423
7423
  return {
7424
7424
  data: (p = t.value) == null ? void 0 : p.find((_) => _.id == k.id)
7425
7425
  };
@@ -7435,7 +7435,7 @@ function gd(e) {
7435
7435
  var C, T, M;
7436
7436
  k.additionalUrl ?? (k.additionalUrl = "/patch");
7437
7437
  let x;
7438
- if (e.api != null)
7438
+ if (e.api != null && k.localOnly !== !0)
7439
7439
  try {
7440
7440
  let w = await e.api.patch(k);
7441
7441
  x = { ...k.data, ...w == null ? void 0 : w.data };
@@ -7455,7 +7455,7 @@ function gd(e) {
7455
7455
  var C, T;
7456
7456
  k.additionalUrl ?? (k.additionalUrl = "/post");
7457
7457
  let x;
7458
- if (e.api != null)
7458
+ if (e.api != null && k.localOnly !== !0)
7459
7459
  try {
7460
7460
  let M = await e.api.post(k);
7461
7461
  x = M == null ? void 0 : M.data;
@@ -7469,7 +7469,7 @@ function gd(e) {
7469
7469
  }
7470
7470
  async function u(k) {
7471
7471
  var C, T;
7472
- if (k.additionalUrl ?? (k.additionalUrl = "/delete"), e.api != null)
7472
+ if (k.additionalUrl ?? (k.additionalUrl = "/delete"), e.api != null && k.localOnly !== !0)
7473
7473
  try {
7474
7474
  let M = await e.api.deleteItem(k);
7475
7475
  if (M != null)
@@ -7486,7 +7486,7 @@ function gd(e) {
7486
7486
  }
7487
7487
  async function g(k) {
7488
7488
  var x;
7489
- if (k.additionalUrl ?? (k.additionalUrl = `/patch/restore?id=${k.data.id}`), e.api != null)
7489
+ if (k.additionalUrl ?? (k.additionalUrl = `/patch/restore?id=${k.data.id}`), e.api != null && k.localOnly !== !0)
7490
7490
  try {
7491
7491
  await e.api.patch(k);
7492
7492
  } catch (C) {
@@ -7897,6 +7897,7 @@ function lm(e) {
7897
7897
  apiPost: c,
7898
7898
  clearErrors: a,
7899
7899
  deleteItem: s,
7900
+ // deleteLocalItem,
7900
7901
  doAction: l,
7901
7902
  getAllItems: d,
7902
7903
  getItem: o,
package/dist/index.d.ts CHANGED
@@ -1066,6 +1066,7 @@ export declare type StoreMode = 'whole-last-updated' | 'partial-last-updated' |
1066
1066
 
1067
1067
  declare interface StorePathOptions extends PathOptions {
1068
1068
  /**will store this request in session as a special memory in the pinia store */
1069
+ localOnly?: boolean;
1069
1070
  storeKey?: string;
1070
1071
  }
1071
1072
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bt-core-app",
3
- "version": "1.4.255",
3
+ "version": "1.4.257",
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": {