@vuetify/one 2.12.0 → 2.13.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.
@@ -1,8 +1,8 @@
1
1
  import { merge as k } from "lodash-es";
2
2
  import { defineStore as O } from "pinia";
3
- import { ref as b, reactive as Y, watch as A, toRefs as G, computed as p, shallowRef as N, toRef as C, nextTick as K } from "vue";
4
- import { useRoute as Z, useRouter as V } from "vue-router";
5
- const B = O("queue", () => {
3
+ import { ref as b, reactive as G, watch as T, toRefs as K, computed as m, shallowRef as P, toRef as N, nextTick as Z } from "vue";
4
+ import { useRoute as D, useRouter as z } from "vue-router";
5
+ const F = O("queue", () => {
6
6
  const e = b([]);
7
7
  function s(o) {
8
8
  const n = typeof o == "string" ? { text: o } : o;
@@ -29,14 +29,14 @@ const B = O("queue", () => {
29
29
  showError: r,
30
30
  showSuccess: i
31
31
  };
32
- }), D = [
32
+ }), ee = [
33
33
  (e) => (e.v || (e.pwaRefresh = !0, typeof e.api == "boolean" && (e.api = e.api ? "inline" : "link-only"), typeof e.rtl == "boolean" && (e.direction = e.rtl ? "rtl" : "ltr", delete e.rtl), typeof e.theme == "object" && (e.mixedTheme = e.theme.mixed, e.theme = e.theme.system ? "system" : e.theme.dark ? "dark" : "light"), Array.isArray(e.notifications) && (e.notifications = { read: e.notifications }), typeof e.last == "object" && (e.notifications = e.notifications || {}, e.notifications.last = e.last, delete e.last), e.v = 1), e),
34
34
  (e) => (e.v === 1 && (Array.isArray(e.composition) && (e.composition = "composition"), Array.isArray(e.notifications?.last?.banner) || (e.notifications = e.notifications || {}, e.notifications.last = e.notifications.last || {}, e.notifications.last.banner = []), e.v = 2), e),
35
35
  (e) => (e.v === 2 && (e.syncSettings = !0, e.disableAds = !1, e.v = 3), e),
36
36
  (e) => (e.v === 3 && (e.quickbar = !1, e.v = 4), e),
37
37
  (e) => (e.v === 4 && (e.suits = { show: !1, elements: ["app-bar"], suit: "" }, e.notifications = e.notifications || {}, e.notifications.banners = !0, e.v = 5), e)
38
38
  ];
39
- function ee(e) {
39
+ function te(e) {
40
40
  return {
41
41
  version: 6,
42
42
  ecosystem: {
@@ -95,7 +95,7 @@ function ee(e) {
95
95
  }
96
96
  };
97
97
  }
98
- function F(e) {
98
+ function Q(e) {
99
99
  return {
100
100
  ...e,
101
101
  version: 7,
@@ -107,11 +107,11 @@ function F(e) {
107
107
  }
108
108
  };
109
109
  }
110
- function te(e) {
111
- const s = D.reduce((i, o) => o(i), e), r = ee(s);
112
- return F(r);
110
+ function se(e) {
111
+ const s = ee.reduce((i, o) => o(i), e), r = te(s);
112
+ return Q(r);
113
113
  }
114
- const H = typeof window < "u", g = {
114
+ const J = typeof window < "u", g = {
115
115
  version: 7,
116
116
  ecosystem: {
117
117
  bin: {
@@ -174,33 +174,33 @@ const H = typeof window < "u", g = {
174
174
  sync: !0,
175
175
  devmode: !1
176
176
  }
177
- }, se = O("user", () => {
178
- const e = Y(structuredClone(g));
179
- A(e, r, { deep: !0 });
177
+ }, re = O("user", () => {
178
+ const e = G(structuredClone(g));
179
+ T(e, r, { deep: !0 });
180
180
  function s() {
181
- if (!H)
181
+ if (!J)
182
182
  return;
183
183
  const o = localStorage.getItem("vuetify@user");
184
184
  if (o)
185
185
  try {
186
186
  const n = JSON.parse(o);
187
187
  if (n.version >= 7) {
188
- const u = {
188
+ const c = {
189
189
  version: 7,
190
190
  ecosystem: k(structuredClone(g.ecosystem), n.ecosystem || {}),
191
191
  one: k(structuredClone(g.one), n.one || {})
192
192
  };
193
- Object.assign(e, u);
193
+ Object.assign(e, c);
194
194
  } else if (n.version === 6) {
195
- const u = F(n), y = {
195
+ const c = Q(n), h = {
196
196
  version: 7,
197
- ecosystem: k(structuredClone(g.ecosystem), u.ecosystem || {}),
198
- one: k(structuredClone(g.one), u.one || {})
197
+ ecosystem: k(structuredClone(g.ecosystem), c.ecosystem || {}),
198
+ one: k(structuredClone(g.one), c.one || {})
199
199
  };
200
- Object.assign(e, y);
200
+ Object.assign(e, h);
201
201
  } else {
202
- const u = te(n);
203
- Object.assign(e, u);
202
+ const c = se(n);
203
+ Object.assign(e, c);
204
204
  }
205
205
  r();
206
206
  } catch (n) {
@@ -208,18 +208,18 @@ const H = typeof window < "u", g = {
208
208
  }
209
209
  }
210
210
  function r() {
211
- H && localStorage.setItem("vuetify@user", JSON.stringify(e, null, 2));
211
+ J && localStorage.setItem("vuetify@user", JSON.stringify(e, null, 2));
212
212
  }
213
213
  function i() {
214
- H && (Object.assign(e, structuredClone(g)), r());
214
+ J && (Object.assign(e, structuredClone(g)), r());
215
215
  }
216
216
  return s(), {
217
- ...G(e),
217
+ ...K(e),
218
218
  load: s,
219
219
  save: r,
220
220
  reset: i
221
221
  };
222
- }), Q = O("http", {
222
+ }), V = O("http", {
223
223
  state: () => ({
224
224
  url: ""
225
225
  }),
@@ -269,34 +269,34 @@ const H = typeof window < "u", g = {
269
269
  }
270
270
  }
271
271
  });
272
- function z() {
273
- const e = Z();
274
- return p(
272
+ function M() {
273
+ const e = D();
274
+ return m(
275
275
  () => e.query
276
276
  );
277
277
  }
278
- const M = O("one", () => {
279
- const e = z(), s = V(), r = X(), i = Q(), o = B(), n = N(!1), u = N(!1), y = b(null), v = b([]), S = p(() => e.value.session_id), R = p(() => y.value?.items[0].plan.interval), q = p(() => y.value?.items[0].plan.type), I = b([]), d = p(() => r.user?.sponsorships.find((t) => t.platform === "stripe" && t.tierName.startsWith("sub_"))), E = p(() => !!d.value?.tierName), a = p(() => r.user?.sponsorships.reduce((t, l) => {
280
- if (!l.isActive || l.interval === "once")
278
+ const X = O("one", () => {
279
+ const e = M(), s = z(), r = Y(), i = V(), o = F(), n = P(!1), c = P(!1), h = b(null), y = b([]), S = m(() => e.value.session_id), R = m(() => h.value?.items[0].plan.interval), q = m(() => h.value?.items[0].plan.type), I = b([]), p = m(() => r.user?.sponsorships.find((t) => t.platform === "stripe" && t.tierName.startsWith("sub_"))), E = m(() => !!p.value?.tierName), a = m(() => r.user?.sponsorships.reduce((t, u) => {
280
+ if (!u.isActive || u.interval === "once")
281
281
  return t;
282
- const m = l.interval === "month" ? l.amount : l.amount / 12;
283
- return t + m / 100;
284
- }, 0) ?? 0), T = p(() => r.user?.sponsorships.find((t) => t.tierName.startsWith("sub_") && t.isActive)), P = p(() => r.user?.sponsorships.find((t) => t.platform === "github" && t.isActive)), U = p(() => r.user?.sponsorships.find((t) => t.platform === "discord" && t.isActive)), x = p(() => r.user?.sponsorships.find((t) => t.platform === "opencollective" && t.isActive)), c = p(() => r.user?.identities.find((t) => t.provider === "shopify")), h = p(() => !i.url || r.isAdmin || d.value?.isActive || I.value.some((t) => ["one", "one/team"].includes(t)));
285
- A(u, L), A(S, async (t) => {
282
+ const v = u.interval === "month" ? u.amount : u.amount / 12;
283
+ return t + v / 100;
284
+ }, 0) ?? 0), A = m(() => r.user?.sponsorships.find((t) => t.tierName.startsWith("sub_") && t.isActive)), U = m(() => r.user?.sponsorships.find((t) => t.platform === "github" && t.isActive)), W = m(() => r.user?.sponsorships.find((t) => t.platform === "discord" && t.isActive)), x = m(() => r.user?.sponsorships.find((t) => t.platform === "opencollective" && t.isActive)), l = m(() => r.user?.identities.find((t) => t.provider === "shopify")), d = m(() => !i.url || r.isAdmin || p.value?.isActive || I.value.some((t) => ["one", "one/team"].includes(t)));
285
+ T(c, L), T(S, async (t) => {
286
286
  t && await f();
287
- }, { immediate: !0 }), A(e, (t) => {
287
+ }, { immediate: !0 }), T(e, (t) => {
288
288
  if (t.one !== "subscribe" || r.user)
289
289
  return;
290
290
  r.dialog = !0;
291
- const l = A(() => r.user, (m) => {
292
- m && (r.dialog = !1, l());
291
+ const u = T(() => r.user, (v) => {
292
+ v && (r.dialog = !1, u());
293
293
  });
294
294
  }, { immediate: !0 });
295
295
  async function f() {
296
296
  try {
297
297
  n.value = !0, await i.post("/one/activate", { sessionId: S.value }), await r.verify(!0), await j();
298
- const t = new URL(window.location.href), l = t.searchParams;
299
- l.delete("session_id"), l.delete("team"), history.pushState(null, "", t.toString());
298
+ const t = new URL(window.location.href), u = t.searchParams;
299
+ u.delete("session_id"), u.delete("team"), history.pushState(null, "", t.toString());
300
300
  } catch (t) {
301
301
  o.showError(t?.message ?? "Error activating subscription, Please contact support");
302
302
  } finally {
@@ -306,16 +306,16 @@ const M = O("one", () => {
306
306
  async function $() {
307
307
  window.open(`${i.url}/one/manage`, "_blank");
308
308
  }
309
- async function W(t, l) {
309
+ async function _(t, u) {
310
310
  n.value = !0;
311
- const m = new URL("/one/subscribe", i.url);
312
- m.searchParams.set("interval", t), m.searchParams.set("type", l), window.location.href = m.toString();
311
+ const v = new URL("/one/subscribe", i.url);
312
+ v.searchParams.set("interval", t), v.searchParams.set("type", u), window.location.href = v.toString();
313
313
  }
314
- async function _() {
315
- if (d.value)
314
+ async function H() {
315
+ if (p.value)
316
316
  try {
317
317
  n.value = !0, await i.post(
318
- `/one/cancel?subscriptionId=${d.value?.tierName}`
318
+ `/one/cancel?subscriptionId=${p.value?.tierName}`
319
319
  ), await r.verify(!0);
320
320
  } catch (t) {
321
321
  o.showError(t?.message ?? "Error cancelling subscription, Please contact support");
@@ -323,16 +323,16 @@ const M = O("one", () => {
323
323
  n.value = !1;
324
324
  }
325
325
  }
326
- async function w(t, l) {
327
- if (d.value)
326
+ async function w(t, u) {
327
+ if (p.value)
328
328
  try {
329
329
  n.value = !0, await i.post("/one/modify", {
330
- subscriptionId: d.value.tierName,
330
+ subscriptionId: p.value.tierName,
331
331
  interval: t,
332
- type: l
332
+ type: u
333
333
  }), await r.verify(!0);
334
- } catch (m) {
335
- o.showError(m?.message ?? "Error modifying subscription");
334
+ } catch (v) {
335
+ o.showError(v?.message ?? "Error modifying subscription");
336
336
  } finally {
337
337
  n.value = !1;
338
338
  }
@@ -341,13 +341,22 @@ const M = O("one", () => {
341
341
  try {
342
342
  n.value = !0;
343
343
  const t = await i.get("/one/info");
344
- return y.value = t.subscription, v.value = t.invoices, t;
344
+ return h.value = t.subscription, y.value = t.invoices, t;
345
345
  } catch (t) {
346
346
  o.showError(t?.message ?? "Error fetching subscription info");
347
347
  } finally {
348
348
  n.value = !1;
349
349
  }
350
350
  }
351
+ async function C() {
352
+ try {
353
+ return n.value = !0, await i.get("/one/activity");
354
+ } catch (t) {
355
+ o.showError(t?.message ?? "Error fetching recent activity");
356
+ } finally {
357
+ n.value = !1;
358
+ }
359
+ }
351
360
  function L() {
352
361
  s.push({
353
362
  query: {
@@ -357,44 +366,45 @@ const M = O("one", () => {
357
366
  });
358
367
  }
359
368
  return {
360
- info: y,
369
+ info: h,
361
370
  interval: R,
362
371
  subscriptionType: q,
363
372
  access: I,
364
- invoices: v,
373
+ invoices: y,
365
374
  sessionId: S,
366
- subscription: d,
375
+ subscription: p,
367
376
  monthlyTotal: a,
377
+ recentActivity: C,
368
378
  hasBilling: E,
369
379
  isLoading: n,
370
- isOpen: u,
371
- isSubscriber: h,
380
+ isOpen: c,
381
+ isSubscriber: d,
372
382
  opencollective: x,
373
- github: P,
374
- discord: U,
375
- shopify: c,
376
- one: T,
383
+ github: U,
384
+ discord: W,
385
+ shopify: l,
386
+ one: A,
377
387
  activate: f,
378
- cancel: _,
388
+ cancel: H,
379
389
  manage: $,
380
390
  modify: w,
381
391
  resetQuery: L,
382
- subscribe: W,
392
+ subscribe: _,
383
393
  subscriptionInfo: j
384
394
  };
385
- }), re = O("team", () => {
386
- const e = z(), s = X(), r = M(), i = Q(), o = B(), n = N(!1), u = b(null), y = b(!1), v = p(() => e.value.invite), S = p(
387
- () => u.value ? r.access?.some((a) => ["one/team", "snips/team"].includes(a)) : !1
395
+ }), ne = O("team", () => {
396
+ const e = M(), s = Y(), r = X(), i = V(), o = F(), n = P(!1), c = b(null), h = b(!1), y = m(() => e.value.invite), S = m(
397
+ () => c.value ? r.access?.some((a) => ["one/team", "snips/team"].includes(a)) : !1
388
398
  );
389
- A(v, async () => {
390
- if (v.value) {
399
+ T(y, async () => {
400
+ if (y.value) {
391
401
  s.user || (s.dialog = !0);
392
402
  try {
393
403
  n.value = !0;
394
- const a = await i.get(`/one/team/${v.value}`);
395
- u.value = a.team, y.value = !0;
404
+ const a = await i.get(`/one/team/${y.value}`);
405
+ c.value = a.team, h.value = !0;
396
406
  } catch (a) {
397
- d(), o.showError(a.message);
407
+ p(), o.showError(a.message);
398
408
  } finally {
399
409
  n.value = !1;
400
410
  }
@@ -402,18 +412,18 @@ const M = O("one", () => {
402
412
  }, { immediate: !0 });
403
413
  async function R(a) {
404
414
  try {
405
- if (n.value = !0, !u.value)
415
+ if (n.value = !0, !c.value)
406
416
  return;
407
- await i.post("/one/team/remove", { userId: a }), u.value.members = u.value.members.filter((T) => T.id !== a);
408
- } catch (T) {
409
- o.showError(T?.message ?? "Error removing user from team");
417
+ await i.post("/one/team/remove", { userId: a }), c.value.members = c.value.members.filter((A) => A.id !== a);
418
+ } catch (A) {
419
+ o.showError(A?.message ?? "Error removing user from team");
410
420
  } finally {
411
421
  n.value = !1;
412
422
  }
413
423
  }
414
424
  async function q() {
415
425
  try {
416
- n.value = !0, await i.post("/one/team/leave", { teamId: u.value?.id }), await s.verify(!0);
426
+ n.value = !0, await i.post("/one/team/leave", { teamId: c.value?.id }), await s.verify(!0);
417
427
  } catch (a) {
418
428
  o.showError(a?.message ?? "Error leaving team");
419
429
  } finally {
@@ -422,43 +432,43 @@ const M = O("one", () => {
422
432
  }
423
433
  async function I() {
424
434
  try {
425
- n.value = !0, await i.post("/one/team/join", { inviteCode: v.value }), await s.verify(!0), d();
435
+ n.value = !0, await i.post("/one/team/join", { inviteCode: y.value }), await s.verify(!0), p();
426
436
  } catch (a) {
427
437
  o.showError(a?.message ?? "Error joining team");
428
438
  } finally {
429
439
  n.value = !1;
430
440
  }
431
441
  }
432
- function d() {
433
- y.value = !1;
442
+ function p() {
443
+ h.value = !1;
434
444
  const a = new URL(window.location.href);
435
445
  a.searchParams.delete("invite"), window.history.replaceState({}, "", a.toString());
436
446
  }
437
- const E = p(() => s.user?.id === s.user?.team?.owner.id);
447
+ const E = m(() => s.user?.id === s.user?.team?.owner.id);
438
448
  return {
439
- team: u,
440
- teamInviteDialog: y,
441
- teamInviteCode: v,
449
+ team: c,
450
+ teamInviteDialog: h,
451
+ teamInviteCode: y,
442
452
  hasTeamAccess: S,
443
453
  isTeamOwner: E,
444
454
  isLoading: n,
445
455
  removeFromTeam: R,
446
456
  leaveTeam: q,
447
457
  joinTeam: I,
448
- clearTeamQuery: d
458
+ clearTeamQuery: p
449
459
  };
450
- }), J = typeof window < "u", X = O("auth", () => {
451
- const e = b(!1), s = b(null), r = Q(), i = se(), o = V(), n = N(!1), u = M(), y = re(), v = B(), S = C(() => !!s.value), R = C(() => s.value?.role === "super"), q = C(() => ["super", "admin"].includes(s.value?.role ?? "")), I = C(() => ["super", "admin", "editor"].includes(s.value?.role ?? ""));
452
- let d = !!x();
453
- A(s, (c) => {
454
- if (!J || !c?.settings)
460
+ }), B = typeof window < "u", Y = O("auth", () => {
461
+ const e = b(!1), s = b(null), r = V(), i = re(), o = z(), n = P(!1), c = X(), h = ne(), y = F(), S = N(() => !!s.value), R = N(() => s.value?.role === "super"), q = N(() => ["super", "admin"].includes(s.value?.role ?? "")), I = N(() => ["super", "admin", "editor"].includes(s.value?.role ?? ""));
462
+ let p = !!x();
463
+ T(s, (l) => {
464
+ if (!B || !l?.settings)
455
465
  return;
456
- const h = localStorage.getItem("vuetify@user") || "{}";
457
- if (JSON.stringify(c.settings, null, 2) === h)
466
+ const d = localStorage.getItem("vuetify@user") || "{}";
467
+ if (JSON.stringify(l.settings, null, 2) === d)
458
468
  return;
459
- d = !0;
460
- let f = c.settings;
461
- f.version === 6 && (f = F(f));
469
+ p = !0;
470
+ let f = l.settings;
471
+ f.version === 6 && (f = Q(f));
462
472
  const $ = {
463
473
  version: 7,
464
474
  ecosystem: k(structuredClone(g.ecosystem), f.ecosystem || {}),
@@ -466,33 +476,33 @@ const M = O("one", () => {
466
476
  };
467
477
  Object.assign(i, $);
468
478
  }), i.$subscribe(() => {
469
- d || E(), d = !1;
479
+ p || E(), p = !1;
470
480
  });
471
481
  async function E() {
472
- if (await K(), !(!s.value || !i.one.sync))
482
+ if (await Z(), !(!s.value || !i.one.sync))
473
483
  try {
474
484
  await r.post("/user/settings", { settings: i.$state }), await a(!0);
475
- } catch (c) {
476
- v.showError(c?.message ?? "Error syncing settings");
485
+ } catch (l) {
486
+ y.showError(l?.message ?? "Error syncing settings");
477
487
  }
478
488
  }
479
- async function a(c = !1) {
489
+ async function a(l = !1) {
480
490
  if (a.promise)
481
491
  return a.promise;
482
- if (!c && !document.cookie.includes("sx=1") && location.hostname.match(/([^.]+\.[^.]+)$/)?.[1] === new URL(r.url).hostname.match(/([^.]+\.[^.]+)$/)?.[1]) {
492
+ if (!l && !document.cookie.includes("sx=1") && location.hostname.match(/([^.]+\.[^.]+)$/)?.[1] === new URL(r.url).hostname.match(/([^.]+\.[^.]+)$/)?.[1]) {
483
493
  s.value = null;
484
494
  return;
485
495
  }
486
496
  n.value = !0, a.promise = fetch(`${r.url}/auth/verify`, {
487
497
  credentials: "include",
488
- cache: c ? "reload" : void 0
498
+ cache: l ? "reload" : void 0
489
499
  }).then(
490
- async (h) => {
491
- if (h.ok || h.status === 401) {
492
- const f = await h.json();
493
- s.value = f.user, u.access = f.access, y.team = f.user?.team;
500
+ async (d) => {
501
+ if (d.ok || d.status === 401) {
502
+ const f = await d.json();
503
+ s.value = f.user, c.access = f.access, h.team = f.user?.team;
494
504
  } else
495
- console.error(h.statusText);
505
+ console.error(d.statusText);
496
506
  },
497
507
  () => {
498
508
  }
@@ -501,43 +511,43 @@ const M = O("one", () => {
501
511
  });
502
512
  }
503
513
  a.promise = null;
504
- async function T(c = "github") {
514
+ async function A(l = "github") {
505
515
  n.value = !0;
506
- const h = `${r.url}/auth/${c}/redirect`;
507
- if (c === "shopify") {
508
- window.location.assign(h + "?next=" + encodeURIComponent(window.location.href));
516
+ const d = `${r.url}/auth/${l}/redirect`;
517
+ if (l === "shopify") {
518
+ window.location.assign(d + "?next=" + encodeURIComponent(window.location.href));
509
519
  return;
510
520
  }
511
- const f = 400, $ = 600, W = window.screenX + (window.innerWidth - f) / 2, _ = window.screenY + (window.innerHeight - $) / 2, w = window.open(
521
+ const f = 400, $ = 600, _ = window.screenX + (window.innerWidth - f) / 2, H = window.screenY + (window.innerHeight - $) / 2, w = window.open(
512
522
  "",
513
523
  "vuetify:authorize:popup",
514
- `popup,left=${W},top=${_},width=${f},height=${$},resizable`
524
+ `popup,left=${_},top=${H},width=${f},height=${$},resizable`
515
525
  );
516
526
  if (!w) {
517
527
  console.error("Failed to open popup");
518
528
  return;
519
529
  }
520
- w.location.href = h;
521
- let j = -1, L = -1;
522
- function t(m) {
523
- m.origin === r.url && m.data?.type === "auth-response" && (m.data.status === "success" ? (s.value || (localStorage.setItem("vuetify@lastLoginProvider", c), e.value = !1, o.push("/user/dashboard")), s.value = m.data.body.user, u.access = m.data.body.access, y.team = m.data.body.user?.team, E()) : console.error(m.data.message), l());
530
+ w.location.href = d;
531
+ let j = -1, C = -1;
532
+ function L(u) {
533
+ u.origin === r.url && u.data?.type === "auth-response" && (u.data.status === "success" ? (s.value || (localStorage.setItem("vuetify@lastLoginProvider", l), e.value = !1, o.push("/user/dashboard")), s.value = u.data.body.user, c.access = u.data.body.access, h.team = u.data.body.user?.team, E()) : console.error(u.data.message), t());
524
534
  }
525
- function l() {
526
- window.removeEventListener("message", t), window.clearInterval(j), window.clearTimeout(L), w?.close(), n.value = !1;
535
+ function t() {
536
+ window.removeEventListener("message", L), window.clearInterval(j), window.clearTimeout(C), w?.close(), n.value = !1;
527
537
  }
528
- window.addEventListener("message", t), j = window.setInterval(() => {
529
- !w || w.closed ? (console.error("Auth popup closed"), l()) : w.postMessage({ type: "auth-request" }, "*");
530
- }, 1e3), L = window.setTimeout(() => {
531
- l(), console.error("Auth timed out");
538
+ window.addEventListener("message", L), j = window.setInterval(() => {
539
+ !w || w.closed ? (console.error("Auth popup closed"), t()) : w.postMessage({ type: "auth-request" }, "*");
540
+ }, 1e3), C = window.setTimeout(() => {
541
+ t(), console.error("Auth timed out");
532
542
  }, 120 * 1e3);
533
543
  }
534
- async function P(c) {
544
+ async function U(l) {
535
545
  n.value = !0;
536
- const h = c ? `/auth/${c}/logout` : "/auth/logout";
546
+ const d = l ? `/auth/${l}/logout` : "/auth/logout";
537
547
  try {
538
- await r.post(h), await a(!0), s.value = null;
548
+ await r.post(d), await a(!0), s.value = null;
539
549
  } catch (f) {
540
- v.showError(f?.message ?? "Error logging out");
550
+ y.showError(f?.message ?? "Error logging out");
541
551
  } finally {
542
552
  o.push({
543
553
  path: "/",
@@ -545,13 +555,13 @@ const M = O("one", () => {
545
555
  }), n.value = !1;
546
556
  }
547
557
  }
548
- function U(c) {
549
- return s.value?.identities.find((h) => h.provider === c);
558
+ function W(l) {
559
+ return s.value?.identities.find((d) => d.provider === l);
550
560
  }
551
561
  function x() {
552
- return J ? localStorage.getItem("vuetify@lastLoginProvider") : null;
562
+ return B ? localStorage.getItem("vuetify@lastLoginProvider") : null;
553
563
  }
554
- return J && a(), {
564
+ return B && a(), {
555
565
  user: s,
556
566
  url: r.url,
557
567
  dialog: e,
@@ -561,19 +571,19 @@ const M = O("one", () => {
561
571
  isAdmin: q,
562
572
  isEditor: I,
563
573
  verify: a,
564
- findIdentity: U,
565
- login: T,
566
- logout: P,
574
+ findIdentity: W,
575
+ login: A,
576
+ logout: U,
567
577
  lastLoginProvider: x,
568
578
  sync: E
569
579
  };
570
580
  });
571
581
  export {
572
- X as a,
573
- se as b,
574
- M as c,
575
- z as d,
576
- Q as e,
577
- re as f,
578
- B as u
582
+ Y as a,
583
+ re as b,
584
+ X as c,
585
+ M as d,
586
+ V as e,
587
+ ne as f,
588
+ F as u
579
589
  };
package/dist/index.d.ts CHANGED
@@ -498,6 +498,16 @@ interface Invoice {
498
498
  status: string;
499
499
  pdf: string;
500
500
  }
501
+ interface Activity {
502
+ id: string;
503
+ slug: string;
504
+ title: string | null;
505
+ createdAt: string;
506
+ updatedAt: string;
507
+ favorite: boolean;
508
+ pinned: boolean;
509
+ property: string;
510
+ }
501
511
  interface OneState {
502
512
  info: Ref<Info | null>;
503
513
  interval: ComputedRef<SubscriptionItemPlan['interval'] | undefined>;
@@ -527,8 +537,9 @@ interface OneState {
527
537
  resetQuery: () => void;
528
538
  subscribe: (interval: SubscriptionItemPlan['interval'], type: SubscriptionItemPlan['type']) => Promise<void>;
529
539
  subscriptionInfo: () => Promise<any>;
540
+ recentActivity: () => Promise<Activity[]>;
530
541
  }
531
- declare const useOneStore: pinia.StoreDefinition<"one", Pick<OneState, "info" | "access" | "invoices" | "isLoading" | "isOpen">, Pick<OneState, "one" | "interval" | "subscriptionType" | "sessionId" | "subscription" | "monthlyTotal" | "hasBilling" | "isSubscriber" | "github" | "discord" | "shopify" | "opencollective">, Pick<OneState, "activate" | "cancel" | "manage" | "modify" | "resetQuery" | "subscribe" | "subscriptionInfo">>;
542
+ declare const useOneStore: pinia.StoreDefinition<"one", Pick<OneState, "info" | "access" | "invoices" | "isLoading" | "isOpen">, Pick<OneState, "one" | "interval" | "subscriptionType" | "sessionId" | "subscription" | "monthlyTotal" | "hasBilling" | "isSubscriber" | "github" | "discord" | "shopify" | "opencollective">, Pick<OneState, "activate" | "cancel" | "manage" | "modify" | "resetQuery" | "subscribe" | "subscriptionInfo" | "recentActivity">>;
532
543
 
533
544
  type VOnePlay = {
534
545
  id: string;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as y, createBlock as m, openBlock as c, unref as e, computed as C, createSlots as T, withCtx as s, createElementVNode as v, toDisplayString as V, createVNode as n, createTextVNode as S, normalizeStyle as it, createCommentVNode as h, renderSlot as w, shallowRef as M, watch as H, withModifiers as ye, mergeModels as rt, useModel as W, createElementBlock as k, Fragment as A, nextTick as be, renderList as K, mergeProps as R, withDirectives as Z, vShow as Ie, isRef as j, ref as F, readonly as Se, resolveComponent as lt, watchEffect as jt, onMounted as Ae, toRef as ge, normalizeClass as Rt, useSlots as ut, normalizeProps as ct, guardReactiveProps as dt, onBeforeMount as je, onBeforeUnmount as qt, useCssVars as Gt, onServerPrefetch as Wt } from "vue";
2
- import { u as ee, a as B, b as U, c as O, d as Ce, e as Y, f as De } from "./auth-D7s7dIcr.js";
2
+ import { u as ee, a as B, b as U, c as O, d as Ce, e as Y, f as De } from "./auth-DkYOaeOy.js";
3
3
  import { VSnackbarQueue as Kt } from "vuetify/components/VSnackbarQueue";
4
4
  import { mdiAccountGroupOutline as pt, mdiStorefront as Yt, mdiGoogle as Qt, mdiSync as Xt, mdiSyncOff as Jt, mdiLogoutVariant as eo, mdiFullscreenExit as to, mdiFullscreen as oo, mdiCheck as ke, mdiSelect as no, mdiSpaceInvaders as mt, mdiImageFilterHdr as ft, mdiTransmissionTower as vt, mdiRocketLaunchOutline as gt, mdiHome as so, mdiTextBox as ao, mdiWhiteBalanceSunny as io, mdiWeatherNight as ro, mdiDesktopTowerMonitor as lo, mdiContrastCircle as uo, mdiCog as co, mdiCogOutline as po, mdiShieldKeyOutline as mo, mdiContentCopy as Re, mdiFileDocument as _t, mdiKey as fo, mdiPlus as vo, mdiRefresh as go, mdiKeyOutline as _o, mdiCreditCardSettingsOutline as yo, mdiRocketOutline as ho, mdiCheckCircleOutline as Me, mdiCreditCard as bo, mdiReload as Co, mdiPlaylistCheck as ko, mdiCreditCardOutline as Vo, mdiOpenInNew as Te, mdiMedal as $o, mdiHandHeart as xo, mdiHandHeartOutline as Lo, mdiCloudDownload as wo, mdiTrayArrowDown as tt, mdiAccountGroup as So, mdiAccount as Mo, mdiLinkVariant as Io, mdiShieldLock as ot, mdiAccountRemoveOutline as Ao, mdiExitToApp as Do, mdiPin as To, mdiPinOutline as Uo, mdiEmailOpenOutline as qe, mdiEmailVariant as Ge, mdiBell as Po, mdiInboxOutline as Oo, mdiInboxFullOutline as zo, mdiBillboard as Bo, mdiBellOutline as Eo, mdiViewDashboardOutline as Fo, mdiCrown as Zo, mdiArrowULeftBottom as No, mdiAtomVariant as Ho, mdiLogin as nt, mdiDotsVertical as jo, mdiShieldStarOutline as Ro } from "@mdi/js";
5
5
  import { VListItem as se, VList as ne, VListSubheader as qo, VListItemTitle as yt, VListItemSubtitle as Go } from "vuetify/components/VList";
@@ -1,5 +1,5 @@
1
1
  import "lodash-es";
2
- import { a as e } from "../auth-D7s7dIcr.js";
2
+ import { a as e } from "../auth-DkYOaeOy.js";
3
3
  import "pinia";
4
4
  import "vue";
5
5
  import "vue-router";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuetify/one",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",