@shivaedev/admin 0.24.3 → 0.26.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/CHANGELOG.md +37 -0
- package/README.md +104 -76
- package/dist/Jobs.d.ts +71 -0
- package/dist/Jobs.d.ts.map +1 -0
- package/dist/Jobs.js +13 -0
- package/dist/Jobs.js.map +1 -0
- package/dist/JobsWithRetry.d.ts +92 -0
- package/dist/JobsWithRetry.d.ts.map +1 -0
- package/dist/JobsWithRetry.js +40 -0
- package/dist/JobsWithRetry.js.map +1 -0
- package/dist/Users.d.ts +35 -0
- package/dist/Users.d.ts.map +1 -0
- package/dist/Users.js +35 -0
- package/dist/Users.js.map +1 -0
- package/dist/client/adapters/JobDetail.d.ts +5 -2
- package/dist/client/adapters/JobDetail.d.ts.map +1 -1
- package/dist/client/adapters/JobDetail.js +13 -9
- package/dist/client/adapters/JobDetail.js.map +1 -1
- package/dist/client/adapters/JobList.d.ts +3 -1
- package/dist/client/adapters/JobList.d.ts.map +1 -1
- package/dist/client/adapters/JobList.js +3 -3
- package/dist/client/adapters/JobList.js.map +1 -1
- package/dist/client/adapters/JobsQueueView.d.ts +3 -1
- package/dist/client/adapters/JobsQueueView.d.ts.map +1 -1
- package/dist/client/adapters/JobsQueueView.js +2 -2
- package/dist/client/adapters/JobsQueueView.js.map +1 -1
- package/dist/client/adapters/JobsView.d.ts +3 -2
- package/dist/client/adapters/JobsView.d.ts.map +1 -1
- package/dist/client/adapters/JobsView.js +10 -2
- package/dist/client/adapters/JobsView.js.map +1 -1
- package/dist/client/adapters/SessionConfirmation.d.ts +1 -1
- package/dist/client/adapters/SessionConfirmation.d.ts.map +1 -1
- package/dist/client/adapters/SessionListView.d.ts +3 -1
- package/dist/client/adapters/SessionListView.d.ts.map +1 -1
- package/dist/client/adapters/SessionListView.js +5 -5
- package/dist/client/adapters/SessionListView.js.map +1 -1
- package/dist/client/adapters/SessionPagination.d.ts +2 -2
- package/dist/client/adapters/SessionPagination.d.ts.map +1 -1
- package/dist/client/adapters/SessionsView.d.ts +5 -4
- package/dist/client/adapters/SessionsView.d.ts.map +1 -1
- package/dist/client/adapters/SessionsView.js +10 -2
- package/dist/client/adapters/SessionsView.js.map +1 -1
- package/dist/client/adapters/Timestamp.d.ts +8 -0
- package/dist/client/adapters/Timestamp.d.ts.map +1 -0
- package/dist/client/adapters/Timestamp.js +7 -0
- package/dist/client/adapters/Timestamp.js.map +1 -0
- package/dist/client/adapters/UsersTable.d.ts +4 -2
- package/dist/client/adapters/UsersTable.d.ts.map +1 -1
- package/dist/client/adapters/UsersTable.js +3 -3
- package/dist/client/adapters/UsersTable.js.map +1 -1
- package/dist/client/adapters/UsersView.d.ts +5 -4
- package/dist/client/adapters/UsersView.d.ts.map +1 -1
- package/dist/client/adapters/UsersView.js +4 -2
- package/dist/client/adapters/UsersView.js.map +1 -1
- package/dist/client/adapters/jobsTypes.d.ts +8 -8
- package/dist/client/adapters/jobsTypes.d.ts.map +1 -1
- package/dist/client/adapters/timestampText.d.ts +7 -0
- package/dist/client/adapters/timestampText.d.ts.map +1 -0
- package/dist/client/adapters/timestampText.js +9 -0
- package/dist/client/adapters/timestampText.js.map +1 -0
- package/dist/generated/Jobs.d.ts +144 -0
- package/dist/generated/Jobs.d.ts.map +1 -0
- package/dist/generated/Jobs.js +35 -0
- package/dist/generated/Jobs.js.map +1 -0
- package/dist/generated/JobsWithRetry.d.ts +182 -0
- package/dist/generated/JobsWithRetry.d.ts.map +1 -0
- package/dist/generated/JobsWithRetry.js +50 -0
- package/dist/generated/JobsWithRetry.js.map +1 -0
- package/dist/generated/Users.d.ts +65 -0
- package/dist/generated/Users.d.ts.map +1 -0
- package/dist/generated/Users.js +27 -0
- package/dist/generated/Users.js.map +1 -0
- package/dist/jobs/DeadLetter.d.ts +27 -0
- package/dist/jobs/DeadLetter.d.ts.map +1 -0
- package/dist/jobs/DeadLetter.js +11 -0
- package/dist/jobs/DeadLetter.js.map +1 -0
- package/dist/jobs/NotFailed.d.ts +9 -0
- package/dist/jobs/NotFailed.d.ts.map +1 -0
- package/dist/jobs/NotFailed.js +7 -0
- package/dist/jobs/NotFailed.js.map +1 -0
- package/dist/jobs/Page.d.ts +272 -0
- package/dist/jobs/Page.d.ts.map +1 -0
- package/dist/jobs/Page.js +10 -0
- package/dist/jobs/Page.js.map +1 -0
- package/dist/jobs/PageWithRetry.d.ts +296 -0
- package/dist/jobs/PageWithRetry.d.ts.map +1 -0
- package/dist/jobs/PageWithRetry.js +10 -0
- package/dist/jobs/PageWithRetry.js.map +1 -0
- package/dist/jobs/Row.d.ts +21 -0
- package/dist/jobs/Row.d.ts.map +1 -0
- package/dist/jobs/Row.js +5 -0
- package/dist/jobs/Row.js.map +1 -0
- package/dist/jobs/schemas.d.ts +2 -55
- package/dist/jobs/schemas.d.ts.map +1 -1
- package/dist/jobs/schemas.js +2 -19
- package/dist/jobs/schemas.js.map +1 -1
- package/dist/page.d.ts +4 -3
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js.map +1 -1
- package/dist/server/RegisteredQueues.d.ts +21 -0
- package/dist/server/RegisteredQueues.d.ts.map +1 -0
- package/dist/server/RegisteredQueues.js +4 -0
- package/dist/server/RegisteredQueues.js.map +1 -0
- package/dist/server/adapters/pgBossQueues.d.ts +6 -0
- package/dist/server/adapters/pgBossQueues.d.ts.map +1 -0
- package/dist/server/adapters/pgBossQueues.js +57 -0
- package/dist/server/adapters/pgBossQueues.js.map +1 -0
- package/dist/server/jobsReads.d.ts +40 -0
- package/dist/server/jobsReads.d.ts.map +1 -0
- package/dist/server/jobsReads.js +65 -0
- package/dist/server/jobsReads.js.map +1 -0
- package/dist/sessions/Page.d.ts +29 -25
- package/dist/sessions/Page.d.ts.map +1 -1
- package/dist/sessions/Page.js +1 -1
- package/dist/sessions/Page.js.map +1 -1
- package/dist/users/List.d.ts +5 -0
- package/dist/users/List.d.ts.map +1 -0
- package/dist/users/List.js +2 -0
- package/dist/users/List.js.map +1 -0
- package/dist/users/Page.d.ts +104 -0
- package/dist/users/Page.d.ts.map +1 -0
- package/dist/users/Page.js +10 -0
- package/dist/users/Page.js.map +1 -0
- package/package.json +17 -15
- package/src/Jobs.ts +13 -0
- package/src/JobsWithRetry.ts +42 -0
- package/src/Users.ts +38 -0
- package/src/client/adapters/JobDetail.tsx +23 -8
- package/src/client/adapters/JobList.tsx +5 -2
- package/src/client/adapters/JobsQueueView.tsx +4 -1
- package/src/client/adapters/JobsView.ts +12 -3
- package/src/client/adapters/SessionConfirmation.tsx +1 -1
- package/src/client/adapters/SessionListView.tsx +8 -6
- package/src/client/adapters/SessionPagination.tsx +2 -2
- package/src/client/adapters/SessionsView.ts +14 -5
- package/src/client/adapters/Timestamp.tsx +18 -0
- package/src/client/adapters/UsersTable.tsx +9 -8
- package/src/client/adapters/UsersView.ts +8 -5
- package/src/client/adapters/jobsTypes.ts +8 -8
- package/src/client/adapters/timestampText.ts +17 -0
- package/src/generated/Jobs.ts +40 -0
- package/src/generated/JobsWithRetry.ts +55 -0
- package/src/generated/README.md +1 -0
- package/src/generated/Users.ts +32 -0
- package/src/jobs/DeadLetter.ts +10 -0
- package/src/jobs/NotFailed.ts +6 -0
- package/src/jobs/Page.ts +10 -0
- package/src/jobs/PageWithRetry.ts +10 -0
- package/src/jobs/Row.ts +4 -0
- package/src/jobs/schemas.ts +2 -23
- package/src/page.ts +8 -9
- package/src/server/RegisteredQueues.ts +22 -0
- package/src/server/adapters/pgBossQueues.ts +94 -0
- package/src/server/jobsReads.ts +72 -0
- package/src/sessions/Page.ts +1 -1
- package/src/users/List.ts +3 -0
- package/src/users/Page.ts +10 -0
- package/dist/jobs/page.d.ts +0 -425
- package/dist/jobs/page.d.ts.map +0 -1
- package/dist/jobs/page.js +0 -58
- package/dist/jobs/page.js.map +0 -1
- package/dist/jobs/retryPage.d.ts +0 -480
- package/dist/jobs/retryPage.d.ts.map +0 -1
- package/dist/jobs/retryPage.js +0 -50
- package/dist/jobs/retryPage.js.map +0 -1
- package/dist/server/jobsHandlers.d.ts +0 -62
- package/dist/server/jobsHandlers.d.ts.map +0 -1
- package/dist/server/jobsHandlers.js +0 -73
- package/dist/server/jobsHandlers.js.map +0 -1
- package/dist/server/jobsHandlersWithRetry.d.ts +0 -7
- package/dist/server/jobsHandlersWithRetry.d.ts.map +0 -1
- package/dist/server/jobsHandlersWithRetry.js +0 -43
- package/dist/server/jobsHandlersWithRetry.js.map +0 -1
- package/dist/server/usersHandlers.d.ts +0 -3
- package/dist/server/usersHandlers.d.ts.map +0 -1
- package/dist/server/usersHandlers.js +0 -15
- package/dist/server/usersHandlers.js.map +0 -1
- package/dist/users/page.d.ts +0 -115
- package/dist/users/page.d.ts.map +0 -1
- package/dist/users/page.js +0 -35
- package/dist/users/page.js.map +0 -1
- package/src/jobs/page.ts +0 -58
- package/src/jobs/retryPage.ts +0 -54
- package/src/server/jobsHandlers.ts +0 -95
- package/src/server/jobsHandlersWithRetry.ts +0 -59
- package/src/server/usersHandlers.ts +0 -17
- package/src/users/page.ts +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.26.0 - 2026-11-18
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `UsersView`, `SessionsView` and `JobsView` take optional `locale` and `timeZone` props, a BCP 47 language tag and an IANA zone name, and show their times in them. Pass the values the application reads from identity's `AccountPreferences`; admin does not read them itself. A value the browser's `Intl` cannot read falls back to the browser's locale and time zone.
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- The Users, Sessions and Jobs views show each time as a date and a time with seconds and the zone's short name, such as `20 Oct 2026, 14:34:56 CEST`, in the browser's locale and time zone, instead of the raw ISO timestamp. The `<time>` element's `dateTime` attribute keeps the UTC instant in ISO form, and the job detail's Created, Started and Completed times are now `<time>` elements too. A test that reads the visible text of these times needs the new text, or the `dateTime` attribute for the instant.
|
|
12
|
+
|
|
13
|
+
## 0.25.0 - 2026-11-11
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- `RegisteredQueues` from `@shivaedev/admin/server/RegisteredQueues.ts` holds the queues operators may administer; `pgBossQueues` builds it from the application's jobs service, keeping the payload Schemas' decoding services on its Layer.
|
|
18
|
+
- An admin page's operations can be a module built with `defineModule`: pass the generated client contract to `adminPage` and register `moduleHandlers(Module)` for the page, beside pages with hand-written handlers in the same registry.
|
|
19
|
+
- The package's build writes `src/generated` and `dist/generated` before compiling, so the published archive holds the generated client contracts.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- The sessions page uses identity's generated sessions contract, so a browser bundle with the page holds none of identity's server code.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- `adminPage` keeps each query's own payload and success types for a generated contract with several queries, so its bound client's queries no longer return the union of every query's success.
|
|
28
|
+
|
|
29
|
+
### Breaking
|
|
30
|
+
|
|
31
|
+
- The Jobs pages are fixed pages instead of factories over the queue list. Replace `jobsPage(...queues)` from `@shivaedev/admin/jobs/page.ts` with `JobsPage` from `@shivaedev/admin/jobs/Page.ts`, and `jobsPageWithRetry(...queues)` from `@shivaedev/admin/jobs/retryPage.ts` with `JobsPageWithRetry` from `@shivaedev/admin/jobs/PageWithRetry.ts`. The pages no longer carry `queues` or `schedules`: pass the application's queue and schedule declarations to `JobsView` directly.
|
|
32
|
+
- Their operations are the modules `Jobs` from `@shivaedev/admin/Jobs.ts` and `JobsWithRetry` from `@shivaedev/admin/JobsWithRetry.ts`, which are server code. Replace `jobsHandlers(page, JobsService)` (`@shivaedev/admin/server/jobsHandlers.ts`) with `moduleHandlers(Jobs)` and `jobsHandlersWithRetry(page, JobsService)` (`@shivaedev/admin/server/jobsHandlersWithRetry.ts`) with `moduleHandlers(JobsWithRetry)`, with `moduleHandlers` from `@shivaedev/contract/moduleHandlers.ts`, and provide `pgBossQueues(JobsService, ...queues)` from `@shivaedev/admin/server/adapters/pgBossQueues.ts` to the handlers. `jobsReadHandlers` and `jobsFailures` are removed. Browser code that needs the client contracts imports `Jobs` from `@shivaedev/admin/generated/Jobs.ts` and `JobsWithRetry` from `@shivaedev/admin/generated/JobsWithRetry.ts`.
|
|
33
|
+
- Listed jobs and job details are `JobsRow` from `@shivaedev/admin/jobs/Row.ts` and dead-letter copies are `JobsDeadLetter` from `@shivaedev/admin/jobs/DeadLetter.ts`; `jobSchema`, `deadLetteredSchema`, `jobPage` and `JobsFailures` from `@shivaedev/admin/jobs/schemas.ts` are removed. A job's `queue` and a copy's `sourceQueue` are strings. `JobsNotFailed` moved from `@shivaedev/admin/jobs/retryPage.ts` to `@shivaedev/admin/jobs/NotFailed.ts`.
|
|
34
|
+
- Each Jobs operation declares only the rejections it can raise, and `next`, job lookups and `runScheduleNow` travel as encoded `Option` values instead of nullable ones; deploy the browser and the server together.
|
|
35
|
+
- The Users page is a fixed page instead of a factory: replace `usersPage(AppAccess)` from `@shivaedev/admin/users/page.ts` with `UsersPage` from `@shivaedev/admin/users/Page.ts`. Its operations are the module `Users` from `@shivaedev/admin/Users.ts`, which is server code; register them with `users: moduleHandlers(Users)`, with `moduleHandlers` from `@shivaedev/contract/moduleHandlers.ts`. `usersHandlers` (`@shivaedev/admin/server/usersHandlers.ts`) is removed. Browser code that needs the client contract imports `Users` from `@shivaedev/admin/generated/Users.ts`.
|
|
36
|
+
- `admin.users.changeRole` takes the role as a string. The application's role set still decides which roles exist: `betterAuthUserDirectory(AppAccess, ...)` refuses an undeclared role with `AuthUnavailable` before writing anything.
|
|
37
|
+
- The `UsersList` schema from `@shivaedev/admin/users/page.ts` is now the `UsersList` type from `@shivaedev/admin/users/List.ts`: replace `typeof UsersList.Type` with `UsersList`.
|
|
38
|
+
- `admin.users.list` takes its success from what the operation returns, so `next` travels as an encoded `Option` instead of a nullable cursor; deploy the browser and the server together.
|
|
39
|
+
|
|
3
40
|
## 0.24.3 - 2026-11-11
|
|
4
41
|
|
|
5
42
|
### Changed
|
package/README.md
CHANGED
|
@@ -75,6 +75,36 @@ Declare application roles with `@shivaedev/access`, grant the relevant domain pe
|
|
|
75
75
|
|
|
76
76
|
Pass `registration.group` and `handlers` to the existing application's RPC host on `/rpc`, merging them with its other groups and Layers as needed. The Platform host supplies generated change handlers; registration requires the page's application handlers. Handler Layer errors and service requirements remain inferred. Missing or extra page ids defect when the handler Layer is built; TypeScript also checks each Layer provides the handlers for its page.
|
|
77
77
|
|
|
78
|
+
### Write a page's operations once
|
|
79
|
+
|
|
80
|
+
A page's operations can instead be a module built with `defineModule` from `@shivaedev/contract/defineModule.ts`: each operation is its `payload` and `*run`, and `pnpm generate` writes the browser contract from the module. Give the module the page's permission middleware, so `run` can read `SessionUser`. The module file is server code, for example `src/modules/admin/jobs/Failed.ts`:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
export const Failed = defineModule({
|
|
84
|
+
middleware: JobsPermission,
|
|
85
|
+
name: "admin.jobs",
|
|
86
|
+
operations: [ListFailed],
|
|
87
|
+
requires: [JobStore],
|
|
88
|
+
wire: adminJobsWire,
|
|
89
|
+
});
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
The browser-safe page imports the generated contract, which has the module's name:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
import { Failed } from "#generated/modules/admin/jobs/Failed.ts";
|
|
96
|
+
|
|
97
|
+
export const Jobs = adminPage({ contract: Failed, id: "jobs", permission: JobsPermission, route: { path: "/admin/jobs", title: "Jobs" } });
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Server registration serves the module itself with `moduleHandlers` from `@shivaedev/contract/moduleHandlers.ts`, which runs each query's read policy inside its handler:
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
registerAdmin(Admin, { jobs: moduleHandlers(Failed) });
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The page's permission covers every operation as for any page. Pages in this form and pages with hand-written handlers share one registry, so an application moves one page at a time.
|
|
107
|
+
|
|
78
108
|
### Protect documents and detail routes
|
|
79
109
|
|
|
80
110
|
Provide the application's session policy through `SessionPolicy` once. Registration builds each page's permission layer with that policy. The handler Layer requires identity's `SessionPolicy` service.
|
|
@@ -101,44 +131,42 @@ Browser composition uses `mergeAdminRegistries` from `@shivaedev/admin/registry.
|
|
|
101
131
|
|
|
102
132
|
An `admin/` path segment means admin-only code. A wholly admin-only feature lives under `src/modules/admin/<name>`, with its shared declarations, `server/` and `client/` there. Admin tools for a member feature stay inside that feature: `admin/` for browser-safe page declarations, `server/admin/` for reads and handlers, and `client/admin/` for bindings and views. Each module reads only its own tables; compose another module's exposed operations for data it owns. Permissions enforce access regardless of the path.
|
|
103
133
|
|
|
104
|
-
The starter
|
|
134
|
+
The starter writes the statistics read once as an operation in [`src/modules/notes/server/admin/Read.ts`](https://github.com/ShivaeDev/platform/blob/main/examples/starter/src/modules/notes/server/admin/Read.ts):
|
|
105
135
|
|
|
106
136
|
```ts
|
|
107
137
|
import { Effect, Schema } from "effect";
|
|
108
138
|
import { SqlClient, SqlSchema } from "effect/sql";
|
|
109
|
-
import {
|
|
110
|
-
import {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
139
|
+
import { query } from "@shivaedev/contract/operation.ts";
|
|
140
|
+
import { notes } from "#modules/notes/model.ts";
|
|
141
|
+
|
|
142
|
+
const Totals = Schema.Struct({ notes: Schema.Number, pending: Schema.Number, words: Schema.Number });
|
|
143
|
+
|
|
144
|
+
export const Read = query("statistics", {
|
|
145
|
+
reads: () => [notes.list],
|
|
146
|
+
*run() {
|
|
147
|
+
const sql = yield* SqlClient.SqlClient;
|
|
148
|
+
const read = SqlSchema.findOne({
|
|
149
|
+
execute: () => sql`select count(*)::int as notes, count(*) filter (where word_count is null)::int as pending,
|
|
150
|
+
coalesce(sum(word_count), 0)::int as words from notes`,
|
|
151
|
+
Request: Schema.Void,
|
|
152
|
+
Result: Totals,
|
|
153
|
+
});
|
|
154
|
+
// An aggregate without grouping always returns one row.
|
|
155
|
+
return yield* read(undefined).pipe(Effect.catchTag("NoSuchElementError", Effect.die));
|
|
156
|
+
},
|
|
121
157
|
});
|
|
122
158
|
```
|
|
123
159
|
|
|
124
|
-
[`src/modules/notes/server/admin/registration.ts`](https://github.com/ShivaeDev/platform/blob/main/examples/starter/src/modules/notes/server/admin/registration.ts)
|
|
160
|
+
Its module, [`src/modules/notes/admin/Statistics.ts`](https://github.com/ShivaeDev/platform/blob/main/examples/starter/src/modules/notes/admin/Statistics.ts), lists that operation under the page's permission. [`src/modules/notes/admin/pages.ts`](https://github.com/ShivaeDev/platform/blob/main/examples/starter/src/modules/notes/admin/pages.ts) declares `StatisticsPage` with `adminPage` over the generated contract, and [`src/modules/notes/server/admin/registration.ts`](https://github.com/ShivaeDev/platform/blob/main/examples/starter/src/modules/notes/server/admin/registration.ts) serves the module:
|
|
125
161
|
|
|
126
162
|
```ts
|
|
127
163
|
import { registerAdmin } from "@shivaedev/admin/server/registerAdmin.ts";
|
|
128
|
-
import {
|
|
129
|
-
import {
|
|
130
|
-
import {
|
|
131
|
-
import { readStatistics } from "./readStatistics.ts";
|
|
132
|
-
|
|
133
|
-
const statistics = StatisticsPage.contract.application.toLayer({
|
|
134
|
-
"admin.notes.statistics": () =>
|
|
135
|
-
readStatistics().pipe(
|
|
136
|
-
rpcBoundary(StatisticsPage.contract.declaration.queries[0].error, { unexpected: (message) => new InternalServerError({ message }) }),
|
|
137
|
-
),
|
|
138
|
-
});
|
|
164
|
+
import { moduleHandlers } from "@shivaedev/contract/moduleHandlers.ts";
|
|
165
|
+
import { Admin } from "#modules/notes/admin/pages.ts";
|
|
166
|
+
import { Statistics } from "#modules/notes/admin/Statistics.ts";
|
|
139
167
|
|
|
140
168
|
export const adminRegistration = registerAdmin(Admin, {
|
|
141
|
-
"note-statistics":
|
|
169
|
+
"note-statistics": moduleHandlers(Statistics),
|
|
142
170
|
});
|
|
143
171
|
```
|
|
144
172
|
|
|
@@ -146,54 +174,48 @@ The read stays in notes because notes owns the table. The [client registration](
|
|
|
146
174
|
|
|
147
175
|
### Built-in Jobs page
|
|
148
176
|
|
|
149
|
-
|
|
177
|
+
Add `JobsPage` from `@shivaedev/admin/jobs/Page.ts` to the registry and register `jobs: moduleHandlers(Jobs)`, with `Jobs` from `@shivaedev/admin/Jobs.ts`, the module behind the page, which is server code. The module requires `RegisteredQueues` from `@shivaedev/admin/server/RegisteredQueues.ts`: the queues operators may administer and the jobs runtime they run on. Provide it with `pgBossQueues` from `@shivaedev/admin/server/adapters/pgBossQueues.ts`, passing the application's existing `makePgBoss` service and each queue's name, optional display label, subject columns and payload Schema. The page exposes only those queues; a queue registered with the jobs runtime is not automatically available to operators.
|
|
150
178
|
|
|
151
179
|
```ts
|
|
152
|
-
import { Schema } from "effect";
|
|
153
|
-
import {
|
|
180
|
+
import { Layer, Schema } from "effect";
|
|
181
|
+
import { Jobs } from "@shivaedev/admin/Jobs.ts";
|
|
182
|
+
import { JobsPage } from "@shivaedev/admin/jobs/Page.ts";
|
|
154
183
|
import { adminRegistry } from "@shivaedev/admin/registry.ts";
|
|
184
|
+
import { pgBossQueues } from "@shivaedev/admin/server/adapters/pgBossQueues.ts";
|
|
185
|
+
import { registerAdmin } from "@shivaedev/admin/server/registerAdmin.ts";
|
|
186
|
+
import { moduleHandlers } from "@shivaedev/contract/moduleHandlers.ts";
|
|
155
187
|
|
|
156
|
-
const
|
|
157
|
-
const JobsPage = jobsPage({
|
|
188
|
+
const Mail = {
|
|
158
189
|
name: "mail",
|
|
159
190
|
label: "Email delivery",
|
|
160
|
-
schema:
|
|
191
|
+
schema: Schema.Struct({ id: Schema.NumberFromString }),
|
|
161
192
|
subject: [{ field: "id", label: "Message" }],
|
|
162
|
-
}
|
|
163
|
-
const
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
Register its handlers with the application's existing `makePgBoss` service:
|
|
167
|
-
|
|
168
|
-
```ts
|
|
169
|
-
import { jobsHandlers } from "@shivaedev/admin/server/jobsHandlers.ts";
|
|
170
|
-
import { registerAdmin } from "@shivaedev/admin/server/registerAdmin.ts";
|
|
171
|
-
|
|
172
|
-
const registration = registerAdmin(Admin, {
|
|
173
|
-
jobs: jobsHandlers(JobsPage, JobsService),
|
|
174
|
-
});
|
|
193
|
+
};
|
|
194
|
+
const registration = registerAdmin(adminRegistry(JobsPage), { jobs: moduleHandlers(Jobs) });
|
|
195
|
+
const queues = pgBossQueues(JobsService, Mail);
|
|
196
|
+
const handlers = registration.handlers.pipe(Layer.provide(queues));
|
|
175
197
|
```
|
|
176
198
|
|
|
177
|
-
|
|
199
|
+
The `pgBossQueues` Layer requires the jobs service and the payload Schemas' decoding services, so the page's operations require only `RegisteredQueues`.
|
|
178
200
|
|
|
179
|
-
The queries are `admin.jobs.health`, `admin.jobs.counts`, `admin.jobs.failed`, `admin.jobs.deadLettered` and `admin.jobs.job`. Counts take `{ queue }`; listings take `{ queue, limit, cursor? }` and return `{ jobs, next }`, where `next` is an `Option<string>`. Job lookup takes `{ queue, id }` and returns `Option<
|
|
201
|
+
The queries are `admin.jobs.health`, `admin.jobs.counts`, `admin.jobs.failed`, `admin.jobs.deadLettered` and `admin.jobs.job`. Counts take `{ queue }`; listings take `{ queue, limit, cursor? }` and return `{ jobs, next }`, where `next` is an `Option<string>`. Job lookup takes `{ queue, id }` and returns `Option<JobsRow>`. Each job is a `JobsRow` from `@shivaedev/admin/jobs/Row.ts` carrying its queue, decoded payload, state, attempt and retry counts, output and timestamps. Dead-letter listings return `JobsDeadLetter` from `@shivaedev/admin/jobs/DeadLetter.ts`, which also carries `sourceQueue`, `sourceId` and `sourceOutput`. `sourceQueue` names the original queue, so readers can route to it directly. Once the original succeeds, its copies leave the dead-letter listing. Output and source output use the jobs package's `JobFailure | null` shape (`_tag` and redacted `message`). A zero page limit or malformed listing cursor is rejected as `BadRequest`. Timestamps use UTC `DateTime` values. Jobs decodes the durable payload and masks native `Redacted` values and sensitive keys before the RPC response. Payloads are diagnostic `data: unknown`; narrow them before reading fields. Result serialization does not run the queue's payload encoder or require its encoding services.
|
|
180
202
|
|
|
181
|
-
Schedule definitions from `defineSchedule` can be passed beside queues. For a worker-only schedule, share a browser-safe object such as `const Cleanup = { name: "cleanup" } as const`. Pass `Cleanup` to `
|
|
203
|
+
Schedule definitions from `defineSchedule` can be passed beside queues. For a worker-only schedule, share a browser-safe object such as `const Cleanup = { name: "cleanup" } as const`. Pass `Cleanup` to `pgBossQueues` and spread it into the worker's `defineSchedule({ ...Cleanup, cron: "17 3 * * *" })`. Scheduled runs use a null payload schema for failed and dead-letter listings and job lookup. With no queues, `pgBossQueues(JobsService)` serves health with no jobs and zero totals.
|
|
182
204
|
|
|
183
|
-
Health reads the
|
|
205
|
+
Health reads the declared queues in declaration order, including schedules registered by a separate worker service, and totals only those queues. It has the same refresh timing as jobs health. Unregistered names, including dead-letter queue names passed directly, fail with `JobsQueueUnregistered`. Stored payload decoding failures become `JobsPayloadInvalid`; jobs operation failures become `JobsUnavailable`, carrying the operation name. These declared failures do not expose the original database error.
|
|
184
206
|
|
|
185
|
-
The
|
|
207
|
+
The `Jobs` module declares no commands, and its bound client has no retry operation. Handler registration performs no jobs read, and a failed jobs request leaves other pages available. The application mounts the registration on its existing RPC host.
|
|
186
208
|
|
|
187
209
|
#### Mount the Jobs view
|
|
188
210
|
|
|
189
|
-
Bind the page contract to the application's AtomRpc client and pass
|
|
211
|
+
Bind the page contract to the application's AtomRpc client and pass the queues given to `pgBossQueues` to `JobsView`. The view lists failed and dead-lettered jobs with readable failure messages, health, counts, pagination and detail. A caller without `jobs.read` sees a permission refusal. Tailwind applications include `@source "../../node_modules/@shivaedev/admin/src/client/adapters";` in their client CSS.
|
|
190
212
|
|
|
191
213
|
```tsx
|
|
192
214
|
import { JobsView } from "@shivaedev/admin/client/adapters/JobsView.ts";
|
|
193
215
|
|
|
194
216
|
const jobs = bind(JobsPage.contract, Client);
|
|
195
217
|
|
|
196
|
-
<JobsView api={jobs} queues={
|
|
218
|
+
<JobsView api={jobs} queues={[Mail]} />;
|
|
197
219
|
```
|
|
198
220
|
|
|
199
221
|
For a retry-enabled page, pass `retry={Client.runtime.fn(jobs.retry.run)}`. The view offers retry on failed originals; the server also requires `jobs.retry`. Omit both action props for a read-only view. Keep the view inside the application's admin shell and protect its route with `JobsPage.route.permission`.
|
|
@@ -202,43 +224,33 @@ Queue and schedule labels replace internal names in the queue picker and selecte
|
|
|
202
224
|
|
|
203
225
|
## Declare retry explicitly
|
|
204
226
|
|
|
205
|
-
Use `
|
|
227
|
+
Use `JobsPageWithRetry` from `@shivaedev/admin/jobs/PageWithRetry.ts` and its module `JobsWithRetry` from `@shivaedev/admin/JobsWithRetry.ts` when administrators should be able to retry failed original jobs:
|
|
206
228
|
|
|
207
229
|
```ts
|
|
208
|
-
import {
|
|
209
|
-
import {
|
|
210
|
-
import { Effect, Layer } from "effect";
|
|
211
|
-
import { PgBossInspection } from "@shivaedev/jobs/server/inspection.ts";
|
|
230
|
+
import { JobsWithRetry } from "@shivaedev/admin/JobsWithRetry.ts";
|
|
231
|
+
import { JobsPageWithRetry } from "@shivaedev/admin/jobs/PageWithRetry.ts";
|
|
212
232
|
|
|
213
|
-
const
|
|
214
|
-
const
|
|
215
|
-
const registration = registerAdmin(Admin, {
|
|
216
|
-
jobs: jobsHandlersWithRetry(JobsPage, JobsService),
|
|
217
|
-
});
|
|
218
|
-
const inspection = Layer.effect(
|
|
219
|
-
PgBossInspection,
|
|
220
|
-
Effect.flatMap(JobsService, (jobs) => jobs.inspection()),
|
|
221
|
-
);
|
|
222
|
-
const handlers = registration.handlers.pipe(Layer.provide(inspection));
|
|
233
|
+
const registration = registerAdmin(adminRegistry(JobsPageWithRetry), { jobs: moduleHandlers(JobsWithRetry) });
|
|
234
|
+
const handlers = registration.handlers.pipe(Layer.provide(pgBossQueues(JobsService, Mail)));
|
|
223
235
|
```
|
|
224
236
|
|
|
225
|
-
This variant adds `admin.jobs.retry`, taking `{ queue, id }` and returning void. It requires `ReadJobs` (`jobs.read`) through the page middleware and `RetryJobs` (`jobs.retry`) from `@shivaedev/admin/permissions.ts` in the
|
|
237
|
+
This variant adds `admin.jobs.retry`, taking `{ queue, id }` and returning void. It requires `ReadJobs` (`jobs.read`) through the page middleware and `RetryJobs` (`jobs.retry`) from `@shivaedev/admin/permissions.ts` in the operation. A caller with only `jobs.read` receives `Forbidden` and the job stays failed. The operation uses the jobs package's existing retry for a failed job in a declared queue. Missing jobs and jobs in other states fail with `JobsNotFailed` from `@shivaedev/admin/jobs/NotFailed.ts`; unregistered queue names, including dead-letter queues, fail with `JobsQueueUnregistered`. A dead-letter copy's id cannot retry its original.
|
|
226
238
|
|
|
227
239
|
A successful bound retry invalidates health, the affected queue's counts and both listings, and the original job's detail. Health retains the runtime monitor's refresh timing.
|
|
228
240
|
|
|
229
241
|
### Run a schedule now
|
|
230
242
|
|
|
231
|
-
The retry-enabled page also exposes `admin.jobs.runScheduleNow`, taking `{ queue }` and returning `Option<string>` with the enqueued run ID. Declare a schedule as `{ name, label?, scheduleOptions?: { key? } }` without a payload Schema, or pass its `defineSchedule` definition. The
|
|
243
|
+
The retry-enabled page also exposes `admin.jobs.runScheduleNow`, taking `{ queue }` and returning `Option<string>` with the enqueued run ID. Declare a schedule as `{ name, label?, scheduleOptions?: { key? } }` without a payload Schema, or pass its `defineSchedule` definition. The operation calls the jobs service's `runScheduleNow` and requires the same `ReadJobs` and `RetryJobs` permissions as retry. It rejects queues and schedules not passed to `pgBossQueues` with `JobsQueueUnregistered`. The schedule's normal handler processes the run and its timetable stays unchanged.
|
|
232
244
|
|
|
233
|
-
Pass the
|
|
245
|
+
Pass the schedule declarations and bound action to show **Run now** for a selected schedule:
|
|
234
246
|
|
|
235
247
|
```tsx
|
|
236
|
-
<JobsView api={jobs} queues={
|
|
248
|
+
<JobsView api={jobs} queues={[Mail, Cleanup]} schedules={[Cleanup]} runScheduleNow={Client.runtime.fn(jobs.runScheduleNow.run)} />;
|
|
237
249
|
```
|
|
238
250
|
|
|
239
251
|
### Built-in Users page
|
|
240
252
|
|
|
241
|
-
|
|
253
|
+
Add `UsersPage` from `@shivaedev/admin/users/Page.ts` to the same registry as Jobs and register `users: moduleHandlers(Users)`, with `Users` from `@shivaedev/admin/Users.ts`, the module behind the page, which is server code. The module requires identity's `UserDirectory` service. Provide `betterAuthUserDirectory(AppAccess, authOptions)` from `@shivaedev/identity/server/better-auth/adapters/userDirectory.ts` with the same options used by `betterAuthMount`. Identity owns the PostgreSQL reads and role writes, including custom auth mappings. For example, `authOptions.user.modelName: "users"` makes the Users view open and page through `users`; mapped name, email, role and creation-time columns are used as well. The page reads identity's exported `userKeys.list` collection, so role changes refresh open user lists.
|
|
242
254
|
|
|
243
255
|
Each user stores one role string accepted by `AppAccess.Role`. Each role declares an explicit permission list in application code. The Users area assigns roles; it does not edit their grants.
|
|
244
256
|
|
|
@@ -255,15 +267,15 @@ const changeRole = Client.runtime.fn(users.changeRole.run);
|
|
|
255
267
|
|
|
256
268
|
`admin.users.list` takes `{ limit, cursor? }` (1–100 users) and returns `{ users, next, canChangeRoles }` ordered by user id. Each user has id, name, email, role and a UTC sign-up time. The page's operations and generated subscription require `ReadUsers` (`users.read`), enforced by `UsersPermission`. Registration installs this middleware using `SessionPolicy`.
|
|
257
269
|
|
|
258
|
-
`admin.users.changeRole` takes `{ userId, role }
|
|
270
|
+
`admin.users.changeRole` takes `{ userId, role }` with the role as a string, since one page serves every application. The user directory refuses a role the application does not declare with `AuthUnavailable`, before anything is written, so the role set passed to `betterAuthUserDirectory` decides which roles exist. The operation also requires `AssignRoles` (`roles.assign`) from `@shivaedev/identity/roles.ts`. The view shows a role select only to callers with that permission. Role writes use identity’s `assignRole` verb, serialize in a transaction and return `LastRoleAssigner` (from `@shivaedev/identity/roles.ts`) if replacing the final holder's role would remove `roles.assign`, regardless of the role's name. A missing user returns `NotFound`. Changes invalidate the list after commit and emit an Effect log with actor id, target id, role and timestamp.
|
|
259
271
|
|
|
260
|
-
Applications can call `listUsers(input)` and `changeUserRole(input)` from `@shivaedev/admin/server/users.ts` on the server. Both require `UserDirectory` from the Effect environment. These enforce their respective domain permissions using `SessionUser`.
|
|
272
|
+
Applications can call `listUsers(input)` and `changeUserRole(input)` from `@shivaedev/admin/server/users.ts` on the server. Both require `UserDirectory` from the Effect environment. These enforce their respective domain permissions using `SessionUser`. Identity resolves the caller's stored role through the session policy.
|
|
261
273
|
|
|
262
274
|
Keep Better Auth cookie caching disabled so requests see current permissions. Route role writes through `UserDirectory.assignRole` to retain the final-assigner policy. Keep Better Auth's `/admin/set-role`, `/admin/update-user` and `/admin/create-user` browser endpoints disabled because they write roles outside that policy. Better Auth's server-side APIs stay available for trusted code such as a bootstrap command.
|
|
263
275
|
|
|
264
276
|
### Built-in Sessions page
|
|
265
277
|
|
|
266
|
-
Add `SessionsPage` from `@shivaedev/admin/sessions/Page.ts` to the admin registry and register `sessions:
|
|
278
|
+
Add `SessionsPage` from `@shivaedev/admin/sessions/Page.ts` to the admin registry and register `sessions: moduleHandlers(Sessions)`, with `moduleHandlers` from `@shivaedev/contract/moduleHandlers.ts` and `Sessions` from `@shivaedev/identity/Sessions.ts`. Registration installs this middleware using `SessionPolicy`. The page uses identity's `identity.sessions` contract and `sessions.manage` permission.
|
|
267
279
|
|
|
268
280
|
```tsx
|
|
269
281
|
import { SessionsView } from "@shivaedev/admin/client/adapters/SessionsView.ts";
|
|
@@ -281,6 +293,22 @@ const sessions = bind(SessionsPage.contract, Client);
|
|
|
281
293
|
|
|
282
294
|
The view lists signed-in sessions with the user's name and email, started, last activity and expiry times. It marks the supplied current session id and asks for confirmation in the page before revoking. A successful revoke refreshes the bound list. Revoking the current session calls `onCurrentSessionRevoked`; the application uses that callback to clear its auth state and navigate to sign-in. The starter mounts this page at `/admin/sessions` and connects the callback to its sign-out flow.
|
|
283
295
|
|
|
296
|
+
### Dates in the built-in views
|
|
297
|
+
|
|
298
|
+
The Users, Sessions and Jobs views show each time as a date and a time with seconds and the zone's short name, such as `20 Oct 2026, 14:34:56 CEST`, in the browser's locale and time zone. Pass `locale` and `timeZone` to a view to use the viewer's own instead, such as the values the application reads from identity's `AccountPreferences`. Admin does not read those preferences itself:
|
|
299
|
+
|
|
300
|
+
```tsx
|
|
301
|
+
<UsersView
|
|
302
|
+
roles={AppAccess.Role.literals}
|
|
303
|
+
list={users.list.query}
|
|
304
|
+
changeRole={changeRole}
|
|
305
|
+
locale={preferences.locale}
|
|
306
|
+
timeZone={preferences.timezone}
|
|
307
|
+
/>;
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
`locale` is a BCP 47 language tag and `timeZone` an IANA zone name; `SessionsView` and `JobsView` take the same two props. When the browser's `Intl` cannot read one of them, the view falls back to the browser's locale and time zone. Every time is a `<time>` element whose `dateTime` attribute keeps the UTC instant in ISO form.
|
|
311
|
+
|
|
284
312
|
### Client permission routes
|
|
285
313
|
|
|
286
314
|
`adminPage` requires a permission middleware, including for custom pages. It applies that middleware to the whole contract, installs a read policy checking the page grant on every query, and exposes its permission as `page.route.permission`. Queries need no repeated page-grant policy. An additional query policy can restrict access further. Bound live queries use the same page grant as one-off reads. Set the React route's `staticData.permission` to that value. Use `permissionGuard` from `@shivaedev/react/adapters/permissionGuard.ts` in protected routes' `beforeLoad` and wrap the router in `PermissionBoundary` from `@shivaedev/react/adapters/permissionBoundary.ts` with the session and one application fallback.
|
|
@@ -289,6 +317,6 @@ The view lists signed-in sessions with the user's name and email, started, last
|
|
|
289
317
|
|
|
290
318
|
Install `@shivaedev/admin` with its required `effect` peer. Registry, contract and guard consumers need no React stack. To use the optional default views, also install the optional peers `react`, `@effect/atom-react` and `@shivaedev/react`. The package has no root entry; import the module that defines the name.
|
|
291
319
|
|
|
292
|
-
Page declarations and the registry are browser-safe and add no transport. Server registration lives under `/server`, and the optional default Jobs, Users and Sessions views under `/client/adapters` use React. Applications own route composition and styling.
|
|
320
|
+
Page declarations and the registry are browser-safe and add no transport. Server registration lives under `/server`, and modules built with `defineModule`, such as `Users.ts`, are server code whose browser contracts are in `/generated`. The package's build writes `src/generated` and `dist/generated` before compiling, so the published archive holds them although the repository does not commit them. The optional default Jobs, Users and Sessions views under `/client/adapters` use React. Applications own route composition and styling.
|
|
293
321
|
|
|
294
322
|
This package declares the permission middleware and does not resolve sessions. `permissionLayer` from `@shivaedev/identity/server/permissionLayer.ts` resolves each request's session through the session policy the application supplies, then checks the page's permission.
|
package/dist/Jobs.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { JobsPermission } from "#permissions.ts";
|
|
2
|
+
import { RegisteredQueues } from "#server/RegisteredQueues.ts";
|
|
3
|
+
export declare const Jobs: import("@shivaedev/contract/defineModule.ts").Module<"admin.jobs", readonly [import("@shivaedev/contract/servedOperation.ts").ServedQuery<"health", import("effect/Schema").Void, import("effect/Schema").Struct<{
|
|
4
|
+
readonly activeTotal: import("effect/Schema").Number;
|
|
5
|
+
readonly deadLetteredTotal: import("effect/Schema").Number;
|
|
6
|
+
readonly failedTotal: import("effect/Schema").Number;
|
|
7
|
+
readonly jobs: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
8
|
+
readonly activeCount: import("effect/Schema").Number;
|
|
9
|
+
readonly deadLetteredCount: import("effect/Schema").Number;
|
|
10
|
+
readonly failedCount: import("effect/Schema").Number;
|
|
11
|
+
readonly name: import("effect/Schema").String;
|
|
12
|
+
readonly queuedCount: import("effect/Schema").Number;
|
|
13
|
+
readonly readyCount: import("effect/Schema").Number;
|
|
14
|
+
}>>;
|
|
15
|
+
readonly queuedTotal: import("effect/Schema").Number;
|
|
16
|
+
readonly readyTotal: import("effect/Schema").Number;
|
|
17
|
+
}>, {
|
|
18
|
+
readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
|
|
19
|
+
readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
|
|
20
|
+
readonly JobsUnavailable: typeof import("./jobs/schemas.ts").JobsUnavailable;
|
|
21
|
+
}, never, never, import("effect/Effect").Effect<import("@shivaedev/jobs/server/health.ts").JobsHealth, import("./jobs/schemas.ts").JobsUnavailable, RegisteredQueues>>, import("@shivaedev/contract/servedOperation.ts").ServedQuery<"counts", import("effect/Schema").Struct<{
|
|
22
|
+
queue: import("effect/Schema").String;
|
|
23
|
+
}>, import("effect/Schema").Struct<{
|
|
24
|
+
readonly activeCount: import("effect/Schema").Number;
|
|
25
|
+
readonly failedCount: import("effect/Schema").Number;
|
|
26
|
+
readonly queuedCount: import("effect/Schema").Number;
|
|
27
|
+
readonly totalCount: import("effect/Schema").Number;
|
|
28
|
+
}>, {
|
|
29
|
+
readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
|
|
30
|
+
readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
|
|
31
|
+
readonly JobsQueueUnregistered: typeof import("./jobs/schemas.ts").JobsQueueUnregistered;
|
|
32
|
+
readonly JobsUnavailable: typeof import("./jobs/schemas.ts").JobsUnavailable;
|
|
33
|
+
}, never, never, import("effect/Effect").Effect<import("@shivaedev/jobs/server/health.ts").QueueCounts, import("./jobs/schemas.ts").JobsQueueUnregistered | import("./jobs/schemas.ts").JobsUnavailable, RegisteredQueues>>, import("@shivaedev/contract/servedOperation.ts").ServedQuery<"failed", import("effect/Schema").Struct<{
|
|
34
|
+
cursor: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
35
|
+
limit: import("effect/Schema").Number;
|
|
36
|
+
queue: import("effect/Schema").String;
|
|
37
|
+
}>, import("effect/Schema").Struct<{
|
|
38
|
+
readonly jobs: import("effect/Schema").$Array<typeof import("./jobs/Row.ts").JobsRow>;
|
|
39
|
+
readonly next: import("effect/Schema").Option<import("effect/Schema").String>;
|
|
40
|
+
}>, {
|
|
41
|
+
readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
|
|
42
|
+
readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
|
|
43
|
+
readonly BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
|
|
44
|
+
readonly JobsPayloadInvalid: typeof import("./jobs/schemas.ts").JobsPayloadInvalid;
|
|
45
|
+
readonly JobsQueueUnregistered: typeof import("./jobs/schemas.ts").JobsQueueUnregistered;
|
|
46
|
+
readonly JobsUnavailable: typeof import("./jobs/schemas.ts").JobsUnavailable;
|
|
47
|
+
}, never, never, import("effect/Effect").Effect<import("@shivaedev/jobs/server/health.ts").JobPage<import("./jobs/Row.ts").JobsRow>, import("@shivaedev/errors/taxonomy.ts").BadRequest | import("./jobs/schemas.ts").JobsPayloadInvalid | (import("./jobs/schemas.ts").JobsQueueUnregistered | import("./jobs/schemas.ts").JobsUnavailable), RegisteredQueues>>, import("@shivaedev/contract/servedOperation.ts").ServedQuery<"deadLettered", import("effect/Schema").Struct<{
|
|
48
|
+
cursor: import("effect/Schema").optionalKey<import("effect/Schema").String>;
|
|
49
|
+
limit: import("effect/Schema").Number;
|
|
50
|
+
queue: import("effect/Schema").String;
|
|
51
|
+
}>, import("effect/Schema").Struct<{
|
|
52
|
+
readonly jobs: import("effect/Schema").$Array<typeof import("./jobs/DeadLetter.ts").JobsDeadLetter>;
|
|
53
|
+
readonly next: import("effect/Schema").Option<import("effect/Schema").String>;
|
|
54
|
+
}>, {
|
|
55
|
+
readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
|
|
56
|
+
readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
|
|
57
|
+
readonly BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
|
|
58
|
+
readonly JobsPayloadInvalid: typeof import("./jobs/schemas.ts").JobsPayloadInvalid;
|
|
59
|
+
readonly JobsQueueUnregistered: typeof import("./jobs/schemas.ts").JobsQueueUnregistered;
|
|
60
|
+
readonly JobsUnavailable: typeof import("./jobs/schemas.ts").JobsUnavailable;
|
|
61
|
+
}, never, never, import("effect/Effect").Effect<import("@shivaedev/jobs/server/health.ts").JobPage<import("./jobs/DeadLetter.ts").JobsDeadLetter>, import("@shivaedev/errors/taxonomy.ts").BadRequest | import("./jobs/schemas.ts").JobsPayloadInvalid | (import("./jobs/schemas.ts").JobsQueueUnregistered | import("./jobs/schemas.ts").JobsUnavailable), RegisteredQueues>>, import("@shivaedev/contract/servedOperation.ts").ServedQuery<"job", import("effect/Schema").Struct<{
|
|
62
|
+
id: import("effect/Schema").String;
|
|
63
|
+
queue: import("effect/Schema").String;
|
|
64
|
+
}>, import("effect/Schema").Option<typeof import("./jobs/Row.ts").JobsRow>, {
|
|
65
|
+
readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
|
|
66
|
+
readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
|
|
67
|
+
readonly JobsPayloadInvalid: typeof import("./jobs/schemas.ts").JobsPayloadInvalid;
|
|
68
|
+
readonly JobsQueueUnregistered: typeof import("./jobs/schemas.ts").JobsQueueUnregistered;
|
|
69
|
+
readonly JobsUnavailable: typeof import("./jobs/schemas.ts").JobsUnavailable;
|
|
70
|
+
}, never, never, import("effect/Effect").Effect<import("effect/Option").Option<import("./jobs/Row.ts").JobsRow>, import("./jobs/schemas.ts").JobsPayloadInvalid | (import("./jobs/schemas.ts").JobsQueueUnregistered | import("./jobs/schemas.ts").JobsUnavailable), RegisteredQueues>>] & readonly import("@shivaedev/contract/defineModule.ts").ModuleOperation[], readonly [typeof RegisteredQueues], typeof JobsPermission, undefined, undefined>;
|
|
71
|
+
//# sourceMappingURL=Jobs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jobs.d.ts","sourceRoot":"","sources":["../src/Jobs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qbAMf,CAAC"}
|
package/dist/Jobs.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineModule } from "@shivaedev/contract/defineModule.ts";
|
|
2
|
+
import { adminJobsWire } from "#generated/Jobs.ts";
|
|
3
|
+
import { JobsPermission } from "#permissions.ts";
|
|
4
|
+
import { Counts, DeadLettered, Detail, Failed, Health } from "#server/jobsReads.ts";
|
|
5
|
+
import { RegisteredQueues } from "#server/RegisteredQueues.ts";
|
|
6
|
+
export const Jobs = defineModule({
|
|
7
|
+
middleware: JobsPermission,
|
|
8
|
+
name: "admin.jobs",
|
|
9
|
+
operations: [Health, Counts, Failed, DeadLettered, Detail],
|
|
10
|
+
requires: [RegisteredQueues],
|
|
11
|
+
wire: adminJobsWire,
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=Jobs.js.map
|
package/dist/Jobs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Jobs.js","sourceRoot":"","sources":["../src/Jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,CAAC,MAAM,IAAI,GAAG,YAAY,CAAC;IAChC,UAAU,EAAE,cAAc;IAC1B,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC;IAC1D,QAAQ,EAAE,CAAC,gBAAgB,CAAC;IAC5B,IAAI,EAAE,aAAa;CACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { SessionUser } from "@shivaedev/identity/identity.ts";
|
|
3
|
+
import { JobsPermission } from "#permissions.ts";
|
|
4
|
+
import { RegisteredQueues } from "#server/RegisteredQueues.ts";
|
|
5
|
+
export declare const JobsWithRetry: import("@shivaedev/contract/defineModule.ts").Module<"admin.jobs", readonly [import("@shivaedev/contract/servedOperation.ts").ServedQuery<"health", Schema.Void, Schema.Struct<{
|
|
6
|
+
readonly activeTotal: Schema.Number;
|
|
7
|
+
readonly deadLetteredTotal: Schema.Number;
|
|
8
|
+
readonly failedTotal: Schema.Number;
|
|
9
|
+
readonly jobs: Schema.$Array<Schema.Struct<{
|
|
10
|
+
readonly activeCount: Schema.Number;
|
|
11
|
+
readonly deadLetteredCount: Schema.Number;
|
|
12
|
+
readonly failedCount: Schema.Number;
|
|
13
|
+
readonly name: Schema.String;
|
|
14
|
+
readonly queuedCount: Schema.Number;
|
|
15
|
+
readonly readyCount: Schema.Number;
|
|
16
|
+
}>>;
|
|
17
|
+
readonly queuedTotal: Schema.Number;
|
|
18
|
+
readonly readyTotal: Schema.Number;
|
|
19
|
+
}>, {
|
|
20
|
+
readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
|
|
21
|
+
readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
|
|
22
|
+
readonly JobsUnavailable: typeof import("./jobs/schemas.ts").JobsUnavailable;
|
|
23
|
+
}, never, never, import("effect/Effect").Effect<import("@shivaedev/jobs/server/health.ts").JobsHealth, import("./jobs/schemas.ts").JobsUnavailable, RegisteredQueues>>, import("@shivaedev/contract/servedOperation.ts").ServedQuery<"counts", Schema.Struct<{
|
|
24
|
+
queue: Schema.String;
|
|
25
|
+
}>, Schema.Struct<{
|
|
26
|
+
readonly activeCount: Schema.Number;
|
|
27
|
+
readonly failedCount: Schema.Number;
|
|
28
|
+
readonly queuedCount: Schema.Number;
|
|
29
|
+
readonly totalCount: Schema.Number;
|
|
30
|
+
}>, {
|
|
31
|
+
readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
|
|
32
|
+
readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
|
|
33
|
+
readonly JobsQueueUnregistered: typeof import("./jobs/schemas.ts").JobsQueueUnregistered;
|
|
34
|
+
readonly JobsUnavailable: typeof import("./jobs/schemas.ts").JobsUnavailable;
|
|
35
|
+
}, never, never, import("effect/Effect").Effect<import("@shivaedev/jobs/server/health.ts").QueueCounts, import("./jobs/schemas.ts").JobsQueueUnregistered | import("./jobs/schemas.ts").JobsUnavailable, RegisteredQueues>>, import("@shivaedev/contract/servedOperation.ts").ServedQuery<"failed", Schema.Struct<{
|
|
36
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
37
|
+
limit: Schema.Number;
|
|
38
|
+
queue: Schema.String;
|
|
39
|
+
}>, Schema.Struct<{
|
|
40
|
+
readonly jobs: Schema.$Array<typeof import("./jobs/Row.ts").JobsRow>;
|
|
41
|
+
readonly next: Schema.Option<Schema.String>;
|
|
42
|
+
}>, {
|
|
43
|
+
readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
|
|
44
|
+
readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
|
|
45
|
+
readonly BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
|
|
46
|
+
readonly JobsPayloadInvalid: typeof import("./jobs/schemas.ts").JobsPayloadInvalid;
|
|
47
|
+
readonly JobsQueueUnregistered: typeof import("./jobs/schemas.ts").JobsQueueUnregistered;
|
|
48
|
+
readonly JobsUnavailable: typeof import("./jobs/schemas.ts").JobsUnavailable;
|
|
49
|
+
}, never, never, import("effect/Effect").Effect<import("@shivaedev/jobs/server/health.ts").JobPage<import("./jobs/Row.ts").JobsRow>, import("@shivaedev/errors/taxonomy.ts").BadRequest | import("./jobs/schemas.ts").JobsPayloadInvalid | (import("./jobs/schemas.ts").JobsQueueUnregistered | import("./jobs/schemas.ts").JobsUnavailable), RegisteredQueues>>, import("@shivaedev/contract/servedOperation.ts").ServedQuery<"deadLettered", Schema.Struct<{
|
|
50
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
51
|
+
limit: Schema.Number;
|
|
52
|
+
queue: Schema.String;
|
|
53
|
+
}>, Schema.Struct<{
|
|
54
|
+
readonly jobs: Schema.$Array<typeof import("./jobs/DeadLetter.ts").JobsDeadLetter>;
|
|
55
|
+
readonly next: Schema.Option<Schema.String>;
|
|
56
|
+
}>, {
|
|
57
|
+
readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
|
|
58
|
+
readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
|
|
59
|
+
readonly BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
|
|
60
|
+
readonly JobsPayloadInvalid: typeof import("./jobs/schemas.ts").JobsPayloadInvalid;
|
|
61
|
+
readonly JobsQueueUnregistered: typeof import("./jobs/schemas.ts").JobsQueueUnregistered;
|
|
62
|
+
readonly JobsUnavailable: typeof import("./jobs/schemas.ts").JobsUnavailable;
|
|
63
|
+
}, never, never, import("effect/Effect").Effect<import("@shivaedev/jobs/server/health.ts").JobPage<import("./jobs/DeadLetter.ts").JobsDeadLetter>, import("@shivaedev/errors/taxonomy.ts").BadRequest | import("./jobs/schemas.ts").JobsPayloadInvalid | (import("./jobs/schemas.ts").JobsQueueUnregistered | import("./jobs/schemas.ts").JobsUnavailable), RegisteredQueues>>, import("@shivaedev/contract/servedOperation.ts").ServedQuery<"job", Schema.Struct<{
|
|
64
|
+
id: Schema.String;
|
|
65
|
+
queue: Schema.String;
|
|
66
|
+
}>, Schema.Option<typeof import("./jobs/Row.ts").JobsRow>, {
|
|
67
|
+
readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
|
|
68
|
+
readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
|
|
69
|
+
readonly JobsPayloadInvalid: typeof import("./jobs/schemas.ts").JobsPayloadInvalid;
|
|
70
|
+
readonly JobsQueueUnregistered: typeof import("./jobs/schemas.ts").JobsQueueUnregistered;
|
|
71
|
+
readonly JobsUnavailable: typeof import("./jobs/schemas.ts").JobsUnavailable;
|
|
72
|
+
}, never, never, import("effect/Effect").Effect<import("effect/Option").Option<import("./jobs/Row.ts").JobsRow>, import("./jobs/schemas.ts").JobsPayloadInvalid | (import("./jobs/schemas.ts").JobsQueueUnregistered | import("./jobs/schemas.ts").JobsUnavailable), RegisteredQueues>>, import("@shivaedev/contract/servedOperation.ts").ServedCommand<"retry", Schema.Struct<{
|
|
73
|
+
id: Schema.String;
|
|
74
|
+
queue: Schema.String;
|
|
75
|
+
}>, Schema.Void, {
|
|
76
|
+
readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
|
|
77
|
+
readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
|
|
78
|
+
readonly Forbidden: typeof import("@shivaedev/errors/taxonomy.ts").Forbidden;
|
|
79
|
+
readonly JobsNotFailed: typeof import("./jobs/NotFailed.ts").JobsNotFailed;
|
|
80
|
+
readonly JobsPayloadInvalid: typeof import("./jobs/schemas.ts").JobsPayloadInvalid;
|
|
81
|
+
readonly JobsQueueUnregistered: typeof import("./jobs/schemas.ts").JobsQueueUnregistered;
|
|
82
|
+
readonly JobsUnavailable: typeof import("./jobs/schemas.ts").JobsUnavailable;
|
|
83
|
+
}, import("effect/Effect").Effect<void, import("@shivaedev/errors/taxonomy.ts").Forbidden | import("./jobs/NotFailed.ts").JobsNotFailed | import("./jobs/schemas.ts").JobsPayloadInvalid | (import("./jobs/schemas.ts").JobsQueueUnregistered | import("./jobs/schemas.ts").JobsUnavailable), RegisteredQueues | SessionUser>>, import("@shivaedev/contract/servedOperation.ts").ServedCommand<"runScheduleNow", Schema.Struct<{
|
|
84
|
+
queue: Schema.String;
|
|
85
|
+
}>, Schema.Option<Schema.String>, {
|
|
86
|
+
readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
|
|
87
|
+
readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
|
|
88
|
+
readonly Forbidden: typeof import("@shivaedev/errors/taxonomy.ts").Forbidden;
|
|
89
|
+
readonly JobsQueueUnregistered: typeof import("./jobs/schemas.ts").JobsQueueUnregistered;
|
|
90
|
+
readonly JobsUnavailable: typeof import("./jobs/schemas.ts").JobsUnavailable;
|
|
91
|
+
}, import("effect/Effect").Effect<import("effect/Option").Option<string>, import("@shivaedev/errors/taxonomy.ts").Forbidden | (import("./jobs/schemas.ts").JobsQueueUnregistered | import("./jobs/schemas.ts").JobsUnavailable), RegisteredQueues | SessionUser>>] & readonly import("@shivaedev/contract/defineModule.ts").ModuleOperation[], readonly [typeof RegisteredQueues], typeof JobsPermission, undefined, undefined>;
|
|
92
|
+
//# sourceMappingURL=JobsWithRetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JobsWithRetry.d.ts","sourceRoot":"","sources":["../src/JobsWithRetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAa,MAAM,iBAAiB,CAAC;AAE5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AA0B/D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+ZAMxB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { requirePermission } from "@shivaedev/access/requirePermission.ts";
|
|
3
|
+
import { defineModule } from "@shivaedev/contract/defineModule.ts";
|
|
4
|
+
import { command } from "@shivaedev/contract/operation.ts";
|
|
5
|
+
import { SessionUser } from "@shivaedev/identity/identity.ts";
|
|
6
|
+
import { adminJobsWire } from "#generated/JobsWithRetry.ts";
|
|
7
|
+
import { jobsKeys } from "#jobs/keys.ts";
|
|
8
|
+
import { JobsPermission, RetryJobs } from "#permissions.ts";
|
|
9
|
+
import { Counts, DeadLettered, Detail, Failed, Health } from "#server/jobsReads.ts";
|
|
10
|
+
import { RegisteredQueues } from "#server/RegisteredQueues.ts";
|
|
11
|
+
const Retry = command("retry", {
|
|
12
|
+
invalidates: ({ queue, id }) => [
|
|
13
|
+
jobsKeys.health.list,
|
|
14
|
+
jobsKeys.counts.item(queue),
|
|
15
|
+
jobsKeys.failed.item(queue),
|
|
16
|
+
jobsKeys.deadLettered.item(queue),
|
|
17
|
+
jobsKeys.job(queue).item(id),
|
|
18
|
+
],
|
|
19
|
+
payload: { id: Schema.String, queue: Schema.String },
|
|
20
|
+
*run({ id, queue }) {
|
|
21
|
+
yield* requirePermission(yield* SessionUser, RetryJobs);
|
|
22
|
+
yield* (yield* RegisteredQueues).retry(queue, id);
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
const RunScheduleNow = command("runScheduleNow", {
|
|
26
|
+
invalidates: ({ queue }) => [jobsKeys.health.list, jobsKeys.counts.item(queue), jobsKeys.failed.item(queue), jobsKeys.deadLettered.item(queue)],
|
|
27
|
+
payload: { queue: Schema.String },
|
|
28
|
+
*run({ queue }) {
|
|
29
|
+
yield* requirePermission(yield* SessionUser, RetryJobs);
|
|
30
|
+
return yield* (yield* RegisteredQueues).runScheduleNow(queue);
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
export const JobsWithRetry = defineModule({
|
|
34
|
+
middleware: JobsPermission,
|
|
35
|
+
name: "admin.jobs",
|
|
36
|
+
operations: [Health, Counts, Failed, DeadLettered, Detail, Retry, RunScheduleNow],
|
|
37
|
+
requires: [RegisteredQueues],
|
|
38
|
+
wire: adminJobsWire,
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=JobsWithRetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"JobsWithRetry.js","sourceRoot":"","sources":["../src/JobsWithRetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,EAAE;IAC9B,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;QAC/B,QAAQ,CAAC,MAAM,CAAC,IAAI;QACpB,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;QAC3B,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;QAC3B,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;QACjC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;KAC5B;IACD,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;IACpD,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE;QACjB,KAAK,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QACxD,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACnD,CAAC;CACD,CAAC,CAAC;AAEH,MAAM,cAAc,GAAG,OAAO,CAAC,gBAAgB,EAAE;IAChD,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/I,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;IACjC,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE;QACb,KAAK,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QACxD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC/D,CAAC;CACD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAC;IACzC,UAAU,EAAE,cAAc;IAC1B,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC;IACjF,QAAQ,EAAE,CAAC,gBAAgB,CAAC;IAC5B,IAAI,EAAE,aAAa;CACnB,CAAC,CAAC"}
|