wcz-layout 9.7.0 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AggregatedCell-C7nAQyMO.mjs +510 -0
- package/dist/AggregatedCell-C7nAQyMO.mjs.map +1 -0
- 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/LayoutTable-BkrjgpW_.d.mts +758 -0
- package/dist/{QueryClientParam-Cbb0MIKg.d.mts → QueryClientParam-JcH0mJWl.d.mts} +2 -2
- package/dist/RouterListItemButton-ULMlaQh6.mjs.map +1 -1
- package/dist/{User-1gKoYJvW.d.mts → User-D4__w1I1.d.mts} +4 -2
- package/dist/approval-BYryxFOW.mjs +84 -0
- package/dist/approval-BYryxFOW.mjs.map +1 -0
- package/dist/auth.d.mts +21 -11
- package/dist/auth.mjs +43 -26
- package/dist/auth.mjs.map +1 -1
- package/dist/components.d.mts +22 -30
- package/dist/components.mjs +813 -140
- package/dist/components.mjs.map +1 -1
- package/dist/createApi-DGJJ4I_R.mjs +27 -0
- package/dist/createApi-DGJJ4I_R.mjs.map +1 -0
- package/dist/data/client.d.mts +690 -1176
- package/dist/data/client.mjs +4 -3
- package/dist/data/client.mjs.map +1 -1
- package/dist/data/server.d.mts +3 -3
- package/dist/data/server.mjs +4 -2
- package/dist/data/server.mjs.map +1 -1
- package/dist/{file-DimNsRly.mjs → file-C14fhUeg.mjs} +6 -7
- package/dist/file-C14fhUeg.mjs.map +1 -0
- package/dist/{file-BWcNzq55.mjs → file-C5BOj1q8.mjs} +5 -24
- package/dist/file-C5BOj1q8.mjs.map +1 -0
- package/dist/hooks.d.mts +7 -46
- package/dist/hooks.mjs +2587 -239
- package/dist/hooks.mjs.map +1 -1
- package/dist/index.d.mts +28 -9
- package/dist/index.mjs +1248 -500
- package/dist/index.mjs.map +1 -1
- package/dist/middleware.d.mts +20 -19
- package/dist/middleware.mjs +47 -2
- package/dist/middleware.mjs.map +1 -1
- package/dist/models.d.mts +17 -10
- package/dist/models.mjs.map +1 -1
- package/dist/{peoplesoft-CskGsqd6.d.mts → peoplesoft-BY_75WTS.d.mts} +2 -2
- package/dist/{peoplesoft-DTPGpN2h.mjs → peoplesoft-BkJMCcHb.mjs} +24 -81
- package/dist/peoplesoft-BkJMCcHb.mjs.map +1 -0
- package/dist/providers-DrairEO2.mjs +74 -0
- package/dist/providers-DrairEO2.mjs.map +1 -0
- package/dist/tokens-BLRreL1j.mjs +143 -0
- package/dist/tokens-BLRreL1j.mjs.map +1 -0
- package/dist/{utils-DjdexspV.mjs → utils-BUpDoqme.mjs} +73 -51
- package/dist/utils-BUpDoqme.mjs.map +1 -0
- package/dist/{utils-5x4uNxsX.d.mts → utils-Bhi0KiBx.d.mts} +18 -6
- package/dist/utils.d.mts +2 -2
- package/dist/utils.mjs +2 -2
- package/dist/vite.d.mts +1 -2
- package/dist/vite.mjs +3 -3
- package/dist/vite.mjs.map +1 -1
- package/package.json +130 -128
- package/skills/client-db/SKILL.md +104 -96
- package/skills/db-schema/SKILL.md +46 -33
- package/skills/dialogs/SKILL.md +21 -27
- package/skills/forms/SKILL.md +60 -39
- package/skills/general/SKILL.md +122 -94
- package/skills/general/references/exports.md +106 -0
- package/skills/migrations/SKILL.md +53 -2
- package/skills/migrations/versions/migrate-v9-to-v10.md +582 -0
- package/skills/routing/SKILL.md +50 -60
- package/skills/server-functions/SKILL.md +36 -56
- package/skills/services/SKILL.md +7 -4
- package/skills/services/docs/approval.md +2 -2
- package/skills/services/docs/peoplesoft.md +114 -110
- package/skills/start/SKILL.md +9 -5
- package/skills/start/steps/05-database-setup.md +52 -52
- package/skills/start/steps/06-entra-setup.md +1 -1
- package/skills/start/steps/07-vault-setup.md +5 -12
- package/skills/table/SKILL.md +263 -0
- package/skills/unslop/SKILL.md +80 -0
- package/dist/NotificationContext-CgwUOeW0.mjs +0 -7
- package/dist/NotificationContext-CgwUOeW0.mjs.map +0 -1
- package/dist/authMiddleware-DPly0b_T.mjs +0 -48
- package/dist/authMiddleware-DPly0b_T.mjs.map +0 -1
- package/dist/entra-CJSyeQsx.mjs +0 -109
- package/dist/entra-CJSyeQsx.mjs.map +0 -1
- package/dist/file-BWcNzq55.mjs.map +0 -1
- package/dist/file-DimNsRly.mjs.map +0 -1
- package/dist/msalServer-DLwA7_ta.mjs +0 -30
- package/dist/msalServer-DLwA7_ta.mjs.map +0 -1
- package/dist/peoplesoft-DTPGpN2h.mjs.map +0 -1
- package/dist/useDialogs-BUzVrTSP.mjs +0 -248
- package/dist/useDialogs-BUzVrTSP.mjs.map +0 -1
- package/dist/user-Dzv0N9fj.d.mts +0 -16
- package/dist/utils-DjdexspV.mjs.map +0 -1
- package/skills/data-grid/SKILL.md +0 -142
- package/skills/migrations/versions/migrate-v9-to-v10.tsx +0 -9
package/skills/routing/SKILL.md
CHANGED
|
@@ -1,39 +1,62 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: routing
|
|
3
|
-
description: "Use when
|
|
3
|
+
description: "Use when adding or changing a page, route file, navigation entry, search params, or route-level access control. Covers createFileRoute, beforeLoad requireAuth, loader preloads, validateSearch, useSearch, src/routes/ naming and colocation, __root.tsx navigation, the auth and login routes, and the RouterLink/RouterButton link components."
|
|
4
|
+
metadata:
|
|
5
|
+
type: convention
|
|
6
|
+
library: wcz-layout
|
|
4
7
|
---
|
|
5
8
|
|
|
6
|
-
> Mechanics (
|
|
9
|
+
> Mechanics (route definitions, loaders, context, guards, navigation, search params,
|
|
10
|
+
> route-tree fundamentals) are covered by TanStack's own skills. List the skills shipped by
|
|
11
|
+
> `@tanstack/router-core` and `@tanstack/react-router` and load whichever cover the task at
|
|
12
|
+
> hand. This skill adds the wcz-layout conventions.
|
|
7
13
|
|
|
8
14
|
## Rules
|
|
9
15
|
|
|
10
|
-
- Include
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- Route
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
16
|
+
- Include `requireAuth(<permissionKey>)` in the route's `beforeLoad` to enforce access
|
|
17
|
+
control — pass a key defined in your app's `src/lib/auth/permissions.ts`. Use bare
|
|
18
|
+
`requireAuth()` when any signed-in user may enter, and omit it entirely only for
|
|
19
|
+
intentionally public routes.
|
|
20
|
+
- Route-level `requireAuth` only hides the UI. Every server function or server route that
|
|
21
|
+
accesses protected data still needs `authMiddleware`; see the `server-functions` skill.
|
|
22
|
+
- Use `Route.useRouteContext()` to access the authenticated user. `user` can be `null` if
|
|
23
|
+
the route doesn't include `requireAuth`.
|
|
24
|
+
- Preload the route's live queries in the loader and return the promise:
|
|
25
|
+
`loader: ({ context }) => context.dbClient.preloadLiveQuery(<x>QueryOptions)`.
|
|
26
|
+
- Literal URL segments and feature folders use kebab-case. Entity feature names are plural;
|
|
27
|
+
TanStack special route tokens retain their required syntax.
|
|
28
|
+
- If a feature contains only one route, create a single file route: `src/routes/<feature>s.tsx`
|
|
29
|
+
- If a feature contains multiple related routes, create a folder: `src/routes/<feature>s/index.tsx`
|
|
30
|
+
- Colocate route-specific components/hooks inside `routes/<feature>s/-components` or `-hooks`.
|
|
31
|
+
- When a route needs its own components/hooks that no sibling route uses, wrap it in a route
|
|
32
|
+
group folder named after the route and colocate them there: `routes/<feature>s/(index)/index.tsx` with `(index)/-components` and `(index)/-hooks`.
|
|
18
33
|
- Root-level `components/` and `hooks/` are only for code shared across multiple routes.
|
|
19
|
-
- After creating a new route, add
|
|
20
|
-
-
|
|
34
|
+
- After creating a new route, add a navigation item with a unique icon from
|
|
35
|
+
`@mui/icons-material` in `src/routes/__root.tsx`.
|
|
36
|
+
- For user-clickable in-app navigation, use the type-safe router components from
|
|
37
|
+
`wcz-layout/components` (`RouterButton`, `RouterIconButton`, `RouterLink`, `RouterFab`,
|
|
38
|
+
`RouterTab`, `RouterListItemButton`) rather than raw MUI with a manual `href` — they wrap
|
|
39
|
+
`createLink`, so `to`/`params`/`search` are type-checked.
|
|
21
40
|
|
|
22
41
|
## Examples
|
|
23
42
|
|
|
24
43
|
```ts
|
|
25
44
|
// imports
|
|
45
|
+
import AccountTree from "@mui/icons-material/AccountTree";
|
|
46
|
+
import Code from "@mui/icons-material/Code";
|
|
47
|
+
import Home from "@mui/icons-material/Home";
|
|
48
|
+
import Widgets from "@mui/icons-material/Widgets";
|
|
49
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
50
|
+
import { z } from "zod";
|
|
51
|
+
import type { Navigation } from "wcz-layout";
|
|
26
52
|
import { useDialogs, useTranslation } from "wcz-layout/hooks";
|
|
27
|
-
import {
|
|
53
|
+
import { hasPermission, requireAuth } from "wcz-layout/utils";
|
|
28
54
|
|
|
29
|
-
// src/routes/
|
|
30
|
-
export const Route = createFileRoute("/
|
|
55
|
+
// src/routes/<feature>s/index.tsx
|
|
56
|
+
export const Route = createFileRoute("/<feature>s/")({
|
|
31
57
|
component: RouteComponent,
|
|
32
|
-
beforeLoad:
|
|
33
|
-
|
|
34
|
-
loader: () => {
|
|
35
|
-
featureCollection.preload();
|
|
36
|
-
},
|
|
58
|
+
beforeLoad: requireAuth("admin"),
|
|
59
|
+
loader: ({ context }) => context.dbClient.preloadLiveQuery(featuresQueryOptions),
|
|
37
60
|
});
|
|
38
61
|
|
|
39
62
|
function RouteComponent() {
|
|
@@ -43,52 +66,19 @@ function RouteComponent() {
|
|
|
43
66
|
// route component code...
|
|
44
67
|
}
|
|
45
68
|
|
|
46
|
-
// __root.tsx
|
|
47
|
-
import { hasPermission } from "wcz-layout/utils";
|
|
48
|
-
|
|
49
|
-
const { user } = Route.useRouteContext();
|
|
50
|
-
|
|
69
|
+
// __root.tsx navigation
|
|
51
70
|
const navigation: Navigation = [
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
to: "/",
|
|
55
|
-
title: "Home",
|
|
56
|
-
icon: <Home />,
|
|
57
|
-
hidden: !hasPermission(user, "all"),
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
kind: "header",
|
|
61
|
-
title: "Documentation",
|
|
62
|
-
},
|
|
71
|
+
{ kind: "item", to: "/", title: t("Home"), icon: <Home />, hidden: !hasPermission(user, "admin") },
|
|
72
|
+
{ kind: "header", title: t("Documentation") },
|
|
63
73
|
{
|
|
64
74
|
kind: "group",
|
|
65
|
-
title: "Components",
|
|
75
|
+
title: t("Components"),
|
|
66
76
|
icon: <Widgets />,
|
|
67
77
|
children: [
|
|
68
|
-
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
title: "Navigation",
|
|
72
|
-
icon: <AccountTree />,
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
kind: "divider",
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
kind: "item",
|
|
79
|
-
to: "/components/forms",
|
|
80
|
-
title: "Forms",
|
|
81
|
-
icon: <Code />,
|
|
82
|
-
},
|
|
78
|
+
{ kind: "item", to: "/components/navigation", title: t("Navigation"), icon: <AccountTree /> },
|
|
79
|
+
{ kind: "divider" },
|
|
80
|
+
{ kind: "item", to: "/components/forms", title: t("Forms"), icon: <Code /> },
|
|
83
81
|
],
|
|
84
82
|
},
|
|
85
83
|
];
|
|
86
|
-
|
|
87
|
-
// Routes are public unless guarded. By convention, protect every route by adding
|
|
88
|
-
// requirePermission to its beforeLoad (omit only for intentionally public routes) —
|
|
89
|
-
// it redirects to login when signed out, then checks the permission group.
|
|
90
|
-
export const Route = createFileRoute("/feature-name")({
|
|
91
|
-
component: RouteComponent,
|
|
92
|
-
beforeLoad: requirePermission("admin"),
|
|
93
|
-
});
|
|
94
84
|
```
|
|
@@ -1,79 +1,83 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: server-functions
|
|
3
|
-
description: "Use when
|
|
3
|
+
description: "Use when adding or changing server functions, REST/API routes, background-job endpoints, or server-side data access."
|
|
4
|
+
metadata:
|
|
5
|
+
type: convention
|
|
6
|
+
library: wcz-layout
|
|
4
7
|
---
|
|
5
8
|
|
|
6
|
-
> Mechanics (`createServerFn`, `.validator`, `createMiddleware`, `createHandlers`) are covered by TanStack's own skills
|
|
9
|
+
> Mechanics (`createServerFn`, `.validator`, `createMiddleware`, `createHandlers`) are covered by TanStack's own skills. List the skills shipped by `@tanstack/start-client-core` and `@tanstack/react-start` and load whichever cover the task at hand. This skill adds only the wcz-layout middleware conventions on top.
|
|
7
10
|
|
|
8
11
|
## Rules
|
|
9
12
|
|
|
10
13
|
- Before generating code, clarify whether the feature should be exposed as public REST API routes or implemented as internal TanStack Start server functions (recommended), and what permission should be required for access.
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
14
|
+
- Include `authMiddleware` in every server function by default — server functions are callable RPC endpoints, so a route-level `requireAuth` in `beforeLoad` only hides the UI and does not protect them. Omit it only for server functions backing intentionally public routes.
|
|
15
|
+
- Order inside a middleware **array** matters, because the array runs in order and the later entry wins the merged context type. Always `databaseMiddleware()` → `authMiddleware(<permissionKey>)` → `validationMiddleware(<schema>)`. `databaseMiddleware` declares `userMiddleware` and so contributes `user: User | null`; putting it first lets `authMiddleware` narrow `context.user` to `User` for the handler. `authMiddleware` still comes before `validationMiddleware` — otherwise an unauthenticated caller gets their body parsed and gets your validation errors back.
|
|
16
|
+
- The builder itself accepts its links in any order. Write them as `.validator()` → `.middleware()` → `.handler()` to match the reference app. Middleware always runs before the handler regardless of where it appears.
|
|
17
|
+
- `validationMiddleware` is for REST API routes only. Server functions use `.validator()`.
|
|
18
|
+
- `databaseMiddleware` is **app-local**, not a wcz-layout export. Every app writes it once (see below). It owns the transaction, so never open another one in a handler.
|
|
16
19
|
- Reuse schemas from `src/lib/schemas/`.
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
## File Placement
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
src/server/actions/ — server functions
|
|
23
|
-
src/routes/api/ — REST API routes
|
|
24
|
-
src/server/middleware/ — databaseMiddleware
|
|
25
|
-
wcz-layout/middleware/ — authorizationMiddleware, validationMiddleware
|
|
26
|
-
src/server/db/schemas/ — tables, enums, relations
|
|
27
|
-
src/lib/schemas/ — Zod schemas (shared between client and server)
|
|
28
|
-
src/lib/auth/permissions.ts — permission keys
|
|
29
|
-
```
|
|
20
|
+
- Everything under `src/server/**` is server-only, but Start's import protection only guards `**/*.server.*` filenames. Never import from `src/server/` in a component or route file. Import the server function, not what it uses.
|
|
21
|
+
- Background jobs are API routes using only `databaseMiddleware()` + `authMiddleware()` — cron runs in Kubernetes and authenticates via app token.
|
|
30
22
|
|
|
31
23
|
## Examples
|
|
32
24
|
|
|
33
25
|
```ts
|
|
34
|
-
// src/server/actions/<
|
|
26
|
+
// src/server/actions/<table>.ts
|
|
27
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
28
|
+
import { createServerFn } from "@tanstack/react-start";
|
|
29
|
+
import { eq } from "drizzle-orm";
|
|
30
|
+
import { authMiddleware, validationMiddleware } from "wcz-layout/middleware";
|
|
31
|
+
import z from "zod";
|
|
32
|
+
import { FeatureSchema } from "~/lib/schemas/feature";
|
|
33
|
+
import { featureTable } from "../db/schemas/feature";
|
|
34
|
+
import { databaseMiddleware } from "../middleware/databaseMiddleware";
|
|
35
|
+
|
|
35
36
|
export const selectFeatures = createServerFn()
|
|
36
|
-
.middleware([
|
|
37
|
-
.handler(
|
|
38
|
-
return
|
|
37
|
+
.middleware([databaseMiddleware(), authMiddleware()])
|
|
38
|
+
.handler(({ context }) => {
|
|
39
|
+
return context.db.select().from(featureTable);
|
|
39
40
|
});
|
|
40
41
|
|
|
41
42
|
export const insertFeature = createServerFn({ method: "POST" })
|
|
42
|
-
.middleware([authorizationMiddleware("admin"), databaseMiddleware()])
|
|
43
43
|
.validator(FeatureSchema)
|
|
44
|
+
.middleware([databaseMiddleware(), authMiddleware("admin")])
|
|
44
45
|
.handler(async ({ data, context }) => {
|
|
45
46
|
await context.db.insert(featureTable).values(data);
|
|
46
47
|
});
|
|
47
48
|
|
|
48
49
|
export const updateFeature = createServerFn({ method: "POST" })
|
|
49
|
-
.middleware([authorizationMiddleware("admin"), databaseMiddleware()])
|
|
50
50
|
.validator(FeatureSchema)
|
|
51
|
+
.middleware([databaseMiddleware(), authMiddleware("admin")])
|
|
51
52
|
.handler(async ({ data, context }) => {
|
|
52
53
|
await context.db.update(featureTable).set(data).where(eq(featureTable.id, data.id));
|
|
53
54
|
});
|
|
54
55
|
|
|
55
56
|
export const deleteFeature = createServerFn({ method: "POST" })
|
|
56
|
-
.
|
|
57
|
-
.
|
|
57
|
+
.validator(z.uuid())
|
|
58
|
+
.middleware([databaseMiddleware(), authMiddleware("admin")])
|
|
58
59
|
.handler(async ({ data, context }) => {
|
|
59
|
-
await context.db.delete(featureTable).where(eq(featureTable.id, data
|
|
60
|
+
await context.db.delete(featureTable).where(eq(featureTable.id, data));
|
|
60
61
|
});
|
|
61
62
|
|
|
62
63
|
// src/routes/api/<feature>s/index.ts
|
|
63
64
|
export const Route = createFileRoute("/api/features/")({
|
|
64
65
|
server: {
|
|
65
|
-
middleware: [databaseMiddleware()],
|
|
66
66
|
handlers: ({ createHandlers }) =>
|
|
67
67
|
createHandlers({
|
|
68
68
|
GET: {
|
|
69
|
-
middleware: [
|
|
69
|
+
middleware: [databaseMiddleware(), authMiddleware()],
|
|
70
70
|
handler: async ({ context }) => {
|
|
71
71
|
const items = await context.db.select().from(featureTable);
|
|
72
72
|
return Response.json(items);
|
|
73
73
|
},
|
|
74
74
|
},
|
|
75
75
|
POST: {
|
|
76
|
-
middleware: [
|
|
76
|
+
middleware: [
|
|
77
|
+
databaseMiddleware(),
|
|
78
|
+
authMiddleware("admin"),
|
|
79
|
+
validationMiddleware(FeatureSchema),
|
|
80
|
+
],
|
|
77
81
|
handler: async ({ context }) => {
|
|
78
82
|
const [response] = await context.db
|
|
79
83
|
.insert(featureTable)
|
|
@@ -85,28 +89,4 @@ export const Route = createFileRoute("/api/features/")({
|
|
|
85
89
|
}),
|
|
86
90
|
},
|
|
87
91
|
});
|
|
88
|
-
|
|
89
|
-
// src/routes/api/<feature>s/$id.ts
|
|
90
|
-
export const Route = createFileRoute("/api/features/$id")({
|
|
91
|
-
server: {
|
|
92
|
-
middleware: [authorizationMiddleware("admin"), databaseMiddleware()],
|
|
93
|
-
handlers: ({ createHandlers }) =>
|
|
94
|
-
createHandlers({
|
|
95
|
-
PUT: {
|
|
96
|
-
middleware: [validationMiddleware(FeatureSchema)],
|
|
97
|
-
handler: async ({ params, context }) => {
|
|
98
|
-
await context.db
|
|
99
|
-
.update(featureTable)
|
|
100
|
-
.set(context.data)
|
|
101
|
-
.where(eq(featureTable.id, params.id));
|
|
102
|
-
return new Response(null, { status: 204 });
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
DELETE: async ({ params, context }) => {
|
|
106
|
-
await context.db.delete(featureTable).where(eq(featureTable.id, params.id));
|
|
107
|
-
return new Response(null, { status: 204 });
|
|
108
|
-
},
|
|
109
|
-
}),
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
92
|
```
|
package/skills/services/SKILL.md
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: services
|
|
3
|
-
description: "Use when
|
|
3
|
+
description: "Use when a feature needs a built-in wcz-layout backend service: file upload, download, thumbnails; approval requests, approvers and flows; PeopleSoft employee, manager, department lookups; or sending email."
|
|
4
|
+
metadata:
|
|
5
|
+
type: integration
|
|
6
|
+
library: wcz-layout
|
|
4
7
|
---
|
|
5
8
|
|
|
6
9
|
## Info
|
|
7
10
|
|
|
8
11
|
You can read about each service in the links below. Services are categorized as either client or server exports, depending on their intended usage.
|
|
9
12
|
|
|
10
|
-
- **Client exports** —
|
|
11
|
-
- **Server exports** —
|
|
12
|
-
- Invalidating mutation
|
|
13
|
+
- **Client exports** — React Query option factories from `wcz-layout/data/client`.
|
|
14
|
+
- **Server exports** — Direct service operations from `wcz-layout/data/server`; import themonly in server code.
|
|
15
|
+
- Invalidating mutation factories take `{ queryClient }`.
|
|
13
16
|
- Access `queryClient` with `Route.useRouteContext()` in a route file, or `useRouteContext({ from: "path" })` in a component.
|
|
14
17
|
- To read about a service, open the linked file in the **File** column directly.
|
|
15
18
|
|
|
@@ -80,13 +80,13 @@ const ApprovalFlowSchema = z.object({
|
|
|
80
80
|
|
|
81
81
|
const ApprovalCoRequestorGroupSchema = z.object({
|
|
82
82
|
role: z.string().trim().min(1),
|
|
83
|
-
email: z.email()
|
|
83
|
+
email: z.email(),
|
|
84
84
|
});
|
|
85
85
|
|
|
86
86
|
const ApprovalCoRequestorEmployeeSchema = z.object({
|
|
87
87
|
employeeId: z.string().trim().min(1),
|
|
88
88
|
name: z.string().trim().min(1),
|
|
89
|
-
email: z.email()
|
|
89
|
+
email: z.email(),
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
const ApprovalCoRequestorPrincipalSchema = z.union([
|
|
@@ -1,110 +1,114 @@
|
|
|
1
|
-
# peoplesoft
|
|
2
|
-
|
|
3
|
-
## Client
|
|
4
|
-
|
|
5
|
-
- Employee:
|
|
6
|
-
`searchEmployeesQueryOptions`
|
|
7
|
-
`employeesQueryOptions`
|
|
8
|
-
`activeEmployeesQueryOptions`
|
|
9
|
-
`employeeByEmployeeIdQueryOptions`
|
|
10
|
-
`previousEmployeeIdsQueryOptions`
|
|
11
|
-
`employeeSupervisorQueryOptions`
|
|
12
|
-
`employeeSubordinatesQueryOptions`
|
|
13
|
-
`employeeManagerQueryOptions`
|
|
14
|
-
`employeeGeneralManagerQueryOptions`
|
|
15
|
-
`companyGeneralManagerQueryOptions`
|
|
16
|
-
|
|
17
|
-
`
|
|
18
|
-
`
|
|
19
|
-
|
|
20
|
-
`
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
`
|
|
30
|
-
`
|
|
31
|
-
`
|
|
32
|
-
`
|
|
33
|
-
`
|
|
34
|
-
`
|
|
35
|
-
|
|
36
|
-
`
|
|
37
|
-
`
|
|
38
|
-
`
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
1
|
+
# peoplesoft
|
|
2
|
+
|
|
3
|
+
## Client
|
|
4
|
+
|
|
5
|
+
- Employee:
|
|
6
|
+
`searchEmployeesQueryOptions`
|
|
7
|
+
`employeesQueryOptions`
|
|
8
|
+
`activeEmployeesQueryOptions`
|
|
9
|
+
`employeeByEmployeeIdQueryOptions`
|
|
10
|
+
`previousEmployeeIdsQueryOptions`
|
|
11
|
+
`employeeSupervisorQueryOptions`
|
|
12
|
+
`employeeSubordinatesQueryOptions`
|
|
13
|
+
`employeeManagerQueryOptions`
|
|
14
|
+
`employeeGeneralManagerQueryOptions`
|
|
15
|
+
`companyGeneralManagerQueryOptions`
|
|
16
|
+
`searchEmployees`
|
|
17
|
+
`getEmployees`
|
|
18
|
+
`getActiveEmployees`
|
|
19
|
+
- Department:
|
|
20
|
+
`departmentsQueryOptions`
|
|
21
|
+
`departmentByIdQueryOptions`
|
|
22
|
+
`departmentManagerQueryOptions`
|
|
23
|
+
`departmentEmployeesQueryOptions`
|
|
24
|
+
`getDepartments`
|
|
25
|
+
|
|
26
|
+
## Server
|
|
27
|
+
|
|
28
|
+
- Employee:
|
|
29
|
+
`searchEmployees`
|
|
30
|
+
`getEmployees`
|
|
31
|
+
`getActiveEmployees`
|
|
32
|
+
`getEmployeeByEmployeeId`
|
|
33
|
+
`getPreviousEmployeeIds`
|
|
34
|
+
`getEmployeeSupervisor`
|
|
35
|
+
`getEmployeeSubordinates`
|
|
36
|
+
`getEmployeeManager`
|
|
37
|
+
`getEmployeeGeneralManager`
|
|
38
|
+
`getCompanyGeneralManager`
|
|
39
|
+
- Department:
|
|
40
|
+
`getDepartments`
|
|
41
|
+
`getDepartmentById`
|
|
42
|
+
`getDepartmentManager`
|
|
43
|
+
`getDepartmentEmployees`
|
|
44
|
+
|
|
45
|
+
## Schemas/Models
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
const EmployeeSchema = z.object({
|
|
49
|
+
badgeId: z.string().trim(),
|
|
50
|
+
category: z.string().trim(),
|
|
51
|
+
categoryGroup: EmployeeCategoryGroup,
|
|
52
|
+
companyCode: z.string().trim(),
|
|
53
|
+
contactPhone: z.string().trim(),
|
|
54
|
+
departmentId: z.string().trim(),
|
|
55
|
+
departmentDescription: z.string().trim(),
|
|
56
|
+
emailString: z.string().trim().nullable(),
|
|
57
|
+
employeeId: z.string().trim(),
|
|
58
|
+
extensionNumber: z.string().trim(),
|
|
59
|
+
firstName: z.string().trim(),
|
|
60
|
+
gender: z.string().trim(),
|
|
61
|
+
hiredDate: z.date(),
|
|
62
|
+
lastName: z.string().trim(),
|
|
63
|
+
managerId: z.string().trim(),
|
|
64
|
+
middleName: z.string().trim(),
|
|
65
|
+
name: z.string().trim(),
|
|
66
|
+
nameTitleCase: z.string().trim(),
|
|
67
|
+
nfcSn: z.string().trim(),
|
|
68
|
+
plantId: z.string().trim(),
|
|
69
|
+
position: z.string().trim(),
|
|
70
|
+
previousEmployeeIds: z.string().trim().nullable(),
|
|
71
|
+
reHiredDate: z.date().nullable(),
|
|
72
|
+
recordNumber: z.number(),
|
|
73
|
+
status: EmployeeStatus,
|
|
74
|
+
supervisorId: z.string().trim(),
|
|
75
|
+
terminationDate: z.date().nullable(),
|
|
76
|
+
terminationFutureDate: z.date().nullable(),
|
|
77
|
+
type: z.string().trim(),
|
|
78
|
+
upperDepartmentId: z.string().trim(),
|
|
79
|
+
jobCode: z.string().trim(),
|
|
80
|
+
jobDescription: z.string().trim(),
|
|
81
|
+
terminationReason: z.string().trim().nullable(),
|
|
82
|
+
supervisorRecordNumber: z.number(),
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const DepartmentSchema = z.object({
|
|
86
|
+
departmentId: z.string().trim(),
|
|
87
|
+
description: z.string().trim(),
|
|
88
|
+
managerId: z.string().trim(),
|
|
89
|
+
managerRecordNumber: z.string().trim(),
|
|
90
|
+
treeLevel: z.number(),
|
|
91
|
+
upperDepartmentId: z.string().trim(),
|
|
92
|
+
companyCode: z.string().trim(),
|
|
93
|
+
location: z.string().trim(),
|
|
94
|
+
salLocation: z.string().trim(),
|
|
95
|
+
plantId: z.string().trim(),
|
|
96
|
+
manager: EmployeeSchema,
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const EmployeeCategoryGroup = z.enum(["IDL", "FD", "FI"]);
|
|
100
|
+
const EmployeeStatus = z.enum(["Active", "Terminated", "Leave of Absence"]);
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Examples
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
import { activeEmployeesQueryOptions } from "wcz-layout/data/client";
|
|
107
|
+
import { getEmployeeManager } from "wcz-layout/data/server";
|
|
108
|
+
|
|
109
|
+
// client
|
|
110
|
+
const { data: employees = [] } = useQuery(activeEmployeesQueryOptions());
|
|
111
|
+
|
|
112
|
+
// server
|
|
113
|
+
const manager = await getEmployeeManager({ data: { employeeId } });
|
|
114
|
+
```
|
package/skills/start/SKILL.md
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: start
|
|
3
|
-
description: "Use when
|
|
3
|
+
description: "Use when bootstrapping a cloned template: git remote, project rename, APM and WiCOP registration, Postgres, Entra ID, Vault, favicon, GitLab CI, and first push."
|
|
4
|
+
metadata:
|
|
5
|
+
type: workflow
|
|
6
|
+
library: wcz-layout
|
|
7
|
+
disable-model-invocation: "true"
|
|
4
8
|
---
|
|
5
9
|
|
|
6
|
-
# Project
|
|
10
|
+
# Project initialization
|
|
7
11
|
|
|
8
12
|
## Role
|
|
9
13
|
|
|
@@ -23,8 +27,8 @@ Begin every conversation with:
|
|
|
23
27
|
|
|
24
28
|
> To make initialization flexible, you can choose:
|
|
25
29
|
>
|
|
26
|
-
> -
|
|
27
|
-
> -
|
|
30
|
+
> - **Full initialization** for a new project
|
|
31
|
+
> - **Selected steps** from the list below
|
|
28
32
|
|
|
29
33
|
Then list all steps by name so the user can pick.
|
|
30
34
|
|
|
@@ -37,7 +41,7 @@ Then list all steps by name so the user can pick.
|
|
|
37
41
|
| 3 | [03-apm-setup.md](steps/03-apm-setup.md) | Register the app internally |
|
|
38
42
|
| 4 | [04-wicop-setup.md](steps/04-wicop-setup.md) | Request release management (CD) |
|
|
39
43
|
| 5 | [05-database-setup.md](steps/05-database-setup.md) | Postgres via Docker or existing |
|
|
40
|
-
| 6 | [06-entra-setup.md](steps/06-entra-setup.md) |
|
|
44
|
+
| 6 | [06-entra-setup.md](steps/06-entra-setup.md) | Entra ID app registration |
|
|
41
45
|
| 7 | [07-vault-setup.md](steps/07-vault-setup.md) | Vault secrets configuration |
|
|
42
46
|
| 8 | [08-generate-favicon.md](steps/08-generate-favicon.md) | Generate and replace favicon |
|
|
43
47
|
| 9 | [09-commit.md](steps/09-commit.md) | Commit and push to origin |
|