windmill-components 1.103.0 → 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.
- package/package/cloud.js +1 -2
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/models/EditSchedule.d.ts +1 -0
- package/package/gen/models/NewSchedule.d.ts +1 -0
- package/package/gen/models/Schedule.d.ts +1 -0
- package/package/refreshUser.d.ts +1 -0
- package/package/refreshUser.js +21 -0
- package/package/user.d.ts +1 -2
- package/package/user.js +0 -20
- package/package.json +1 -1
package/package/cloud.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { BROWSER } from 'esm-env';
|
|
2
|
-
import { page } from '$app/stores';
|
|
3
2
|
import { get } from 'svelte/store';
|
|
4
3
|
import { premiumStore, userStore, workspaceStore } from './stores';
|
|
5
4
|
import { getUserExt } from './user';
|
|
6
5
|
import { WorkspaceService } from './gen';
|
|
7
6
|
export function isCloudHosted() {
|
|
8
|
-
return
|
|
7
|
+
return BROWSER && window.location.hostname == 'app.windmill.dev';
|
|
9
8
|
}
|
|
10
9
|
if (BROWSER) {
|
|
11
10
|
workspaceStore.subscribe(async (workspace) => {
|
|
@@ -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
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 });
|