wcz-layout 9.6.4 → 9.6.6
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/Approval-C-hF4jbT.mjs.map +1 -1
- package/dist/DialogsContext-DLqA8RJ_.mjs.map +1 -1
- package/dist/Email-BzQQkbe9.mjs.map +1 -1
- package/dist/FileMeta-DDqUju1Y.mjs.map +1 -1
- package/dist/NotificationContext-CgwUOeW0.mjs.map +1 -1
- package/dist/{RouterListItemButton-owZVvuC_.mjs → RouterListItemButton-ULMlaQh6.mjs} +7 -5
- package/dist/RouterListItemButton-ULMlaQh6.mjs.map +1 -0
- package/dist/auth.mjs +5 -5
- package/dist/auth.mjs.map +1 -1
- package/dist/{authMiddleware-CjKA7C0W.mjs → authMiddleware-DPly0b_T.mjs} +2 -2
- package/dist/authMiddleware-DPly0b_T.mjs.map +1 -0
- package/dist/components.mjs +46 -163
- package/dist/components.mjs.map +1 -1
- package/dist/data/client.d.mts +549 -1
- package/dist/data/client.mjs +32 -32
- package/dist/data/client.mjs.map +1 -1
- package/dist/data/server.mjs +2 -2
- package/dist/data/server.mjs.map +1 -1
- package/dist/{entra-DFhYO6Sj.mjs → entra-CJSyeQsx.mjs} +2 -2
- package/dist/entra-CJSyeQsx.mjs.map +1 -0
- package/dist/{file-BDeY2atB.mjs → file-BTFDDalH.mjs} +3 -3
- package/dist/file-BTFDDalH.mjs.map +1 -0
- package/dist/{file--l_efzg-.mjs → file-CuvAmdJW.mjs} +6 -6
- package/dist/file-CuvAmdJW.mjs.map +1 -0
- package/dist/hooks.mjs +1 -1
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.mjs +124 -326
- package/dist/index.mjs.map +1 -1
- package/dist/middleware.mjs +1 -1
- package/dist/middleware.mjs.map +1 -1
- package/dist/models.mjs.map +1 -1
- package/dist/{msalServer-CqLXgWpO.mjs → msalServer-DLwA7_ta.mjs} +2 -2
- package/dist/msalServer-DLwA7_ta.mjs.map +1 -0
- package/dist/{peoplesoft-DqO-9g-4.mjs → peoplesoft-DGdM1bws.mjs} +2 -2
- package/dist/peoplesoft-DGdM1bws.mjs.map +1 -0
- package/dist/useDialogs-BUzVrTSP.mjs.map +1 -1
- package/dist/{utils-A_Lzklis.mjs → utils-DjdexspV.mjs} +3 -3
- package/dist/utils-DjdexspV.mjs.map +1 -0
- package/dist/utils.mjs +1 -1
- package/dist/vite.mjs.map +1 -1
- package/package.json +11 -11
- package/skills/client-db/SKILL.md +18 -3
- package/skills/db-schema/SKILL.md +9 -2
- package/skills/general/SKILL.md +26 -5
- package/skills/server-functions/SKILL.md +2 -1
- package/skills/start/steps/07-vault-setup.md +76 -64
- package/dist/RouterListItemButton-owZVvuC_.mjs.map +0 -1
- package/dist/authMiddleware-CjKA7C0W.mjs.map +0 -1
- package/dist/entra-DFhYO6Sj.mjs.map +0 -1
- package/dist/file--l_efzg-.mjs.map +0 -1
- package/dist/file-BDeY2atB.mjs.map +0 -1
- package/dist/msalServer-CqLXgWpO.mjs.map +0 -1
- package/dist/peoplesoft-DqO-9g-4.mjs.map +0 -1
- package/dist/utils-A_Lzklis.mjs.map +0 -1
package/dist/data/client.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as fileQueryOptions, c as updateFileMetaMutationOptions, i as fileMetasQueryOptions, l as uploadFileMutationOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions, t as batchDeleteFilesMutationOptions } from "../file
|
|
1
|
+
import { a as fileQueryOptions, c as updateFileMetaMutationOptions, i as fileMetasQueryOptions, l as uploadFileMutationOptions, n as deleteFileMutationOptions, o as fileThumbnailQueryOptions, r as downloadFileMutationOptions, s as openFileMutationOptions, t as batchDeleteFilesMutationOptions } from "../file-CuvAmdJW.mjs";
|
|
2
2
|
import { a as ResubmitApprovalSchema, i as CreateApprovalSchema, n as ApproveApprovalSchema, o as WithdrawApprovalSchema, r as CancelApprovalSchema } from "../Approval-C-hF4jbT.mjs";
|
|
3
|
-
import { C as createApproval, D as withdrawApproval, E as resubmitApproval, S as cancelApproval, T as getApprovals, _ as getPreviousEmployeeIds, a as getActiveEmployees, b as GetApprovalsSchema, c as getDepartmentEmployees, d as getEmployeeByEmployeeId, f as getEmployeeGeneralManager, g as getEmployees, h as getEmployeeSupervisor, i as SearchEmployeesSchema, l as getDepartmentManager, m as getEmployeeSubordinates, n as DepartmentIdSchema, o as getCompanyGeneralManager, p as getEmployeeManager, r as EmployeeIdSchema, s as getDepartmentById, t as CompanyCodeSchema, u as getDepartments, v as searchEmployees, w as getApproval, x as approveApproval, y as GetApprovalSchema } from "../peoplesoft-
|
|
3
|
+
import { C as createApproval, D as withdrawApproval, E as resubmitApproval, S as cancelApproval, T as getApprovals, _ as getPreviousEmployeeIds$1, a as getActiveEmployees$1, b as GetApprovalsSchema, c as getDepartmentEmployees$1, d as getEmployeeByEmployeeId$1, f as getEmployeeGeneralManager$1, g as getEmployees$1, h as getEmployeeSupervisor$1, i as SearchEmployeesSchema, l as getDepartmentManager$1, m as getEmployeeSubordinates$1, n as DepartmentIdSchema, o as getCompanyGeneralManager$1, p as getEmployeeManager$1, r as EmployeeIdSchema, s as getDepartmentById$1, t as CompanyCodeSchema, u as getDepartments$1, v as searchEmployees$1, w as getApproval, x as approveApproval, y as GetApprovalSchema } from "../peoplesoft-DGdM1bws.mjs";
|
|
4
4
|
import { mutationOptions, queryOptions } from "@tanstack/react-query";
|
|
5
5
|
import "zod";
|
|
6
6
|
import { createServerFn } from "@tanstack/react-start";
|
|
@@ -59,21 +59,21 @@ const cancelApprovalMutationOptions = ({ queryClient }) => mutationOptions({
|
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/data/client/peoplesoft.ts
|
|
61
61
|
const QUERY_KEY = "peoplesoft";
|
|
62
|
-
const DAY =
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
const
|
|
62
|
+
const DAY = 864e5;
|
|
63
|
+
const searchEmployees = createServerFn({ method: "GET" }).validator(SearchEmployeesSchema).handler(({ data }) => searchEmployees$1({ data }));
|
|
64
|
+
const getEmployees = createServerFn({ method: "GET" }).handler(() => getEmployees$1());
|
|
65
|
+
const getActiveEmployees = createServerFn({ method: "GET" }).handler(() => getActiveEmployees$1());
|
|
66
|
+
const getEmployeeByEmployeeId = createServerFn({ method: "GET" }).validator(EmployeeIdSchema).handler(({ data }) => getEmployeeByEmployeeId$1({ data }));
|
|
67
|
+
const getPreviousEmployeeIds = createServerFn({ method: "GET" }).handler(() => getPreviousEmployeeIds$1());
|
|
68
|
+
const getEmployeeSupervisor = createServerFn({ method: "GET" }).validator(EmployeeIdSchema).handler(({ data }) => getEmployeeSupervisor$1({ data }));
|
|
69
|
+
const getEmployeeSubordinates = createServerFn({ method: "GET" }).validator(EmployeeIdSchema).handler(({ data }) => getEmployeeSubordinates$1({ data }));
|
|
70
|
+
const getEmployeeManager = createServerFn({ method: "GET" }).validator(EmployeeIdSchema).handler(({ data }) => getEmployeeManager$1({ data }));
|
|
71
|
+
const getEmployeeGeneralManager = createServerFn({ method: "GET" }).validator(EmployeeIdSchema).handler(({ data }) => getEmployeeGeneralManager$1({ data }));
|
|
72
|
+
const getDepartments = createServerFn({ method: "GET" }).handler(() => getDepartments$1());
|
|
73
|
+
const getDepartmentById = createServerFn({ method: "GET" }).validator(DepartmentIdSchema).handler(({ data }) => getDepartmentById$1({ data }));
|
|
74
|
+
const getDepartmentManager = createServerFn({ method: "GET" }).validator(DepartmentIdSchema).handler(({ data }) => getDepartmentManager$1({ data }));
|
|
75
|
+
const getDepartmentEmployees = createServerFn({ method: "GET" }).validator(DepartmentIdSchema).handler(({ data }) => getDepartmentEmployees$1({ data }));
|
|
76
|
+
const getCompanyGeneralManager = createServerFn({ method: "GET" }).validator(CompanyCodeSchema).handler(({ data }) => getCompanyGeneralManager$1({ data }));
|
|
77
77
|
const baseOptions = {
|
|
78
78
|
staleTime: DAY,
|
|
79
79
|
gcTime: DAY,
|
|
@@ -86,12 +86,12 @@ const searchEmployeesQueryOptions = (params) => queryOptions({
|
|
|
86
86
|
"search",
|
|
87
87
|
params
|
|
88
88
|
],
|
|
89
|
-
queryFn: () =>
|
|
89
|
+
queryFn: () => searchEmployees({ data: params }),
|
|
90
90
|
...baseOptions
|
|
91
91
|
});
|
|
92
92
|
const employeesQueryOptions = () => queryOptions({
|
|
93
93
|
queryKey: [QUERY_KEY, "employee"],
|
|
94
|
-
queryFn: () =>
|
|
94
|
+
queryFn: () => getEmployees(),
|
|
95
95
|
...baseOptions
|
|
96
96
|
});
|
|
97
97
|
const activeEmployeesQueryOptions = () => queryOptions({
|
|
@@ -100,7 +100,7 @@ const activeEmployeesQueryOptions = () => queryOptions({
|
|
|
100
100
|
"employee",
|
|
101
101
|
"active"
|
|
102
102
|
],
|
|
103
|
-
queryFn: () =>
|
|
103
|
+
queryFn: () => getActiveEmployees(),
|
|
104
104
|
...baseOptions
|
|
105
105
|
});
|
|
106
106
|
const employeeByEmployeeIdQueryOptions = (params) => queryOptions({
|
|
@@ -109,7 +109,7 @@ const employeeByEmployeeIdQueryOptions = (params) => queryOptions({
|
|
|
109
109
|
"employee",
|
|
110
110
|
params
|
|
111
111
|
],
|
|
112
|
-
queryFn: () =>
|
|
112
|
+
queryFn: () => getEmployeeByEmployeeId({ data: params }),
|
|
113
113
|
...baseOptions
|
|
114
114
|
});
|
|
115
115
|
const previousEmployeeIdsQueryOptions = () => queryOptions({
|
|
@@ -118,7 +118,7 @@ const previousEmployeeIdsQueryOptions = () => queryOptions({
|
|
|
118
118
|
"employee",
|
|
119
119
|
"previousIds"
|
|
120
120
|
],
|
|
121
|
-
queryFn: () =>
|
|
121
|
+
queryFn: () => getPreviousEmployeeIds(),
|
|
122
122
|
...baseOptions
|
|
123
123
|
});
|
|
124
124
|
const employeeSupervisorQueryOptions = (params) => queryOptions({
|
|
@@ -128,7 +128,7 @@ const employeeSupervisorQueryOptions = (params) => queryOptions({
|
|
|
128
128
|
"supervisor",
|
|
129
129
|
params
|
|
130
130
|
],
|
|
131
|
-
queryFn: () =>
|
|
131
|
+
queryFn: () => getEmployeeSupervisor({ data: params }),
|
|
132
132
|
...baseOptions
|
|
133
133
|
});
|
|
134
134
|
const employeeSubordinatesQueryOptions = (params) => queryOptions({
|
|
@@ -138,7 +138,7 @@ const employeeSubordinatesQueryOptions = (params) => queryOptions({
|
|
|
138
138
|
"subordinates",
|
|
139
139
|
params
|
|
140
140
|
],
|
|
141
|
-
queryFn: () =>
|
|
141
|
+
queryFn: () => getEmployeeSubordinates({ data: params }),
|
|
142
142
|
...baseOptions
|
|
143
143
|
});
|
|
144
144
|
const employeeManagerQueryOptions = (params) => queryOptions({
|
|
@@ -148,7 +148,7 @@ const employeeManagerQueryOptions = (params) => queryOptions({
|
|
|
148
148
|
"manager",
|
|
149
149
|
params
|
|
150
150
|
],
|
|
151
|
-
queryFn: () =>
|
|
151
|
+
queryFn: () => getEmployeeManager({ data: params }),
|
|
152
152
|
...baseOptions
|
|
153
153
|
});
|
|
154
154
|
const employeeGeneralManagerQueryOptions = (params) => queryOptions({
|
|
@@ -158,12 +158,12 @@ const employeeGeneralManagerQueryOptions = (params) => queryOptions({
|
|
|
158
158
|
"generalManager",
|
|
159
159
|
params
|
|
160
160
|
],
|
|
161
|
-
queryFn: () =>
|
|
161
|
+
queryFn: () => getEmployeeGeneralManager({ data: params }),
|
|
162
162
|
...baseOptions
|
|
163
163
|
});
|
|
164
164
|
const departmentsQueryOptions = () => queryOptions({
|
|
165
165
|
queryKey: [QUERY_KEY, "department"],
|
|
166
|
-
queryFn: () =>
|
|
166
|
+
queryFn: () => getDepartments(),
|
|
167
167
|
...baseOptions
|
|
168
168
|
});
|
|
169
169
|
const departmentByIdQueryOptions = (params) => queryOptions({
|
|
@@ -172,7 +172,7 @@ const departmentByIdQueryOptions = (params) => queryOptions({
|
|
|
172
172
|
"department",
|
|
173
173
|
params
|
|
174
174
|
],
|
|
175
|
-
queryFn: () =>
|
|
175
|
+
queryFn: () => getDepartmentById({ data: params }),
|
|
176
176
|
...baseOptions
|
|
177
177
|
});
|
|
178
178
|
const departmentManagerQueryOptions = (params) => queryOptions({
|
|
@@ -182,7 +182,7 @@ const departmentManagerQueryOptions = (params) => queryOptions({
|
|
|
182
182
|
"manager",
|
|
183
183
|
params
|
|
184
184
|
],
|
|
185
|
-
queryFn: () =>
|
|
185
|
+
queryFn: () => getDepartmentManager({ data: params }),
|
|
186
186
|
...baseOptions
|
|
187
187
|
});
|
|
188
188
|
const departmentEmployeesQueryOptions = (params) => queryOptions({
|
|
@@ -192,7 +192,7 @@ const departmentEmployeesQueryOptions = (params) => queryOptions({
|
|
|
192
192
|
"employees",
|
|
193
193
|
params
|
|
194
194
|
],
|
|
195
|
-
queryFn: () =>
|
|
195
|
+
queryFn: () => getDepartmentEmployees({ data: params }),
|
|
196
196
|
...baseOptions
|
|
197
197
|
});
|
|
198
198
|
const companyGeneralManagerQueryOptions = (params) => queryOptions({
|
|
@@ -202,10 +202,10 @@ const companyGeneralManagerQueryOptions = (params) => queryOptions({
|
|
|
202
202
|
"generalManager",
|
|
203
203
|
params
|
|
204
204
|
],
|
|
205
|
-
queryFn: () =>
|
|
205
|
+
queryFn: () => getCompanyGeneralManager({ data: params }),
|
|
206
206
|
...baseOptions
|
|
207
207
|
});
|
|
208
208
|
//#endregion
|
|
209
|
-
export { activeEmployeesQueryOptions, approvalQueryOptions, approvalsQueryOptions, approveApprovalMutationOptions, batchDeleteFilesMutationOptions, cancelApprovalMutationOptions, companyGeneralManagerQueryOptions, createApprovalMutationOptions, deleteFileMutationOptions, departmentByIdQueryOptions, departmentEmployeesQueryOptions, departmentManagerQueryOptions, departmentsQueryOptions, downloadFileMutationOptions, employeeByEmployeeIdQueryOptions, employeeGeneralManagerQueryOptions, employeeManagerQueryOptions, employeeSubordinatesQueryOptions, employeeSupervisorQueryOptions, employeesQueryOptions, fileMetasQueryOptions, fileQueryOptions, fileThumbnailQueryOptions, openFileMutationOptions, previousEmployeeIdsQueryOptions, resubmitApprovalMutationOptions, searchEmployeesQueryOptions, updateFileMetaMutationOptions, uploadFileMutationOptions, withdrawApprovalMutationOptions };
|
|
209
|
+
export { activeEmployeesQueryOptions, approvalQueryOptions, approvalsQueryOptions, approveApprovalMutationOptions, batchDeleteFilesMutationOptions, cancelApprovalMutationOptions, companyGeneralManagerQueryOptions, createApprovalMutationOptions, deleteFileMutationOptions, departmentByIdQueryOptions, departmentEmployeesQueryOptions, departmentManagerQueryOptions, departmentsQueryOptions, downloadFileMutationOptions, employeeByEmployeeIdQueryOptions, employeeGeneralManagerQueryOptions, employeeManagerQueryOptions, employeeSubordinatesQueryOptions, employeeSupervisorQueryOptions, employeesQueryOptions, fileMetasQueryOptions, fileQueryOptions, fileThumbnailQueryOptions, getActiveEmployees, getCompanyGeneralManager, getDepartmentById, getDepartmentEmployees, getDepartmentManager, getDepartments, getEmployeeByEmployeeId, getEmployeeGeneralManager, getEmployeeManager, getEmployeeSubordinates, getEmployeeSupervisor, getEmployees, getPreviousEmployeeIds, openFileMutationOptions, previousEmployeeIdsQueryOptions, resubmitApprovalMutationOptions, searchEmployees, searchEmployeesQueryOptions, updateFileMetaMutationOptions, uploadFileMutationOptions, withdrawApprovalMutationOptions };
|
|
210
210
|
|
|
211
211
|
//# sourceMappingURL=client.mjs.map
|
package/dist/data/client.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.mjs","names":["mutationOptions","queryOptions","createServerFn","z","QueryClientParam","ApproveApprovalSchema","CancelApprovalSchema","CreateApprovalSchema","ResubmitApprovalSchema","WithdrawApprovalSchema","GetApprovalSchema","GetApprovalsSchema","approveApproval","cancelApproval","createApproval","getApproval","getApprovals","resubmitApproval","withdrawApproval","QUERY_KEY","getApprovalsRpc","method","validator","handler","data","getApprovalRpc","createApprovalRpc","approveApprovalRpc","resubmitApprovalRpc","withdrawApprovalRpc","cancelApprovalRpc","approvalsQueryOptions","params","input","queryKey","queryFn","approvalQueryOptions","createApprovalMutationOptions","queryClient","mutationFn","onSettled","invalidateQueries","exact","approveApprovalMutationOptions","resubmitApprovalMutationOptions","withdrawApprovalMutationOptions","cancelApprovalMutationOptions","queryOptions","createServerFn","z","CompanyCodeSchema","DepartmentIdSchema","EmployeeIdSchema","getActiveEmployees","getCompanyGeneralManager","getDepartmentById","getDepartmentEmployees","getDepartmentManager","getDepartments","getEmployeeByEmployeeId","getEmployeeGeneralManager","getEmployeeManager","getEmployees","getEmployeeSubordinates","getEmployeeSupervisor","getPreviousEmployeeIds","searchEmployees","SearchEmployeesSchema","QUERY_KEY","DAY","searchEmployeesRpc","method","validator","handler","data","getEmployeesRpc","getActiveEmployeesRpc","getEmployeeByEmployeeIdRpc","getPreviousEmployeeIdsRpc","getEmployeeSupervisorRpc","getEmployeeSubordinatesRpc","getEmployeeManagerRpc","getEmployeeGeneralManagerRpc","getDepartmentsRpc","getDepartmentByIdRpc","getDepartmentManagerRpc","getDepartmentEmployeesRpc","getCompanyGeneralManagerRpc","baseOptions","staleTime","gcTime","refetchOnWindowFocus","searchEmployeesQueryOptions","params","infer","queryKey","queryFn","employeesQueryOptions","activeEmployeesQueryOptions","employeeByEmployeeIdQueryOptions","previousEmployeeIdsQueryOptions","employeeSupervisorQueryOptions","employeeSubordinatesQueryOptions","employeeManagerQueryOptions","employeeGeneralManagerQueryOptions","departmentsQueryOptions","departmentByIdQueryOptions","departmentManagerQueryOptions","departmentEmployeesQueryOptions","companyGeneralManagerQueryOptions"],"sources":["../../src/data/client/approval.ts","../../src/data/client/peoplesoft.ts"],"sourcesContent":["import { mutationOptions, queryOptions } from \"@tanstack/react-query\";\nimport { createServerFn } from \"@tanstack/react-start\";\nimport type { z } from \"zod\";\nimport type { QueryClientParam } from \"~/models/QueryClientParam\";\nimport {\n ApproveApprovalSchema,\n CancelApprovalSchema,\n CreateApprovalSchema,\n ResubmitApprovalSchema,\n WithdrawApprovalSchema,\n} from \"~/models/approval/Approval\";\nimport {\n GetApprovalSchema,\n GetApprovalsSchema,\n approveApproval,\n cancelApproval,\n createApproval,\n getApproval,\n getApprovals,\n resubmitApproval,\n withdrawApproval,\n} from \"~/data/server/approval\";\n\nconst QUERY_KEY = \"approval\";\n\nconst getApprovalsRpc = createServerFn({ method: \"GET\" })\n .validator(GetApprovalsSchema)\n .handler(({ data }) => getApprovals({ data }));\n\nconst getApprovalRpc = createServerFn({ method: \"GET\" })\n .validator(GetApprovalSchema)\n .handler(({ data }) => getApproval({ data }));\n\nconst createApprovalRpc = createServerFn({ method: \"POST\" })\n .validator(CreateApprovalSchema)\n .handler(({ data }) => createApproval({ data }));\n\nconst approveApprovalRpc = createServerFn({ method: \"POST\" })\n .validator(ApproveApprovalSchema)\n .handler(({ data }) => approveApproval({ data }));\n\nconst resubmitApprovalRpc = createServerFn({ method: \"POST\" })\n .validator(ResubmitApprovalSchema)\n .handler(({ data }) => resubmitApproval({ data }));\n\nconst withdrawApprovalRpc = createServerFn({ method: \"POST\" })\n .validator(WithdrawApprovalSchema)\n .handler(({ data }) => withdrawApproval({ data }));\n\nconst cancelApprovalRpc = createServerFn({ method: \"POST\" })\n .validator(CancelApprovalSchema)\n .handler(({ data }) => cancelApproval({ data }));\n\nexport const approvalsQueryOptions = (params: z.input<typeof GetApprovalsSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, params],\n queryFn: () => getApprovalsRpc({ data: params }),\n });\n\nexport const approvalQueryOptions = (params: z.input<typeof GetApprovalSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, params],\n queryFn: () => getApprovalRpc({ data: params }),\n });\n\nexport const createApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\n mutationOptions({\n mutationFn: (data: z.input<typeof CreateApprovalSchema>) => createApprovalRpc({ data }),\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\n });\n\nexport const approveApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\n mutationOptions({\n mutationFn: (data: z.input<typeof ApproveApprovalSchema>) => approveApprovalRpc({ data }),\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\n });\n\nexport const resubmitApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\n mutationOptions({\n mutationFn: (data: z.input<typeof ResubmitApprovalSchema>) => resubmitApprovalRpc({ data }),\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\n });\n\nexport const withdrawApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\n mutationOptions({\n mutationFn: (data: z.input<typeof WithdrawApprovalSchema>) => withdrawApprovalRpc({ data }),\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\n });\n\nexport const cancelApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\n mutationOptions({\n mutationFn: (data: z.input<typeof CancelApprovalSchema>) => cancelApprovalRpc({ data }),\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\n });\n","import { queryOptions } from \"@tanstack/react-query\";\nimport { createServerFn } from \"@tanstack/react-start\";\nimport z from \"zod\";\nimport {\n CompanyCodeSchema,\n DepartmentIdSchema,\n EmployeeIdSchema,\n getActiveEmployees,\n getCompanyGeneralManager,\n getDepartmentById,\n getDepartmentEmployees,\n getDepartmentManager,\n getDepartments,\n getEmployeeByEmployeeId,\n getEmployeeGeneralManager,\n getEmployeeManager,\n getEmployees,\n getEmployeeSubordinates,\n getEmployeeSupervisor,\n getPreviousEmployeeIds,\n searchEmployees,\n SearchEmployeesSchema,\n} from \"~/data/server/peoplesoft\";\n\nconst QUERY_KEY = \"peoplesoft\";\nconst DAY = 1000 * 60 * 60 * 24;\n\nconst searchEmployeesRpc = createServerFn({ method: \"GET\" })\n .validator(SearchEmployeesSchema)\n .handler(({ data }) => searchEmployees({ data }));\n\nconst getEmployeesRpc = createServerFn({ method: \"GET\" }).handler(() => getEmployees());\n\nconst getActiveEmployeesRpc = createServerFn({ method: \"GET\" }).handler(() => getActiveEmployees());\n\nconst getEmployeeByEmployeeIdRpc = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeByEmployeeId({ data }));\n\nconst getPreviousEmployeeIdsRpc = createServerFn({ method: \"GET\" }).handler(() =>\n getPreviousEmployeeIds(),\n);\n\nconst getEmployeeSupervisorRpc = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeSupervisor({ data }));\n\nconst getEmployeeSubordinatesRpc = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeSubordinates({ data }));\n\nconst getEmployeeManagerRpc = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeManager({ data }));\n\nconst getEmployeeGeneralManagerRpc = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeGeneralManager({ data }));\n\nconst getDepartmentsRpc = createServerFn({ method: \"GET\" }).handler(() => getDepartments());\n\nconst getDepartmentByIdRpc = createServerFn({ method: \"GET\" })\n .validator(DepartmentIdSchema)\n .handler(({ data }) => getDepartmentById({ data }));\n\nconst getDepartmentManagerRpc = createServerFn({ method: \"GET\" })\n .validator(DepartmentIdSchema)\n .handler(({ data }) => getDepartmentManager({ data }));\n\nconst getDepartmentEmployeesRpc = createServerFn({ method: \"GET\" })\n .validator(DepartmentIdSchema)\n .handler(({ data }) => getDepartmentEmployees({ data }));\n\nconst getCompanyGeneralManagerRpc = createServerFn({ method: \"GET\" })\n .validator(CompanyCodeSchema)\n .handler(({ data }) => getCompanyGeneralManager({ data }));\n\nconst baseOptions = {\n staleTime: DAY,\n gcTime: DAY,\n refetchOnWindowFocus: false,\n};\n\nexport const searchEmployeesQueryOptions = (params: z.infer<typeof SearchEmployeesSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"search\", params],\n queryFn: () => searchEmployeesRpc({ data: params }),\n ...baseOptions,\n });\n\nexport const employeesQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\"],\n queryFn: () => getEmployeesRpc(),\n ...baseOptions,\n });\n\nexport const activeEmployeesQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"active\"],\n queryFn: () => getActiveEmployeesRpc(),\n ...baseOptions,\n });\n\nexport const employeeByEmployeeIdQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", params],\n queryFn: () => getEmployeeByEmployeeIdRpc({ data: params }),\n ...baseOptions,\n });\n\nexport const previousEmployeeIdsQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"previousIds\"],\n queryFn: () => getPreviousEmployeeIdsRpc(),\n ...baseOptions,\n });\n\nexport const employeeSupervisorQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"supervisor\", params],\n queryFn: () => getEmployeeSupervisorRpc({ data: params }),\n ...baseOptions,\n });\n\nexport const employeeSubordinatesQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"subordinates\", params],\n queryFn: () => getEmployeeSubordinatesRpc({ data: params }),\n ...baseOptions,\n });\n\nexport const employeeManagerQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"manager\", params],\n queryFn: () => getEmployeeManagerRpc({ data: params }),\n ...baseOptions,\n });\n\nexport const employeeGeneralManagerQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"generalManager\", params],\n queryFn: () => getEmployeeGeneralManagerRpc({ data: params }),\n ...baseOptions,\n });\n\nexport const departmentsQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\"],\n queryFn: () => getDepartmentsRpc(),\n ...baseOptions,\n });\n\nexport const departmentByIdQueryOptions = (params: z.infer<typeof DepartmentIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\", params],\n queryFn: () => getDepartmentByIdRpc({ data: params }),\n ...baseOptions,\n });\n\nexport const departmentManagerQueryOptions = (params: z.infer<typeof DepartmentIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\", \"manager\", params],\n queryFn: () => getDepartmentManagerRpc({ data: params }),\n ...baseOptions,\n });\n\nexport const departmentEmployeesQueryOptions = (params: z.infer<typeof DepartmentIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\", \"employees\", params],\n queryFn: () => getDepartmentEmployeesRpc({ data: params }),\n ...baseOptions,\n });\n\nexport const companyGeneralManagerQueryOptions = (params: z.infer<typeof CompanyCodeSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"company\", \"generalManager\", params],\n queryFn: () => getCompanyGeneralManagerRpc({ data: params }),\n ...baseOptions,\n });\n"],"mappings":";;;;;;;AAuBA,MAAMmB,cAAY;AAElB,MAAMC,kBAAkBlB,eAAe,EAAEmB,QAAQ,MAAM,CAAC,CAAC,CACtDC,UAAUX,kBAAkB,CAAC,CAC7BY,SAAS,EAAEC,WAAWR,aAAa,EAAEQ,KAAK,CAAC,CAAC;AAE/C,MAAMC,iBAAiBvB,eAAe,EAAEmB,QAAQ,MAAM,CAAC,CAAC,CACrDC,UAAUZ,iBAAiB,CAAC,CAC5Ba,SAAS,EAAEC,WAAWT,YAAY,EAAES,KAAK,CAAC,CAAC;AAE9C,MAAME,oBAAoBxB,eAAe,EAAEmB,QAAQ,OAAO,CAAC,CAAC,CACzDC,UAAUf,oBAAoB,CAAC,CAC/BgB,SAAS,EAAEC,WAAWV,eAAe,EAAE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AAMmB,OAAO,CAAC;CAC1D,GAAGL;AACL,CAAC;AAEH,MAAae,+BAA+BV,WAC1C9C,aAAa;CACXgD,UAAU;EAAC3B;EAAW;EAAY;EAAWyB;CAAM;CACnDG,eAAef,sBAAsB,EAAEP,MAAMmB,OAAO,CAAC;CACrD,GAAGL;AACL,CAAC;AAEH,MAAagB,sCAAsCX,WACjD9C,aAAa;CACXgD,UAAU;EAAC3B;EAAW;EAAY;EAAkByB;CAAM;CAC1DG,eAAed,6BAA6B,EAAER,MAAMmB,OAAO,CAAC;CAC5D,GAAGL;AACL,CAAC;AAEH,MAAaiB,gCACX1D,aAAa;CACXgD,UAAU,CAAC3B,WAAW,YAAY;CAClC4B,eAAeb,kBAAkB;CACjC,GAAGK;AACL,CAAC;AAEH,MAAakB,8BAA8Bb,WACzC9C,aAAa;CACXgD,UAAU;EAAC3B;EAAW;EAAcyB;CAAM;CAC1CG,eAAeZ,qBAAqB,EAAEV,MAAMmB,OAAO,CAAC;CACpD,GAAGL;AACL,CAAC;AAEH,MAAamB,iCAAiCd,WAC5C9C,aAAa;CACXgD,UAAU;EAAC3B;EAAW;EAAc;EAAWyB;CAAM;CACrDG,eAAeX,wBAAwB,EAAEX,MAAMmB,OAAO,CAAC;CACvD,GAAGL;AACL,CAAC;AAEH,MAAaoB,mCAAmCf,WAC9C9C,aAAa;CACXgD,UAAU;EAAC3B;EAAW;EAAc;EAAayB;CAAM;CACvDG,eAAeV,0BAA0B,EAAEZ,MAAMmB,OAAO,CAAC;CACzD,GAAGL;AACL,CAAC;AAEH,MAAaqB,qCAAqChB,WAChD9C,aAAa;CACXgD,UAAU;EAAC3B;EAAW;EAAW;EAAkByB;CAAM;CACzDG,eAAeT,4BAA4B,EAAEb,MAAMmB,OAAO,CAAC;CAC3D,GAAGL;AACL,CAAC"}
|
|
1
|
+
{"version":3,"file":"client.mjs","names":[],"sources":["../../src/data/client/approval.ts","../../src/data/client/peoplesoft.ts"],"sourcesContent":["import { mutationOptions, queryOptions } from \"@tanstack/react-query\";\r\nimport { createServerFn } from \"@tanstack/react-start\";\r\nimport type { z } from \"zod\";\r\nimport type { QueryClientParam } from \"~/models/QueryClientParam\";\r\nimport {\r\n ApproveApprovalSchema,\r\n CancelApprovalSchema,\r\n CreateApprovalSchema,\r\n ResubmitApprovalSchema,\r\n WithdrawApprovalSchema,\r\n} from \"~/models/approval/Approval\";\r\nimport {\r\n GetApprovalSchema,\r\n GetApprovalsSchema,\r\n approveApproval,\r\n cancelApproval,\r\n createApproval,\r\n getApproval,\r\n getApprovals,\r\n resubmitApproval,\r\n withdrawApproval,\r\n} from \"~/data/server/approval\";\r\n\r\nconst QUERY_KEY = \"approval\";\r\n\r\nconst getApprovalsRpc = createServerFn({ method: \"GET\" })\r\n .validator(GetApprovalsSchema)\r\n .handler(({ data }) => getApprovals({ data }));\r\n\r\nconst getApprovalRpc = createServerFn({ method: \"GET\" })\r\n .validator(GetApprovalSchema)\r\n .handler(({ data }) => getApproval({ data }));\r\n\r\nconst createApprovalRpc = createServerFn({ method: \"POST\" })\r\n .validator(CreateApprovalSchema)\r\n .handler(({ data }) => createApproval({ data }));\r\n\r\nconst approveApprovalRpc = createServerFn({ method: \"POST\" })\r\n .validator(ApproveApprovalSchema)\r\n .handler(({ data }) => approveApproval({ data }));\r\n\r\nconst resubmitApprovalRpc = createServerFn({ method: \"POST\" })\r\n .validator(ResubmitApprovalSchema)\r\n .handler(({ data }) => resubmitApproval({ data }));\r\n\r\nconst withdrawApprovalRpc = createServerFn({ method: \"POST\" })\r\n .validator(WithdrawApprovalSchema)\r\n .handler(({ data }) => withdrawApproval({ data }));\r\n\r\nconst cancelApprovalRpc = createServerFn({ method: \"POST\" })\r\n .validator(CancelApprovalSchema)\r\n .handler(({ data }) => cancelApproval({ data }));\r\n\r\nexport const approvalsQueryOptions = (params: z.input<typeof GetApprovalsSchema>) =>\r\n queryOptions({\r\n queryKey: [QUERY_KEY, params],\r\n queryFn: () => getApprovalsRpc({ data: params }),\r\n });\r\n\r\nexport const approvalQueryOptions = (params: z.input<typeof GetApprovalSchema>) =>\r\n queryOptions({\r\n queryKey: [QUERY_KEY, params],\r\n queryFn: () => getApprovalRpc({ data: params }),\r\n });\r\n\r\nexport const createApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof CreateApprovalSchema>) => createApprovalRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\r\n });\r\n\r\nexport const approveApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof ApproveApprovalSchema>) => approveApprovalRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\r\n });\r\n\r\nexport const resubmitApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof ResubmitApprovalSchema>) => resubmitApprovalRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\r\n });\r\n\r\nexport const withdrawApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof WithdrawApprovalSchema>) => withdrawApprovalRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\r\n });\r\n\r\nexport const cancelApprovalMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof CancelApprovalSchema>) => cancelApprovalRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY], exact: false }),\r\n });\r\n","import { queryOptions } from \"@tanstack/react-query\";\nimport { createServerFn } from \"@tanstack/react-start\";\nimport z from \"zod\";\nimport {\n CompanyCodeSchema,\n DepartmentIdSchema,\n EmployeeIdSchema,\n getActiveEmployees as getActiveEmployeesServerFn,\n getCompanyGeneralManager as getCompanyGeneralManagerServerFn,\n getDepartmentById as getDepartmentByIdServerFn,\n getDepartmentEmployees as getDepartmentEmployeesServerFn,\n getDepartmentManager as getDepartmentManagerServerFn,\n getDepartments as getDepartmentsServerFn,\n getEmployeeByEmployeeId as getEmployeeByEmployeeIdServerFn,\n getEmployeeGeneralManager as getEmployeeGeneralManagerServerFn,\n getEmployeeManager as getEmployeeManagerServerFn,\n getEmployees as getEmployeesServerFn,\n getEmployeeSubordinates as getEmployeeSubordinatesServerFn,\n getEmployeeSupervisor as getEmployeeSupervisorServerFn,\n getPreviousEmployeeIds as getPreviousEmployeeIdsServerFn,\n searchEmployees as searchEmployeesServerFn,\n SearchEmployeesSchema,\n} from \"~/data/server/peoplesoft\";\n\nconst QUERY_KEY = \"peoplesoft\";\nconst DAY = 1000 * 60 * 60 * 24;\n\nexport const searchEmployees = createServerFn({ method: \"GET\" })\n .validator(SearchEmployeesSchema)\n .handler(({ data }) => searchEmployeesServerFn({ data }));\n\nexport const getEmployees = createServerFn({ method: \"GET\" }).handler(() => getEmployeesServerFn());\n\nexport const getActiveEmployees = createServerFn({ method: \"GET\" }).handler(() =>\n getActiveEmployeesServerFn(),\n);\n\nexport const getEmployeeByEmployeeId = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeByEmployeeIdServerFn({ data }));\n\nexport const getPreviousEmployeeIds = createServerFn({ method: \"GET\" }).handler(() =>\n getPreviousEmployeeIdsServerFn(),\n);\n\nexport const getEmployeeSupervisor = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeSupervisorServerFn({ data }));\n\nexport const getEmployeeSubordinates = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeSubordinatesServerFn({ data }));\n\nexport const getEmployeeManager = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeManagerServerFn({ data }));\n\nexport const getEmployeeGeneralManager = createServerFn({ method: \"GET\" })\n .validator(EmployeeIdSchema)\n .handler(({ data }) => getEmployeeGeneralManagerServerFn({ data }));\n\nexport const getDepartments = createServerFn({ method: \"GET\" }).handler(() =>\n getDepartmentsServerFn(),\n);\n\nexport const getDepartmentById = createServerFn({ method: \"GET\" })\n .validator(DepartmentIdSchema)\n .handler(({ data }) => getDepartmentByIdServerFn({ data }));\n\nexport const getDepartmentManager = createServerFn({ method: \"GET\" })\n .validator(DepartmentIdSchema)\n .handler(({ data }) => getDepartmentManagerServerFn({ data }));\n\nexport const getDepartmentEmployees = createServerFn({ method: \"GET\" })\n .validator(DepartmentIdSchema)\n .handler(({ data }) => getDepartmentEmployeesServerFn({ data }));\n\nexport const getCompanyGeneralManager = createServerFn({ method: \"GET\" })\n .validator(CompanyCodeSchema)\n .handler(({ data }) => getCompanyGeneralManagerServerFn({ data }));\n\nconst baseOptions = {\n staleTime: DAY,\n gcTime: DAY,\n refetchOnWindowFocus: false,\n};\n\nexport const searchEmployeesQueryOptions = (params: z.infer<typeof SearchEmployeesSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"search\", params],\n queryFn: () => searchEmployees({ data: params }),\n ...baseOptions,\n });\n\nexport const employeesQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\"],\n queryFn: () => getEmployees(),\n ...baseOptions,\n });\n\nexport const activeEmployeesQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"active\"],\n queryFn: () => getActiveEmployees(),\n ...baseOptions,\n });\n\nexport const employeeByEmployeeIdQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", params],\n queryFn: () => getEmployeeByEmployeeId({ data: params }),\n ...baseOptions,\n });\n\nexport const previousEmployeeIdsQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"previousIds\"],\n queryFn: () => getPreviousEmployeeIds(),\n ...baseOptions,\n });\n\nexport const employeeSupervisorQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"supervisor\", params],\n queryFn: () => getEmployeeSupervisor({ data: params }),\n ...baseOptions,\n });\n\nexport const employeeSubordinatesQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"subordinates\", params],\n queryFn: () => getEmployeeSubordinates({ data: params }),\n ...baseOptions,\n });\n\nexport const employeeManagerQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"manager\", params],\n queryFn: () => getEmployeeManager({ data: params }),\n ...baseOptions,\n });\n\nexport const employeeGeneralManagerQueryOptions = (params: z.infer<typeof EmployeeIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"employee\", \"generalManager\", params],\n queryFn: () => getEmployeeGeneralManager({ data: params }),\n ...baseOptions,\n });\n\nexport const departmentsQueryOptions = () =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\"],\n queryFn: () => getDepartments(),\n ...baseOptions,\n });\n\nexport const departmentByIdQueryOptions = (params: z.infer<typeof DepartmentIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\", params],\n queryFn: () => getDepartmentById({ data: params }),\n ...baseOptions,\n });\n\nexport const departmentManagerQueryOptions = (params: z.infer<typeof DepartmentIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\", \"manager\", params],\n queryFn: () => getDepartmentManager({ data: params }),\n ...baseOptions,\n });\n\nexport const departmentEmployeesQueryOptions = (params: z.infer<typeof DepartmentIdSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"department\", \"employees\", params],\n queryFn: () => getDepartmentEmployees({ data: params }),\n ...baseOptions,\n });\n\nexport const companyGeneralManagerQueryOptions = (params: z.infer<typeof CompanyCodeSchema>) =>\n queryOptions({\n queryKey: [QUERY_KEY, \"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ACvD,GAAG;AACL,CAAC;AAEH,MAAa,+BAA+B,WAC1C,aAAa;CACX,UAAU;EAAC;EAAW;EAAY;EAAW;CAAM;CACnD,eAAe,mBAAmB,EAAE,MAAM,OAAO,CAAC;CAClD,GAAG;AACL,CAAC;AAEH,MAAa,sCAAsC,WACjD,aAAa;CACX,UAAU;EAAC;EAAW;EAAY;EAAkB;CAAM;CAC1D,eAAe,0BAA0B,EAAE,MAAM,OAAO,CAAC;CACzD,GAAG;AACL,CAAC;AAEH,MAAa,gCACX,aAAa;CACX,UAAU,CAAC,WAAW,YAAY;CAClC,eAAe,eAAe;CAC9B,GAAG;AACL,CAAC;AAEH,MAAa,8BAA8B,WACzC,aAAa;CACX,UAAU;EAAC;EAAW;EAAc;CAAM;CAC1C,eAAe,kBAAkB,EAAE,MAAM,OAAO,CAAC;CACjD,GAAG;AACL,CAAC;AAEH,MAAa,iCAAiC,WAC5C,aAAa;CACX,UAAU;EAAC;EAAW;EAAc;EAAW;CAAM;CACrD,eAAe,qBAAqB,EAAE,MAAM,OAAO,CAAC;CACpD,GAAG;AACL,CAAC;AAEH,MAAa,mCAAmC,WAC9C,aAAa;CACX,UAAU;EAAC;EAAW;EAAc;EAAa;CAAM;CACvD,eAAe,uBAAuB,EAAE,MAAM,OAAO,CAAC;CACtD,GAAG;AACL,CAAC;AAEH,MAAa,qCAAqC,WAChD,aAAa;CACX,UAAU;EAAC;EAAW;EAAW;EAAkB;CAAM;CACzD,eAAe,yBAAyB,EAAE,MAAM,OAAO,CAAC;CACxD,GAAG;AACL,CAAC"}
|
package/dist/data/server.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as batchDeleteFiles, c as getFile, d as updateFileMeta, f as uploadFile, i as UploadFileMetaSchema, l as getFileMetas, n as GetFileMetasSchema, o as deleteFile, p as createApi, r as UpdateFileMetaSchema, s as downloadFile, t as FileSchema, u as getFileThumbnail } from "../file-
|
|
1
|
+
import { a as batchDeleteFiles, c as getFile, d as updateFileMeta, f as uploadFile, i as UploadFileMetaSchema, l as getFileMetas, n as GetFileMetasSchema, o as deleteFile, p as createApi, r as UpdateFileMetaSchema, s as downloadFile, t as FileSchema, u as getFileThumbnail } from "../file-BTFDDalH.mjs";
|
|
2
2
|
import { t as EmailSchema } from "../Email-BzQQkbe9.mjs";
|
|
3
|
-
import { C as createApproval, D as withdrawApproval, E as resubmitApproval, S as cancelApproval, T as getApprovals, _ as getPreviousEmployeeIds, a as getActiveEmployees, b as GetApprovalsSchema, c as getDepartmentEmployees, d as getEmployeeByEmployeeId, f as getEmployeeGeneralManager, g as getEmployees, h as getEmployeeSupervisor, i as SearchEmployeesSchema, l as getDepartmentManager, m as getEmployeeSubordinates, n as DepartmentIdSchema, o as getCompanyGeneralManager, p as getEmployeeManager, r as EmployeeIdSchema, s as getDepartmentById, t as CompanyCodeSchema, u as getDepartments, v as searchEmployees, w as getApproval, x as approveApproval, y as GetApprovalSchema } from "../peoplesoft-
|
|
3
|
+
import { C as createApproval, D as withdrawApproval, E as resubmitApproval, S as cancelApproval, T as getApprovals, _ as getPreviousEmployeeIds, a as getActiveEmployees, b as GetApprovalsSchema, c as getDepartmentEmployees, d as getEmployeeByEmployeeId, f as getEmployeeGeneralManager, g as getEmployees, h as getEmployeeSupervisor, i as SearchEmployeesSchema, l as getDepartmentManager, m as getEmployeeSubordinates, n as DepartmentIdSchema, o as getCompanyGeneralManager, p as getEmployeeManager, r as EmployeeIdSchema, s as getDepartmentById, t as CompanyCodeSchema, u as getDepartments, v as searchEmployees, w as getApproval, x as approveApproval, y as GetApprovalSchema } from "../peoplesoft-DGdM1bws.mjs";
|
|
4
4
|
import { createServerOnlyFn } from "@tanstack/react-start";
|
|
5
5
|
//#region src/data/server/email.ts
|
|
6
6
|
const sendEmail = createServerOnlyFn(async ({ data }) => {
|
package/dist/data/server.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.mjs","names":[
|
|
1
|
+
{"version":3,"file":"server.mjs","names":[],"sources":["../../src/data/server/email.ts"],"sourcesContent":["import { createServerOnlyFn } from \"@tanstack/react-start\";\nimport type { z } from \"zod\";\nimport { createApi } from \"~/lib/createApi\";\nimport { EmailSchema } from \"~/models/email/Email\";\n\nexport const sendEmail = createServerOnlyFn(\n async ({ data }: { data: z.input<typeof EmailSchema> }): Promise<void> => {\n const email = EmailSchema.parse(data);\n const api = await createApi({ baseURL: \"EMAIL_BASE_URL\", scopeKey: \"email\" });\n await api.post(\"/v1/email\", email);\n },\n);\n"],"mappings":";;;;;AAKA,MAAa,YAAY,mBACvB,OAAO,EAAE,WAAiE;CACxE,MAAM,QAAQ,YAAY,MAAM,IAAI;CAEpC,OAAM,MADY,UAAU;EAAE,SAAS;EAAkB,UAAU;CAAQ,CAAC,EAAA,CAClE,KAAK,aAAa,KAAK;AACnC,CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as serverEnv } from "./utils-
|
|
1
|
+
import { m as serverEnv } from "./utils-DjdexspV.mjs";
|
|
2
2
|
import { ConfidentialClientApplication, CryptoProvider, InteractionRequiredAuthError, ServerError } from "@azure/msal-node";
|
|
3
3
|
//#region src/lib/auth/entra.ts
|
|
4
4
|
/**
|
|
@@ -106,4 +106,4 @@ function buildLogoutUrl(postLogoutRedirectUri) {
|
|
|
106
106
|
//#endregion
|
|
107
107
|
export { SessionExpiredError, acquireDelegatedToken, buildAuthCodeUrl, buildLogoutUrl, createConfidentialClient, cryptoProvider, exchangeCodeForSession };
|
|
108
108
|
|
|
109
|
-
//# sourceMappingURL=entra-
|
|
109
|
+
//# sourceMappingURL=entra-CJSyeQsx.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entra-CJSyeQsx.mjs","names":[],"sources":["../src/lib/auth/entra.ts"],"sourcesContent":["import {\r\n ConfidentialClientApplication,\r\n CryptoProvider,\r\n InteractionRequiredAuthError,\r\n ServerError,\r\n} from \"@azure/msal-node\";\r\nimport type { TokenPayload } from \"~/models/TokenPayload\";\r\nimport { serverEnv } from \"~/env\";\r\n\r\n/**\r\n * Scopes requested during the interactive login. `offline_access` yields the\r\n * refresh token that the session is built around; `User.Read` lets us read the\r\n * user's Graph profile (e.g. avatar). Resource API scopes (file, approval, …) are\r\n * acquired on demand via {@link acquireDelegatedToken} using the multi-resource\r\n * refresh token.\r\n */\r\nexport const LOGIN_SCOPES = [\"openid\", \"profile\", \"offline_access\", \"User.Read\"];\r\n\r\n/** Entra authority for this tenant. */\r\nexport const ENTRA_AUTHORITY = `https://login.microsoftonline.com/${serverEnv.ENTRA_TENANT_ID}`;\r\n\r\n/** Shared across login/callback/refresh calls — stateless and cheap to reuse. */\r\nexport const cryptoProvider = new CryptoProvider();\r\n\r\n/**\r\n * Creates a confidential client (no persistent cache plugin).\r\n *\r\n * The interactive/refresh flows below deliberately use a FRESH client per token\r\n * operation rather than a singleton: the client's in-memory cache then holds only\r\n * that operation's tokens, so {@link extractRefreshToken} reads the correct user's\r\n * refresh token — a shared client would accumulate (and leak) every user's tokens.\r\n * Persisting just the refresh token (not the whole multi-KB MSAL cache) is what\r\n * keeps the session in a small cookie with no server-side token store.\r\n */\r\nexport const createConfidentialClient = (): ConfidentialClientApplication =>\r\n new ConfidentialClientApplication({\r\n auth: {\r\n clientId: serverEnv.ENTRA_CLIENT_ID,\r\n clientSecret: serverEnv.ENTRA_CLIENT_SECRET,\r\n authority: ENTRA_AUTHORITY,\r\n },\r\n });\r\n\r\n/**\r\n * Pulls the refresh-token secret out of a client's in-memory MSAL cache. MSAL\r\n * intentionally hides refresh tokens, so reading the serialized cache is the only\r\n * way to persist just the RT (instead of the whole cache) in the session cookie.\r\n */\r\nfunction extractRefreshToken(client: ConfidentialClientApplication): string | undefined {\r\n const cache = JSON.parse(client.getTokenCache().serialize()) as {\r\n RefreshToken?: Record<string, { secret?: string }>;\r\n };\r\n return Object.values(cache.RefreshToken ?? {})[0]?.secret;\r\n}\r\n\r\n/** First leg of the auth-code flow: the URL to redirect the browser to. */\r\nexport function buildAuthCodeUrl(opts: {\r\n redirectUri: string;\r\n state: string;\r\n codeChallenge: string;\r\n}): Promise<string> {\r\n return createConfidentialClient().getAuthCodeUrl({\r\n scopes: LOGIN_SCOPES,\r\n redirectUri: opts.redirectUri,\r\n responseMode: \"query\",\r\n state: opts.state,\r\n codeChallenge: opts.codeChallenge,\r\n codeChallengeMethod: \"S256\",\r\n });\r\n}\r\n\r\n/**\r\n * Second leg of the auth-code flow: exchange the code for tokens, returning the\r\n * refresh token and the id-token claims to persist in the session.\r\n */\r\nexport async function exchangeCodeForSession(opts: {\r\n code: string;\r\n redirectUri: string;\r\n codeVerifier: string;\r\n}): Promise<{ refreshToken: string; claims: TokenPayload }> {\r\n const client = createConfidentialClient();\r\n const result = await client.acquireTokenByCode({\r\n code: opts.code,\r\n scopes: LOGIN_SCOPES,\r\n redirectUri: opts.redirectUri,\r\n codeVerifier: opts.codeVerifier,\r\n });\r\n\r\n const refreshToken = extractRefreshToken(client);\r\n if (!refreshToken)\r\n throw new Error(\"No refresh token returned (is the offline_access scope granted?)\");\r\n\r\n return { refreshToken, claims: (result.idTokenClaims ?? {}) as TokenPayload };\r\n}\r\n\r\n/**\r\n * Acquires a delegated access token for `scopes` from the stored refresh token.\r\n * Entra rotates the refresh token on each use, so the (possibly new) refresh\r\n * token is returned for the caller to persist. Throws when the refresh token is\r\n * expired/revoked and interaction is required.\r\n */\r\n/** The refresh token is expired/revoked — the user must sign in interactively. */\r\nexport class SessionExpiredError extends Error {}\r\n\r\nexport async function acquireDelegatedToken(opts: {\r\n refreshToken: string;\r\n scopes: ReadonlyArray<string>;\r\n}): Promise<{ accessToken: string; refreshToken: string }> {\r\n const client = createConfidentialClient();\r\n let result;\r\n try {\r\n result = await client.acquireTokenByRefreshToken({\r\n refreshToken: opts.refreshToken,\r\n scopes: [...opts.scopes],\r\n forceCache: true,\r\n });\r\n } catch (error) {\r\n // Revocation, inactivity expiry (AADSTS70008/700082/50173) and Conditional\r\n // Access sign-in frequency (AADSTS70043) all surface as interaction-required\r\n // or invalid_grant — the session is dead, only an interactive login helps.\r\n // Missing consent for the requested resource (AADSTS65001) looks the same to\r\n // MSAL but is a configuration bug, not a dead session — let it surface as-is.\r\n if (\r\n (error instanceof InteractionRequiredAuthError && error.subError !== \"consent_required\") ||\r\n (error instanceof ServerError && error.errorCode === \"invalid_grant\")\r\n )\r\n throw new SessionExpiredError(error.message);\r\n throw error;\r\n }\r\n if (!result) throw new Error(\"Failed to acquire token from refresh token\");\r\n\r\n return {\r\n accessToken: result.accessToken,\r\n refreshToken: extractRefreshToken(client) ?? opts.refreshToken,\r\n };\r\n}\r\n\r\n/** Entra's front-channel logout endpoint, which clears the user's IdP session. */\r\nexport function buildLogoutUrl(postLogoutRedirectUri: string): string {\r\n const base = `${ENTRA_AUTHORITY}/oauth2/v2.0/logout`;\r\n return `${base}?post_logout_redirect_uri=${encodeURIComponent(postLogoutRedirectUri)}`;\r\n}\r\n"],"mappings":";;;;;;;;;;AAgBA,MAAa,eAAe;CAAC;CAAU;CAAW;CAAkB;AAAW;;AAG/E,MAAa,kBAAkB,qCAAqC,UAAU;;AAG9E,MAAa,iBAAiB,IAAI,eAAe;;;;;;;;;;;AAYjD,MAAa,iCACX,IAAI,8BAA8B,EAChC,MAAM;CACJ,UAAU,UAAU;CACpB,cAAc,UAAU;CACxB,WAAW;AACb,EACF,CAAC;;;;;;AAOH,SAAS,oBAAoB,QAA2D;CACtF,MAAM,QAAQ,KAAK,MAAM,OAAO,cAAc,CAAC,CAAC,UAAU,CAAC;CAG3D,OAAO,OAAO,OAAO,MAAM,gBAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;AACrD;;AAGA,SAAgB,iBAAiB,MAIb;CAClB,OAAO,yBAAyB,CAAC,CAAC,eAAe;EAC/C,QAAQ;EACR,aAAa,KAAK;EAClB,cAAc;EACd,OAAO,KAAK;EACZ,eAAe,KAAK;EACpB,qBAAqB;CACvB,CAAC;AACH;;;;;AAMA,eAAsB,uBAAuB,MAIe;CAC1D,MAAM,SAAS,yBAAyB;CACxC,MAAM,SAAS,MAAM,OAAO,mBAAmB;EAC7C,MAAM,KAAK;EACX,QAAQ;EACR,aAAa,KAAK;EAClB,cAAc,KAAK;CACrB,CAAC;CAED,MAAM,eAAe,oBAAoB,MAAM;CAC/C,IAAI,CAAC,cACH,MAAM,IAAI,MAAM,kEAAkE;CAEpF,OAAO;EAAE;EAAc,QAAS,OAAO,iBAAiB,CAAC;CAAmB;AAC9E;;;;;;;;AASA,IAAa,sBAAb,cAAyC,MAAM,CAAA;AAE/C,eAAsB,sBAAsB,MAGe;CACzD,MAAM,SAAS,yBAAyB;CACxC,IAAI;CACJ,IAAI;EACF,SAAS,MAAM,OAAO,2BAA2B;GAC/C,cAAc,KAAK;GACnB,QAAQ,CAAC,GAAG,KAAK,MAAM;GACvB,YAAY;EACd,CAAC;CACH,SAAS,OAAO;EAMd,IACG,iBAAiB,gCAAgC,MAAM,aAAa,sBACpE,iBAAiB,eAAe,MAAM,cAAc,iBAErD,MAAM,IAAI,oBAAoB,MAAM,OAAO;EAC7C,MAAM;CACR;CACA,IAAI,CAAC,QAAQ,MAAM,IAAI,MAAM,4CAA4C;CAEzE,OAAO;EACL,aAAa,OAAO;EACpB,cAAc,oBAAoB,MAAM,KAAK,KAAK;CACpD;AACF;;AAGA,SAAgB,eAAe,uBAAuC;CAEpE,OAAO,GAAG,GADM,gBAAe,qBACjB,4BAA6B,mBAAmB,qBAAqB;AACrF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as getAccessToken, m as serverEnv, u as getSessionUser } from "./utils-
|
|
1
|
+
import { l as getAccessToken, m as serverEnv, u as getSessionUser } from "./utils-DjdexspV.mjs";
|
|
2
2
|
import { uuidv7 } from "./utils.mjs";
|
|
3
|
-
import { t as getAppToken } from "./msalServer-
|
|
3
|
+
import { t as getAppToken } from "./msalServer-DLwA7_ta.mjs";
|
|
4
4
|
import { t as FileMetaSchema } from "./FileMeta-DDqUju1Y.mjs";
|
|
5
5
|
import "virtual:wcz-layout";
|
|
6
6
|
import { z as z$1 } from "zod";
|
|
@@ -167,4 +167,4 @@ const uploadFile = createServerOnlyFn(async ({ data }) => {
|
|
|
167
167
|
//#endregion
|
|
168
168
|
export { batchDeleteFiles as a, getFile as c, updateFileMeta as d, uploadFile as f, UploadFileMetaSchema as i, getFileMetas as l, GetFileMetasSchema as n, deleteFile as o, createApi as p, UpdateFileMetaSchema as r, downloadFile as s, FileSchema as t, getFileThumbnail as u };
|
|
169
169
|
|
|
170
|
-
//# sourceMappingURL=file-
|
|
170
|
+
//# sourceMappingURL=file-BTFDDalH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-BTFDDalH.mjs","names":[],"sources":["../src/lib/createApi.ts","../src/data/server/file.ts"],"sourcesContent":["import { createServerOnlyFn } from \"@tanstack/react-start\";\r\nimport axios, { AxiosError, type AxiosInstance } from \"axios\";\r\nimport https from \"node:https\";\r\nimport type { serverEnv } from \"virtual:wcz-layout\";\r\nimport { scopes as definedScopes } from \"virtual:wcz-layout\";\r\nimport { getAppToken } from \"~/lib/auth/msalServer\";\r\nimport { getAccessToken, getSessionUser } from \"~/lib/auth/user\";\r\n\r\nexport interface ApiOptions {\r\n baseURL: keyof typeof serverEnv & `${string}BASE_URL${string}`;\r\n scopeKey: keyof typeof definedScopes;\r\n}\r\n\r\nconst httpsAgent = new https.Agent({\r\n rejectUnauthorized: false,\r\n});\r\n\r\nexport const createApi = createServerOnlyFn(\r\n async ({ baseURL, scopeKey }: ApiOptions): Promise<AxiosInstance> => {\r\n const resolvedBaseURL = process.env[baseURL];\r\n if (!resolvedBaseURL) throw new Error(`\"${baseURL}\" env variable is not set.`);\r\n\r\n const accessToken = (await getSessionUser())\r\n ? await getAccessToken(scopeKey)\r\n : await getAppToken(scopeKey);\r\n\r\n const api = axios.create({\r\n baseURL: resolvedBaseURL,\r\n httpsAgent,\r\n headers: { Authorization: `Bearer ${accessToken}` },\r\n });\r\n\r\n api.interceptors.response.use(undefined, (error: unknown) => {\r\n if (error instanceof AxiosError)\r\n throw new Error(error.response?.data?.message ?? error.message);\r\n throw error;\r\n });\r\n\r\n return api;\r\n },\r\n);\r\n","import { createServerOnlyFn } from \"@tanstack/react-start\";\r\nimport type { AxiosResponse } from \"axios\";\r\nimport https from \"node:https\";\r\nimport { Readable } from \"node:stream\";\r\nimport { DefaultHttpStack, Upload } from \"tus-js-client\";\r\nimport { z } from \"zod\";\r\nimport { serverEnv } from \"~/env\";\r\nimport { uuidv7 } from \"~/exports/utils\";\r\nimport { getAppToken } from \"~/lib/auth/msalServer\";\r\nimport { getAccessToken, getSessionUser } from \"~/lib/auth/user\";\r\nimport { createApi } from \"~/lib/createApi\";\r\nimport type { FileMeta } from \"~/models/file/FileMeta\";\r\nimport { FileMetaSchema } from \"~/models/file/FileMeta\";\r\n\r\nexport const GetFileMetasSchema = z.object({\r\n appName: z.string().min(1).max(255),\r\n subId: z.uuid(),\r\n});\r\n\r\nexport const FileSchema = z.object({\r\n appName: z.string().min(1).max(255),\r\n id: z.uuid(),\r\n});\r\n\r\nexport const UpdateFileMetaSchema = FileMetaSchema.extend({\r\n fileName: z.string().min(1).max(255),\r\n});\r\n\r\nconst DeleteFileSchema = FileSchema;\r\n\r\nconst BatchDeleteFilesSchema = GetFileMetasSchema;\r\n\r\nexport interface UploadFileResult {\r\n id: string;\r\n appName: string;\r\n subId: string;\r\n fileName: string;\r\n}\r\n\r\nexport const UploadFileMetaSchema = z.object({\r\n appName: z.string().min(1).max(255),\r\n subId: z.uuid(),\r\n file: z.instanceof(File),\r\n});\r\n\r\nconst fileApi = () => createApi({ baseURL: \"FILE_BASE_URL\", scopeKey: \"file\" });\r\n\r\nfunction toFileResponse(response: AxiosResponse<Readable>, disposition?: string): Response {\r\n const headers = new Headers({\r\n \"Cache-Control\": \"private, max-age=3600, immutable\",\r\n \"Content-Type\": String(response.headers[\"content-type\"] ?? \"application/octet-stream\"),\r\n });\r\n const contentLength = response.headers[\"content-length\"];\r\n if (contentLength) headers.set(\"Content-Length\", String(contentLength));\r\n if (disposition) headers.set(\"Content-Disposition\", disposition);\r\n\r\n return new Response(Readable.toWeb(response.data) as ReadableStream, { headers });\r\n}\r\n\r\nexport const getFileMetas = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof GetFileMetasSchema> }): Promise<Array<FileMeta>> => {\r\n const input = GetFileMetasSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"subId\", input.subId);\r\n\r\n const api = await fileApi();\r\n const { data: fileMetas } = await api.request<Array<FileMeta>>({\r\n url: `/v1/meta?${queryParams.toString()}`,\r\n method: \"GET\",\r\n });\r\n return fileMetas;\r\n },\r\n);\r\n\r\nexport const getFileThumbnail = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof FileSchema> }): Promise<Response> => {\r\n const input = FileSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n const response = await api.request<Readable>({\r\n url: `/v1/thumbnail?${queryParams.toString()}`,\r\n method: \"GET\",\r\n responseType: \"stream\",\r\n });\r\n\r\n return toFileResponse(response);\r\n },\r\n);\r\n\r\nexport const getFile = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof FileSchema> }): Promise<Response> => {\r\n const input = FileSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n const response = await api.request<Readable>({\r\n url: `/v1?${queryParams.toString()}`,\r\n method: \"GET\",\r\n responseType: \"stream\",\r\n });\r\n\r\n return toFileResponse(response, \"inline\");\r\n },\r\n);\r\n\r\nexport const downloadFile = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof FileSchema> }): Promise<Response> => {\r\n const input = FileSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n const response = await api.request<Readable>({\r\n url: `/v1/download?${queryParams.toString()}`,\r\n method: \"GET\",\r\n responseType: \"stream\",\r\n });\r\n\r\n return toFileResponse(response);\r\n },\r\n);\r\n\r\nexport const updateFileMeta = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof UpdateFileMetaSchema> }): Promise<void> => {\r\n const input = UpdateFileMetaSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n await api.request({ url: `/v1/meta?${queryParams.toString()}`, method: \"PUT\", data: input });\r\n },\r\n);\r\n\r\nexport const deleteFile = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof DeleteFileSchema> }): Promise<void> => {\r\n const input = DeleteFileSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"id\", input.id);\r\n\r\n const api = await fileApi();\r\n await api.request({ url: `/v1?${queryParams.toString()}`, method: \"DELETE\" });\r\n },\r\n);\r\n\r\nexport const batchDeleteFiles = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof BatchDeleteFilesSchema> }): Promise<void> => {\r\n const input = BatchDeleteFilesSchema.parse(data);\r\n const queryParams = new URLSearchParams();\r\n queryParams.append(\"appName\", input.appName);\r\n queryParams.append(\"subId\", input.subId);\r\n\r\n const api = await fileApi();\r\n await api.request({ url: `/v1?${queryParams.toString()}`, method: \"DELETE\" });\r\n },\r\n);\r\n\r\nconst insecureHttpsAgent = new https.Agent({ rejectUnauthorized: false });\r\n\r\nexport const uploadFile = createServerOnlyFn(\r\n async ({ data }: { data: z.input<typeof UploadFileMetaSchema> }): Promise<UploadFileResult> => {\r\n const input = UploadFileMetaSchema.parse(data);\r\n const accessToken = (await getSessionUser())\r\n ? await getAccessToken(\"file\")\r\n : await getAppToken(\"file\");\r\n const stream = Readable.fromWeb(\r\n input.file.stream() as import(\"node:stream/web\").ReadableStream,\r\n );\r\n\r\n const id = uuidv7();\r\n\r\n await new Promise<void>((resolve, reject) => {\r\n const upload = new Upload(stream, {\r\n endpoint: `${serverEnv.FILE_BASE_URL}/v1/upload`,\r\n httpStack: new DefaultHttpStack({ agent: insecureHttpsAgent }),\r\n uploadSize: input.file.size,\r\n chunkSize: 1_048_576,\r\n metadata: {\r\n id,\r\n appName: input.appName,\r\n subId: input.subId,\r\n filename: input.file.name,\r\n filetype: input.file.type,\r\n },\r\n headers: { Authorization: `Bearer ${accessToken}` },\r\n onError: reject,\r\n onSuccess: () => resolve(),\r\n });\r\n upload.start();\r\n });\r\n\r\n return {\r\n id,\r\n appName: input.appName,\r\n subId: input.subId,\r\n fileName: input.file.name,\r\n };\r\n },\r\n);\r\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,aAAa,IAAI,MAAM,MAAM,EACjC,oBAAoB,MACtB,CAAC;AAED,MAAa,YAAY,mBACvB,OAAO,EAAE,SAAS,eAAmD;CACnE,MAAM,kBAAkB,QAAQ,IAAI;CACpC,IAAI,CAAC,iBAAiB,MAAM,IAAI,MAAM,IAAI,QAAO,2BAA4B;CAE7E,MAAM,cAAe,MAAM,eAAe,IACtC,MAAM,eAAe,QAAQ,IAC7B,MAAM,YAAY,QAAQ;CAE9B,MAAM,MAAM,MAAM,OAAO;EACvB,SAAS;EACT;EACA,SAAS,EAAE,eAAe,UAAU,cAAc;CACpD,CAAC;CAED,IAAI,aAAa,SAAS,IAAI,KAAA,IAAY,UAAmB;EAC3D,IAAI,iBAAiB,YACnB,MAAM,IAAI,MAAM,MAAM,UAAU,MAAM,WAAW,MAAM,OAAO;EAChE,MAAM;CACR,CAAC;CAED,OAAO;AACT,CACF;;;AC1BA,MAAa,qBAAqB,IAAE,OAAO;CACzC,SAAS,IAAE,OAAO,CAAC,CAAC,IAAI,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MAAM,KAAK;GACvB,WAAW;GACX,UAAU;IACR;IACA,SAAS,MAAM;IACf,OAAO,MAAM;IACb,UAAU,MAAM,KAAK;IACrB,UAAU,MAAM,KAAK;GACvB;GACA,SAAS,EAAE,eAAe,UAAU,cAAc;GAClD,SAAS;GACT,iBAAiB,QAAQ;EAC3B,CACA,CAAM,CAAC,MAAM;CACf,CAAC;CAED,OAAO;EACL;EACA,SAAS,MAAM;EACf,OAAO,MAAM;EACb,UAAU,MAAM,KAAK;CACvB;AACF,CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { l as getAccessToken, m as serverEnv } from "./utils-
|
|
2
|
-
import { t as getAppToken } from "./msalServer-
|
|
3
|
-
import { a as batchDeleteFiles, c as getFile, d as updateFileMeta, l as getFileMetas, n as GetFileMetasSchema, o as deleteFile, r as UpdateFileMetaSchema, s as downloadFile, t as FileSchema, u as getFileThumbnail } from "./file-
|
|
4
|
-
import { t as authenticationMiddleware } from "./authMiddleware-
|
|
1
|
+
import { l as getAccessToken, m as serverEnv } from "./utils-DjdexspV.mjs";
|
|
2
|
+
import { t as getAppToken } from "./msalServer-DLwA7_ta.mjs";
|
|
3
|
+
import { a as batchDeleteFiles, c as getFile, d as updateFileMeta, l as getFileMetas, n as GetFileMetasSchema, o as deleteFile, r as UpdateFileMetaSchema, s as downloadFile, t as FileSchema, u as getFileThumbnail } from "./file-BTFDDalH.mjs";
|
|
4
|
+
import { t as authenticationMiddleware } from "./authMiddleware-DPly0b_T.mjs";
|
|
5
5
|
import { mutationOptions, queryOptions } from "@tanstack/react-query";
|
|
6
6
|
import { createServerFn } from "@tanstack/react-start";
|
|
7
7
|
import { uuidv7 } from "uuidv7";
|
|
@@ -14,7 +14,7 @@ const getFileUploadToken = createServerFn({ method: "GET" }).middleware([authent
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/data/client/file.ts
|
|
16
16
|
const QUERY_KEY = "file";
|
|
17
|
-
const HOUR =
|
|
17
|
+
const HOUR = 36e5;
|
|
18
18
|
const getFileMetasRpc = createServerFn({ method: "GET" }).validator(GetFileMetasSchema).handler(({ data }) => getFileMetas({ data }));
|
|
19
19
|
const getFileThumbnailRpc = createServerFn({ method: "GET" }).validator(FileSchema).handler(({ data }) => getFileThumbnail({ data }));
|
|
20
20
|
const getFileRpc = createServerFn({ method: "GET" }).validator(FileSchema).handler(({ data }) => getFile({ data }));
|
|
@@ -150,4 +150,4 @@ const uploadFileMutationOptions = ({ queryClient }) => mutationOptions({
|
|
|
150
150
|
//#endregion
|
|
151
151
|
export { fileQueryOptions as a, updateFileMetaMutationOptions as c, fileMetasQueryOptions as i, uploadFileMutationOptions as l, deleteFileMutationOptions as n, fileThumbnailQueryOptions as o, downloadFileMutationOptions as r, openFileMutationOptions as s, batchDeleteFilesMutationOptions as t };
|
|
152
152
|
|
|
153
|
-
//# sourceMappingURL=file
|
|
153
|
+
//# sourceMappingURL=file-CuvAmdJW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-CuvAmdJW.mjs","names":[],"sources":["../src/server/actions/file.ts","../src/data/client/file.ts"],"sourcesContent":["import { createServerFn } from \"@tanstack/react-start\";\nimport { serverEnv } from \"~/env\";\nimport { getAppToken } from \"~/lib/auth/msalServer\";\nimport { getAccessToken } from \"~/lib/auth/user\";\nimport { authenticationMiddleware } from \"~/middleware/authMiddleware\";\n\nexport const getFileUploadToken = createServerFn({ method: \"GET\" })\n .middleware([authenticationMiddleware({ optional: true })])\n .handler(async ({ context }) => ({\n token: context.user ? await getAccessToken(\"file\") : await getAppToken(\"file\"),\n endpoint: `${serverEnv.FILE_BASE_URL}/v1/upload`,\n }));\n","import { mutationOptions, queryOptions } from \"@tanstack/react-query\";\r\nimport { createServerFn } from \"@tanstack/react-start\";\r\nimport { Upload } from \"tus-js-client\";\r\nimport { uuidv7 } from \"uuidv7\";\r\nimport type { z } from \"zod\";\r\nimport type { UploadFileMetaSchema, UploadFileResult } from \"~/data/server/file\";\r\nimport {\r\n FileSchema,\r\n GetFileMetasSchema,\r\n UpdateFileMetaSchema,\r\n batchDeleteFiles,\r\n deleteFile,\r\n downloadFile,\r\n getFile,\r\n getFileMetas,\r\n getFileThumbnail,\r\n updateFileMeta,\r\n} from \"~/data/server/file\";\r\nimport type { QueryClientParam } from \"~/models/QueryClientParam\";\r\nimport { getFileUploadToken } from \"~/server/actions/file\";\r\n\r\nconst QUERY_KEY = \"file\";\r\nconst HOUR = 1000 * 60 * 60;\r\n\r\nconst getFileMetasRpc = createServerFn({ method: \"GET\" })\r\n .validator(GetFileMetasSchema)\r\n .handler(({ data }) => getFileMetas({ data }));\r\n\r\nconst getFileThumbnailRpc = createServerFn({ method: \"GET\" })\r\n .validator(FileSchema)\r\n .handler(({ data }) => getFileThumbnail({ data }));\r\n\r\nconst getFileRpc = createServerFn({ method: \"GET\" })\r\n .validator(FileSchema)\r\n .handler(({ data }) => getFile({ data }));\r\n\r\nconst downloadFileRpc = createServerFn({ method: \"GET\" })\r\n .validator(FileSchema)\r\n .handler(({ data }) => downloadFile({ data }));\r\n\r\nconst updateFileMetaRpc = createServerFn({ method: \"POST\" })\r\n .validator(UpdateFileMetaSchema)\r\n .handler(({ data }) => updateFileMeta({ data }));\r\n\r\nconst deleteFileRpc = createServerFn({ method: \"POST\" })\r\n .validator(FileSchema)\r\n .handler(({ data }) => deleteFile({ data }));\r\n\r\nconst batchDeleteFilesRpc = createServerFn({ method: \"POST\" })\r\n .validator(GetFileMetasSchema)\r\n .handler(({ data }) => batchDeleteFiles({ data }));\r\n\r\nconst baseOptions = {\r\n staleTime: HOUR,\r\n gcTime: HOUR,\r\n refetchOnWindowFocus: false,\r\n};\r\n\r\nasync function responseToObjectUrl(response: Response): Promise<string> {\r\n const blob = await response.blob();\r\n return URL.createObjectURL(blob);\r\n}\r\n\r\nfunction saveBlob(blob: Blob, fileName: string): void {\r\n const url = URL.createObjectURL(blob);\r\n const anchor = document.createElement(\"a\");\r\n anchor.href = url;\r\n anchor.download = fileName;\r\n anchor.click();\r\n URL.revokeObjectURL(url);\r\n}\r\n\r\nexport const fileMetasQueryOptions = (params: z.input<typeof GetFileMetasSchema>) =>\r\n queryOptions({\r\n queryKey: [QUERY_KEY, \"meta\", params.appName, params.subId],\r\n queryFn: () => getFileMetasRpc({ data: params }),\r\n ...baseOptions,\r\n });\r\n\r\nexport const fileThumbnailQueryOptions = (params: z.input<typeof FileSchema>) =>\r\n queryOptions({\r\n queryKey: [QUERY_KEY, \"thumbnail\", params.appName, params.id],\r\n queryFn: async () => responseToObjectUrl(await getFileThumbnailRpc({ data: params })),\r\n enabled: !!params.id,\r\n ...baseOptions,\r\n });\r\n\r\nexport const fileQueryOptions = (params: z.input<typeof FileSchema>) =>\r\n queryOptions({\r\n queryKey: [QUERY_KEY, params.appName, params.id],\r\n queryFn: async () => responseToObjectUrl(await downloadFileRpc({ data: params })),\r\n enabled: !!params.id,\r\n ...baseOptions,\r\n });\r\n\r\nexport const downloadFileMutationOptions = () =>\r\n mutationOptions({\r\n mutationFn: async (\r\n data: z.input<typeof FileSchema> & { fileName: string; fileExtension: string },\r\n ) => {\r\n const response = await downloadFileRpc({ data });\r\n saveBlob(await response.blob(), `${data.fileName}.${data.fileExtension}`);\r\n },\r\n });\r\n\r\nexport const openFileMutationOptions = ({ target }: { target: { current: Window | null } }) =>\r\n mutationOptions<string, Error, z.input<typeof FileSchema>>({\r\n mutationFn: async (data) => responseToObjectUrl(await getFileRpc({ data })),\r\n onSuccess: (source) => {\r\n const popup = target.current;\r\n target.current = null;\r\n\r\n if (popup) {\r\n popup.opener = null;\r\n popup.location.href = source;\r\n } else {\r\n window.open(source, \"_blank\");\r\n }\r\n },\r\n onError: () => {\r\n target.current?.close();\r\n target.current = null;\r\n },\r\n });\r\n\r\nexport const updateFileMetaMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof UpdateFileMetaSchema>) => updateFileMetaRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, \"meta\"], exact: false }),\r\n });\r\n\r\nexport const deleteFileMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof FileSchema>) => deleteFileRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, \"meta\"], exact: false }),\r\n });\r\n\r\nexport const batchDeleteFilesMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: (data: z.input<typeof GetFileMetasSchema>) => batchDeleteFilesRpc({ data }),\r\n onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, \"meta\"], exact: false }),\r\n });\r\n\r\nexport const uploadFileMutationOptions = ({ queryClient }: QueryClientParam) =>\r\n mutationOptions({\r\n mutationFn: async ({\r\n appName,\r\n subId,\r\n file,\r\n setProgress,\r\n }: z.input<typeof UploadFileMetaSchema> & {\r\n setProgress?: (progress: number) => void;\r\n }): Promise<UploadFileResult> => {\r\n const { token, endpoint } = await getFileUploadToken();\r\n\r\n const id = uuidv7();\r\n\r\n await new Promise<void>((resolve, reject) => {\r\n const upload = new Upload(file, {\r\n endpoint,\r\n chunkSize: 1_048_576,\r\n metadata: {\r\n id,\r\n appName: appName,\r\n subId: subId,\r\n filename: file.name,\r\n filetype: file.type,\r\n },\r\n headers: { Authorization: `Bearer ${token}` },\r\n onProgress: (bytesUploaded, bytesTotal) =>\r\n setProgress?.((bytesUploaded / bytesTotal) * 100),\r\n onError: reject,\r\n onSuccess: () => resolve(),\r\n });\r\n upload.start();\r\n });\r\n\r\n return { id, appName, subId, fileName: file.name };\r\n },\r\n onSuccess: (result) =>\r\n queryClient.invalidateQueries({\r\n queryKey: [QUERY_KEY, \"meta\", result.appName, result.subId],\r\n exact: false,\r\n }),\r\n });\r\n"],"mappings":";;;;;;;;;AAMA,MAAa,qBAAqB,eAAe,EAAE,QAAQ,MAAM,CAAC,CAAC,CAChE,WAAW,CAAC,yB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AS;GAAO,UAAU,KAAK;EAAK;CACnD;CACA,YAAY,WACV,YAAY,kBAAkB;EAC5B,UAAU;GAAC;GAAW;GAAQ,OAAO;GAAS,OAAO;EAAK;EAC1D,OAAO;CACT,CAAC;AACL,CAAC"}
|
package/dist/hooks.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getFieldStatus } from "./utils-
|
|
1
|
+
import { a as getFieldStatus } from "./utils-DjdexspV.mjs";
|
|
2
2
|
import { t as NotificationContext } from "./NotificationContext-CgwUOeW0.mjs";
|
|
3
3
|
import { t as useDialogs } from "./useDialogs-BUzVrTSP.mjs";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|