windmill-components 1.103.1 → 1.103.2

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.
@@ -0,0 +1 @@
1
+ export declare function refreshSuperadmin(): Promise<void>;
@@ -0,0 +1,21 @@
1
+ import { get } from 'svelte/store';
2
+ import { UserService } from './gen';
3
+ import { superadmin } from './stores.js';
4
+ import { goto } from '$app/navigation';
5
+ export async function refreshSuperadmin() {
6
+ if (get(superadmin) == undefined) {
7
+ try {
8
+ const me = await UserService.globalWhoami();
9
+ if (me.super_admin) {
10
+ superadmin.set(me.email);
11
+ }
12
+ else {
13
+ superadmin.set(false);
14
+ }
15
+ }
16
+ catch {
17
+ superadmin.set(false);
18
+ goto('/user/logout');
19
+ }
20
+ }
21
+ }
package/package/user.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- import { type UserExt } from './stores.js';
2
- export declare function refreshSuperadmin(): Promise<void>;
1
+ import type { UserExt } from './stores.js';
3
2
  export declare function getUserExt(workspace: string): Promise<UserExt | undefined>;
package/package/user.js CHANGED
@@ -1,24 +1,4 @@
1
- import { get } from 'svelte/store';
2
1
  import { UserService } from './gen';
3
- import { superadmin } from './stores.js';
4
- import { goto } from '$app/navigation';
5
- export async function refreshSuperadmin() {
6
- if (get(superadmin) == undefined) {
7
- try {
8
- const me = await UserService.globalWhoami();
9
- if (me.super_admin) {
10
- superadmin.set(me.email);
11
- }
12
- else {
13
- superadmin.set(false);
14
- }
15
- }
16
- catch {
17
- superadmin.set(false);
18
- goto('/user/logout');
19
- }
20
- }
21
- }
22
2
  export async function getUserExt(workspace) {
23
3
  try {
24
4
  const user = await UserService.whoami({ workspace });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-components",
3
- "version": "1.103.1",
3
+ "version": "1.103.2",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",