wcz-test 6.23.2 → 6.24.1
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/dist/components/core/AppTitle.js +1 -1
- package/dist/components/core/AppTitle.js.map +1 -1
- package/dist/components/core/Fullscreen.js +2 -2
- package/dist/components/core/Fullscreen.js.map +1 -1
- package/dist/components/core/Layout.js +7 -8
- package/dist/components/core/Layout.js.map +1 -1
- package/dist/components/core/ToolbarAccount.js +123 -143
- package/dist/components/core/ToolbarAccount.js.map +1 -1
- package/dist/components/core/TypographyWithIcon.js +2 -2
- package/dist/components/core/TypographyWithIcon.js.map +1 -1
- package/dist/components/core/navigation/NavigationList.js +2 -2
- package/dist/components/core/navigation/NavigationList.js.map +1 -1
- package/dist/components/core/navigation/NavigationListItem.js +6 -6
- package/dist/components/core/navigation/NavigationListItem.js.map +1 -1
- package/dist/components/data-grid/EditableColumnHeader.js +1 -1
- package/dist/components/data-grid/EditableColumnHeader.js.map +1 -1
- package/dist/components/file/Dropzone.js +2 -2
- package/dist/components/file/Dropzone.js.map +1 -1
- package/dist/components/file/FileViewer.js +2 -2
- package/dist/components/file/FileViewer.js.map +1 -1
- package/dist/components/file/fileViewer/FileViewerGrid.js +1 -1
- package/dist/components/file/fileViewer/FileViewerGrid.js.map +1 -1
- package/dist/components/router/RouterError.js +2 -2
- package/dist/components/router/RouterError.js.map +1 -1
- package/dist/components/router/RouterNotFound.js +2 -2
- package/dist/components/router/RouterNotFound.js.map +1 -1
- package/dist/env.d.ts +5 -2
- package/dist/env.js +11 -7
- package/dist/env.js.map +1 -1
- package/dist/exports/hooks.d.ts +0 -1
- package/dist/exports/index.d.ts +1 -0
- package/dist/exports/models.d.ts +1 -0
- package/dist/exports/queries.d.ts +1 -1
- package/dist/exports/server.d.ts +3 -0
- package/dist/hooks.js +0 -2
- package/dist/hooks.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/auth/api.d.ts +3 -0
- package/dist/lib/auth/api.js +91 -0
- package/dist/lib/auth/api.js.map +1 -0
- package/dist/lib/auth/entra.d.ts +2 -0
- package/dist/lib/auth/entra.js +7 -0
- package/dist/lib/auth/entra.js.map +1 -0
- package/dist/lib/auth/graph.d.ts +17 -0
- package/dist/lib/auth/graph.js +72 -0
- package/dist/lib/auth/graph.js.map +1 -0
- package/dist/lib/auth/session.d.ts +24 -0
- package/dist/lib/auth/session.js +76 -0
- package/dist/lib/auth/session.js.map +1 -0
- package/dist/lib/queryClient.d.ts +2 -0
- package/dist/lib/queryClient.js +6 -0
- package/dist/lib/queryClient.js.map +1 -0
- package/dist/lib/utils.js.map +1 -1
- package/dist/middleware/auth.d.ts +13 -4
- package/dist/models/User.d.ts +8 -3
- package/dist/models/User.js +18 -0
- package/dist/models/User.js.map +1 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +1 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.js +1 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.js.map +1 -1
- package/dist/providers/LayoutProvider.js +2 -9
- package/dist/providers/LayoutProvider.js.map +1 -1
- package/dist/queries/ApprovalHooks.d.ts +24 -1
- package/dist/queries/ApprovalHooks.js +114 -31
- package/dist/queries/ApprovalHooks.js.map +1 -1
- package/dist/queries/FileHooks.js +53 -26
- package/dist/queries/FileHooks.js.map +1 -1
- package/dist/queries/PeopleSoftHooks.js +68 -26
- package/dist/queries/PeopleSoftHooks.js.map +1 -1
- package/dist/queries.js +3 -9
- package/dist/server.js +5 -1
- package/dist/server.js.map +1 -1
- package/package.json +14 -14
- package/dist/contexts/UserContext.d.ts +0 -7
- package/dist/contexts/UserContext.js +0 -6
- package/dist/contexts/UserContext.js.map +0 -1
- package/dist/hooks/UseHook.d.ts +0 -2
- package/dist/hooks/UseHook.js +0 -12
- package/dist/hooks/UseHook.js.map +0 -1
- package/dist/lib/auth/client.d.ts +0 -13
- package/dist/lib/auth/client.js +0 -63
- package/dist/lib/auth/client.js.map +0 -1
- package/dist/lib/auth/server.d.ts +0 -9
- package/dist/providers/UserProvider.d.ts +0 -4
- package/dist/providers/UserProvider.js +0 -94
- package/dist/providers/UserProvider.js.map +0 -1
- package/dist/queries/Approval.d.ts +0 -585
- package/dist/queries/Approval.js +0 -91
- package/dist/queries/Approval.js.map +0 -1
- package/dist/queries/UserHooks.d.ts +0 -11
- package/dist/queries/UserHooks.js +0 -157
- package/dist/queries/UserHooks.js.map +0 -1
package/dist/queries.js
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
+
import { queryClient } from "./lib/queryClient.js";
|
|
1
2
|
import { useDeleteFile, useDeleteFiles, useDownloadFile, useGetFile, useGetFileMetas, useGetFileThumbnail, useOpenFile, useUpdateFileMeta, useUploadFile } from "./queries/FileHooks.js";
|
|
2
3
|
import { useGetPeopleSoftActiveEmployees, useGetPeopleSoftCompanyGeneralManager, useGetPeopleSoftDepartmentById, useGetPeopleSoftDepartmentEmployees, useGetPeopleSoftDepartmentManager, useGetPeopleSoftDepartments, useGetPeopleSoftEmployeeById, useGetPeopleSoftEmployeeGeneralManager, useGetPeopleSoftEmployeeManager, useGetPeopleSoftEmployeeSubordinates, useGetPeopleSoftEmployeeSupervisor, useGetPeopleSoftEmployees, useGetPeopleSoftEmployeesSearch, useGetPeopleSoftPreviousEmployeeIds } from "./queries/PeopleSoftHooks.js";
|
|
3
|
-
import { approveApproval, cancelApproval, createApproval, getApproval, getApprovals, resubmitApproval, withdrawApproval } from "./queries/Approval.js";
|
|
4
4
|
import { useApproveApproval, useCancelApproval, useCreateApproval, useGetApproval, useGetApprovals, useResubmitApproval, useWithdrawApproval } from "./queries/ApprovalHooks.js";
|
|
5
5
|
export {
|
|
6
|
-
|
|
7
|
-
cancelApproval,
|
|
8
|
-
createApproval,
|
|
9
|
-
getApproval,
|
|
10
|
-
getApprovals,
|
|
11
|
-
resubmitApproval,
|
|
6
|
+
queryClient,
|
|
12
7
|
useApproveApproval,
|
|
13
8
|
useCancelApproval,
|
|
14
9
|
useCreateApproval,
|
|
@@ -38,7 +33,6 @@ export {
|
|
|
38
33
|
useResubmitApproval,
|
|
39
34
|
useUpdateFileMeta,
|
|
40
35
|
useUploadFile,
|
|
41
|
-
useWithdrawApproval
|
|
42
|
-
withdrawApproval
|
|
36
|
+
useWithdrawApproval
|
|
43
37
|
};
|
|
44
38
|
//# sourceMappingURL=queries.js.map
|
package/dist/server.js
CHANGED
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wcz-test",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.24.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -58,32 +58,32 @@
|
|
|
58
58
|
"prepublishOnly": "npm run build"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
64
|
-
"@t3-oss/env-core": "^0.13.8",
|
|
65
|
-
"@types/pg": "^8.15.6",
|
|
61
|
+
"@t3-oss/env-core": "^0.13.10",
|
|
62
|
+
"@types/pg": "^8.16.0",
|
|
63
|
+
"arctic": "^3.7.0",
|
|
66
64
|
"axios": "^1.13.2",
|
|
67
65
|
"dayjs": "^1.11.19",
|
|
68
|
-
"drizzle-orm": "^0.45.
|
|
66
|
+
"drizzle-orm": "^0.45.1",
|
|
69
67
|
"file-saver": "^2.0.5",
|
|
70
|
-
"i18next": "^25.7.
|
|
68
|
+
"i18next": "^25.7.3",
|
|
71
69
|
"i18next-browser-languagedetector": "^8.2.0",
|
|
72
|
-
"
|
|
70
|
+
"jsonwebtoken": "^9.0.3",
|
|
71
|
+
"jwks-rsa": "^3.2.0",
|
|
73
72
|
"pg": "^8.16.3",
|
|
74
73
|
"react-dropzone": "^14.3.8",
|
|
75
|
-
"react-i18next": "^16.
|
|
74
|
+
"react-i18next": "^16.5.0",
|
|
76
75
|
"react-intersection-observer": "^10.0.0",
|
|
77
76
|
"react-number-format": "^5.4.4",
|
|
78
77
|
"tus-js-client": "^4.3.1",
|
|
79
78
|
"uuidv7": "^1.1.0",
|
|
80
|
-
"zod": "^4.
|
|
79
|
+
"zod": "^4.2.0"
|
|
81
80
|
},
|
|
82
81
|
"devDependencies": {
|
|
83
82
|
"@tanstack/eslint-config": "^0.3.4",
|
|
84
83
|
"@tanstack/eslint-plugin-query": "^5.91.2",
|
|
85
|
-
"@tanstack/eslint-plugin-router": "^1.
|
|
84
|
+
"@tanstack/eslint-plugin-router": "^1.141.0",
|
|
86
85
|
"@types/file-saver": "^2.0.7",
|
|
86
|
+
"@types/jsonwebtoken": "^9.0.10",
|
|
87
87
|
"@types/node": "^24.10.2",
|
|
88
88
|
"@types/react": "^19.2.7",
|
|
89
89
|
"@types/react-dom": "^19.2.3",
|
|
@@ -93,11 +93,11 @@
|
|
|
93
93
|
"nitro": "^3.0.1-alpha.1",
|
|
94
94
|
"react-markdown": "^10.1.0",
|
|
95
95
|
"typescript": "^5.9.3",
|
|
96
|
-
"vite": "^7.
|
|
96
|
+
"vite": "^7.3.0",
|
|
97
97
|
"vite-plugin-checker": "^0.12.0",
|
|
98
98
|
"vite-plugin-dts": "^4.5.4",
|
|
99
99
|
"vite-plugin-pwa": "^1.2.0",
|
|
100
|
-
"vite-tsconfig-paths": "^
|
|
100
|
+
"vite-tsconfig-paths": "^6.0.1"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
103
|
"@emotion/react": "11.x",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
-
import { User } from '../models/User';
|
|
3
|
-
export interface UserContextValue {
|
|
4
|
-
user: User;
|
|
5
|
-
setUser: Dispatch<SetStateAction<User>>;
|
|
6
|
-
}
|
|
7
|
-
export declare const UserContext: import('react').Context<UserContextValue>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserContext.js","sources":["../../src/contexts/UserContext.ts"],"sourcesContent":["import { createContext } from \"react\";\nimport type { Dispatch, SetStateAction } from \"react\";\nimport type { User } from \"~/models/User\";\n\nexport interface UserContextValue {\n user: User;\n setUser: Dispatch<SetStateAction<User>>;\n}\n\nexport const UserContext = createContext<UserContextValue>({} as UserContextValue);\n"],"names":["UserContext","createContext"],"mappings":";AASO,MAAMA,cAAcC,cAAgC,CAAA,CAAsB;"}
|
package/dist/hooks/UseHook.d.ts
DELETED
package/dist/hooks/UseHook.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UseHook.js","sources":["../../src/hooks/UseHook.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport type { User } from \"~/models/User\";\nimport { UserContext } from \"~/contexts/UserContext\";\n\nexport function useUser(): User {\n const { user } = useContext(UserContext);\n return user;\n}\n"],"names":["useUser","user","useContext","UserContext"],"mappings":";;AAIO,SAAAA,UAAA;AACH,QAAA;AAAA,IAAAC;AAAAA,EAAAA,IAAiBC,WAAWC,WAAW;AAAE,SAClCF;AAAI;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { NavigationClient, PublicClientApplication, NavigationOptions } from '@azure/msal-browser';
|
|
2
|
-
import { UseNavigateResult } from '@tanstack/react-router';
|
|
3
|
-
export declare const pca: PublicClientApplication;
|
|
4
|
-
export declare class CustomNavigationClient extends NavigationClient {
|
|
5
|
-
private readonly navigate;
|
|
6
|
-
constructor(navigate: UseNavigateResult<string>);
|
|
7
|
-
navigateInternal(url: string, options: NavigationOptions): Promise<boolean>;
|
|
8
|
-
}
|
|
9
|
-
export interface AuthTokens {
|
|
10
|
-
idToken: string;
|
|
11
|
-
accessToken: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const acquireToken: () => Promise<AuthTokens>;
|
package/dist/lib/auth/client.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { PublicClientApplication, NavigationClient, EventType } from "@azure/msal-browser";
|
|
2
|
-
import { clientEnv } from "../../env.js";
|
|
3
|
-
const msalConfig = {
|
|
4
|
-
auth: {
|
|
5
|
-
clientId: clientEnv.VITE_MICROSOFT_CLIENT_ID,
|
|
6
|
-
authority: `https://login.microsoftonline.com/${clientEnv.VITE_MICROSOFT_TENANT_ID}`
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
const pca = new PublicClientApplication(msalConfig);
|
|
10
|
-
pca.initialize().then(() => {
|
|
11
|
-
if (!pca.getActiveAccount() && pca.getAllAccounts().length > 0) {
|
|
12
|
-
pca.setActiveAccount(pca.getAllAccounts()[0]);
|
|
13
|
-
}
|
|
14
|
-
pca.enableAccountStorageEvents();
|
|
15
|
-
pca.addEventCallback((event) => {
|
|
16
|
-
if (event.eventType === EventType.LOGIN_SUCCESS && event.payload) {
|
|
17
|
-
const payload = event.payload;
|
|
18
|
-
const account = payload.account;
|
|
19
|
-
pca.setActiveAccount(account);
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
class CustomNavigationClient extends NavigationClient {
|
|
24
|
-
navigate;
|
|
25
|
-
constructor(navigate) {
|
|
26
|
-
super();
|
|
27
|
-
this.navigate = navigate;
|
|
28
|
-
}
|
|
29
|
-
async navigateInternal(url, options) {
|
|
30
|
-
const relativePath = url.replace(location.origin, "");
|
|
31
|
-
if (options.noHistory) {
|
|
32
|
-
this.navigate({
|
|
33
|
-
to: relativePath,
|
|
34
|
-
replace: true
|
|
35
|
-
});
|
|
36
|
-
} else {
|
|
37
|
-
this.navigate({
|
|
38
|
-
to: relativePath
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
const acquireToken = async () => {
|
|
45
|
-
const account = pca.getActiveAccount();
|
|
46
|
-
if (!account) {
|
|
47
|
-
throw new Error("No active account! Verify a user has been signed in and setActiveAccount has been called.");
|
|
48
|
-
}
|
|
49
|
-
const response = await pca.acquireTokenSilent({
|
|
50
|
-
scopes: ["User.Read", "GroupMember.Read.All"],
|
|
51
|
-
account
|
|
52
|
-
});
|
|
53
|
-
return {
|
|
54
|
-
idToken: response.idToken,
|
|
55
|
-
accessToken: response.accessToken
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export {
|
|
59
|
-
CustomNavigationClient,
|
|
60
|
-
acquireToken,
|
|
61
|
-
pca
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":["../../../src/lib/auth/client.ts"],"sourcesContent":["import { EventType, NavigationClient, PublicClientApplication } from \"@azure/msal-browser\";\r\nimport type { AuthenticationResult, Configuration, EventMessage, NavigationOptions } from \"@azure/msal-browser\";\r\nimport type { UseNavigateResult } from \"@tanstack/react-router\";\r\nimport { clientEnv } from \"~/env\";\r\n\r\nconst msalConfig: Configuration = {\r\n auth: {\r\n clientId: clientEnv.VITE_MICROSOFT_CLIENT_ID,\r\n authority: `https://login.microsoftonline.com/${clientEnv.VITE_MICROSOFT_TENANT_ID}`,\r\n },\r\n};\r\n\r\nexport const pca = new PublicClientApplication(msalConfig);\r\n\r\npca.initialize().then(() => {\r\n if (!pca.getActiveAccount() && pca.getAllAccounts().length > 0) {\r\n pca.setActiveAccount(pca.getAllAccounts()[0]);\r\n }\r\n\r\n pca.enableAccountStorageEvents();\r\n\r\n pca.addEventCallback((event: EventMessage) => {\r\n if (event.eventType === EventType.LOGIN_SUCCESS && event.payload) {\r\n const payload = event.payload as AuthenticationResult;\r\n const account = payload.account;\r\n pca.setActiveAccount(account);\r\n }\r\n });\r\n});\r\n\r\nexport class CustomNavigationClient extends NavigationClient {\r\n private readonly navigate: UseNavigateResult<string>;\r\n\r\n constructor(navigate: UseNavigateResult<string>) {\r\n super();\r\n this.navigate = navigate;\r\n }\r\n\r\n async navigateInternal(url: string, options: NavigationOptions) {\r\n const relativePath = url.replace(location.origin, \"\");\r\n if (options.noHistory) {\r\n this.navigate({ to: relativePath, replace: true });\r\n } else {\r\n this.navigate({ to: relativePath });\r\n }\r\n\r\n return false;\r\n }\r\n}\r\n\r\nexport interface AuthTokens {\r\n idToken: string;\r\n accessToken: string;\r\n}\r\n\r\nexport const acquireToken = async (): Promise<AuthTokens> => {\r\n const account = pca.getActiveAccount();\r\n if (!account) {\r\n throw new Error(\"No active account! Verify a user has been signed in and setActiveAccount has been called.\");\r\n }\r\n\r\n const response = await pca.acquireTokenSilent({\r\n scopes: [\"User.Read\", \"GroupMember.Read.All\"],\r\n account: account\r\n });\r\n\r\n return { idToken: response.idToken, accessToken: response.accessToken };\r\n};\r\n"],"names":["msalConfig","auth","clientId","clientEnv","VITE_MICROSOFT_CLIENT_ID","authority","VITE_MICROSOFT_TENANT_ID","pca","PublicClientApplication","initialize","then","getActiveAccount","getAllAccounts","length","setActiveAccount","enableAccountStorageEvents","addEventCallback","event","eventType","EventType","LOGIN_SUCCESS","payload","account","CustomNavigationClient","NavigationClient","navigate","constructor","navigateInternal","url","options","relativePath","replace","location","origin","noHistory","to","acquireToken","Error","response","acquireTokenSilent","scopes","idToken","accessToken"],"mappings":";;AAKA,MAAMA,aAA4B;AAAA,EAC9BC,MAAM;AAAA,IACFC,UAAUC,UAAUC;AAAAA,IACpBC,WAAW,qCAAqCF,UAAUG,wBAAwB;AAAA,EAAA;AAE1F;AAEO,MAAMC,MAAM,IAAIC,wBAAwBR,UAAU;AAEzDO,IAAIE,WAAAA,EAAaC,KAAK,MAAM;AACxB,MAAI,CAACH,IAAII,iBAAAA,KAAsBJ,IAAIK,eAAAA,EAAiBC,SAAS,GAAG;AAC5DN,QAAIO,iBAAiBP,IAAIK,eAAAA,EAAiB,CAAC,CAAC;AAAA,EAChD;AAEAL,MAAIQ,2BAAAA;AAEJR,MAAIS,iBAAiB,CAACC,UAAwB;AAC1C,QAAIA,MAAMC,cAAcC,UAAUC,iBAAiBH,MAAMI,SAAS;AAC9D,YAAMA,UAAUJ,MAAMI;AACtB,YAAMC,UAAUD,QAAQC;AACxBf,UAAIO,iBAAiBQ,OAAO;AAAA,IAChC;AAAA,EACJ,CAAC;AACL,CAAC;AAEM,MAAMC,+BAA+BC,iBAAiB;AAAA,EACxCC;AAAAA,EAEjBC,YAAYD,UAAqC;AAC7C,UAAA;AACA,SAAKA,WAAWA;AAAAA,EACpB;AAAA,EAEA,MAAME,iBAAiBC,KAAaC,SAA4B;AAC5D,UAAMC,eAAeF,IAAIG,QAAQC,SAASC,QAAQ,EAAE;AACpD,QAAIJ,QAAQK,WAAW;AACnB,WAAKT,SAAS;AAAA,QAAEU,IAAIL;AAAAA,QAAcC,SAAS;AAAA,MAAA,CAAM;AAAA,IACrD,OAAO;AACH,WAAKN,SAAS;AAAA,QAAEU,IAAIL;AAAAA,MAAAA,CAAc;AAAA,IACtC;AAEA,WAAO;AAAA,EACX;AACJ;AAOO,MAAMM,eAAe,YAAiC;AACzD,QAAMd,UAAUf,IAAII,iBAAAA;AACpB,MAAI,CAACW,SAAS;AACV,UAAM,IAAIe,MAAM,2FAA2F;AAAA,EAC/G;AAEA,QAAMC,WAAW,MAAM/B,IAAIgC,mBAAmB;AAAA,IAC1CC,QAAQ,CAAC,aAAa,sBAAsB;AAAA,IAC5ClB;AAAAA,EAAAA,CACH;AAED,SAAO;AAAA,IAAEmB,SAASH,SAASG;AAAAA,IAASC,aAAaJ,SAASI;AAAAA,EAAAA;AAC9D;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ConfidentialClientApplication } from '@azure/msal-node';
|
|
2
|
-
export declare const cca: ConfidentialClientApplication;
|
|
3
|
-
export declare const acquireAppToken: (scopes: Array<string>) => Promise<string>;
|
|
4
|
-
export interface AuthenticatedUser {
|
|
5
|
-
name: string;
|
|
6
|
-
email: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const validateIdToken: (idToken: string) => Promise<AuthenticatedUser>;
|
|
9
|
-
export declare const fetchUserGroups: (accessToken: string) => Promise<Array<string>>;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { j as jsxRuntimeExports } from "../_virtual/jsx-runtime.js";
|
|
2
|
-
import { c as compilerRuntimeExports } from "../_virtual/compiler-runtime.js";
|
|
3
|
-
import { InteractionType } from "@azure/msal-browser";
|
|
4
|
-
import { useMsalAuthentication, useIsAuthenticated } from "@azure/msal-react";
|
|
5
|
-
import { useState, useEffect } from "react";
|
|
6
|
-
import { UserContext } from "../contexts/UserContext.js";
|
|
7
|
-
import { useGetUser, useGetUserPhoto, useGetUserGroups } from "../queries/UserHooks.js";
|
|
8
|
-
const UserProvider = (t0) => {
|
|
9
|
-
const $ = compilerRuntimeExports.c(13);
|
|
10
|
-
const {
|
|
11
|
-
children
|
|
12
|
-
} = t0;
|
|
13
|
-
useMsalAuthentication(InteractionType.Redirect);
|
|
14
|
-
const isAuthenticated = useIsAuthenticated();
|
|
15
|
-
let t1;
|
|
16
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
17
|
-
t1 = {};
|
|
18
|
-
$[0] = t1;
|
|
19
|
-
} else {
|
|
20
|
-
t1 = $[0];
|
|
21
|
-
}
|
|
22
|
-
const [user, setUser] = useState(t1);
|
|
23
|
-
const {
|
|
24
|
-
data,
|
|
25
|
-
isFetched: dataFetched
|
|
26
|
-
} = useGetUser(isAuthenticated);
|
|
27
|
-
const {
|
|
28
|
-
data: photo,
|
|
29
|
-
isFetched: photoFetched
|
|
30
|
-
} = useGetUserPhoto(isAuthenticated);
|
|
31
|
-
const {
|
|
32
|
-
data: groups,
|
|
33
|
-
isFetched: groupsFetched
|
|
34
|
-
} = useGetUserGroups(isAuthenticated);
|
|
35
|
-
const allDataFetched = dataFetched && photoFetched && groupsFetched;
|
|
36
|
-
let t2;
|
|
37
|
-
if ($[1] !== allDataFetched || $[2] !== data || $[3] !== groups || $[4] !== photo) {
|
|
38
|
-
t2 = () => {
|
|
39
|
-
if (allDataFetched) {
|
|
40
|
-
setUser((prev) => ({
|
|
41
|
-
...prev,
|
|
42
|
-
...data,
|
|
43
|
-
...photo && {
|
|
44
|
-
photo
|
|
45
|
-
},
|
|
46
|
-
...groups && {
|
|
47
|
-
groups
|
|
48
|
-
}
|
|
49
|
-
}));
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
$[1] = allDataFetched;
|
|
53
|
-
$[2] = data;
|
|
54
|
-
$[3] = groups;
|
|
55
|
-
$[4] = photo;
|
|
56
|
-
$[5] = t2;
|
|
57
|
-
} else {
|
|
58
|
-
t2 = $[5];
|
|
59
|
-
}
|
|
60
|
-
let t3;
|
|
61
|
-
if ($[6] !== allDataFetched) {
|
|
62
|
-
t3 = [allDataFetched];
|
|
63
|
-
$[6] = allDataFetched;
|
|
64
|
-
$[7] = t3;
|
|
65
|
-
} else {
|
|
66
|
-
t3 = $[7];
|
|
67
|
-
}
|
|
68
|
-
useEffect(t2, t3);
|
|
69
|
-
let t4;
|
|
70
|
-
if ($[8] !== user) {
|
|
71
|
-
t4 = {
|
|
72
|
-
user,
|
|
73
|
-
setUser
|
|
74
|
-
};
|
|
75
|
-
$[8] = user;
|
|
76
|
-
$[9] = t4;
|
|
77
|
-
} else {
|
|
78
|
-
t4 = $[9];
|
|
79
|
-
}
|
|
80
|
-
let t5;
|
|
81
|
-
if ($[10] !== children || $[11] !== t4) {
|
|
82
|
-
t5 = /* @__PURE__ */ jsxRuntimeExports.jsx(UserContext.Provider, { value: t4, children });
|
|
83
|
-
$[10] = children;
|
|
84
|
-
$[11] = t4;
|
|
85
|
-
$[12] = t5;
|
|
86
|
-
} else {
|
|
87
|
-
t5 = $[12];
|
|
88
|
-
}
|
|
89
|
-
return t5;
|
|
90
|
-
};
|
|
91
|
-
export {
|
|
92
|
-
UserProvider
|
|
93
|
-
};
|
|
94
|
-
//# sourceMappingURL=UserProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UserProvider.js","sources":["../../src/providers/UserProvider.tsx"],"sourcesContent":["import { InteractionType } from \"@azure/msal-browser\";\r\nimport { useIsAuthenticated, useMsalAuthentication } from \"@azure/msal-react\";\r\nimport { useEffect, useState } from \"react\";\r\nimport type { User } from \"~/models/User\";\r\nimport { UserContext } from \"~/contexts/UserContext\";\r\nimport { useGetUser, useGetUserGroups, useGetUserPhoto } from \"~/queries/UserHooks\";\r\n\r\nexport interface UserProviderProps {\r\n children?: React.ReactNode;\r\n}\r\n\r\nexport const UserProvider = ({ children }: UserProviderProps) => {\r\n useMsalAuthentication(InteractionType.Redirect);\r\n const isAuthenticated = useIsAuthenticated();\r\n const [user, setUser] = useState<User>({} as User);\r\n\r\n const { data, isFetched: dataFetched } = useGetUser(isAuthenticated);\r\n const { data: photo, isFetched: photoFetched } = useGetUserPhoto(isAuthenticated);\r\n const { data: groups, isFetched: groupsFetched } = useGetUserGroups(isAuthenticated);\r\n\r\n const allDataFetched = dataFetched && photoFetched && groupsFetched;\r\n\r\n useEffect(() => {\r\n if (allDataFetched) {\r\n setUser(prev => ({\r\n ...prev,\r\n ...data,\r\n ...(photo && { photo }),\r\n ...(groups && { groups }),\r\n }));\r\n }\r\n }, [allDataFetched]);\r\n\r\n return (\r\n <UserContext.Provider value={{ user, setUser }}>\r\n {children}\r\n </UserContext.Provider>\r\n );\r\n};\r\n"],"names":["UserProvider","t0","$","_c","children","useMsalAuthentication","InteractionType","Redirect","isAuthenticated","useIsAuthenticated","t1","Symbol","for","user","setUser","useState","data","isFetched","dataFetched","useGetUser","photo","photoFetched","useGetUserPhoto","groups","groupsFetched","useGetUserGroups","allDataFetched","t2","prev","t3","useEffect","t4","t5"],"mappings":";;;;;;;AAWO,MAAMA,eAAeC,CAAAA,OAA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