@shivaedev/admin 0.12.1 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,247 @@
1
+ # Changelog
2
+
3
+ ## 0.12.2 - 2026-10-31
4
+
5
+ ### Fixed
6
+
7
+ - Include `CHANGELOG.md` in published package contents so release notes are available in `node_modules`.
8
+ - Release checks reject published package `files` lists that omit `CHANGELOG.md`, naming the package and how to include it.
9
+ - Server RPC failures, request diagnostics and traces use the sensitive keys from their own RPC schemas, so registering another RPC cannot redact their public failure tags or messages.
10
+ - Admin Jobs schemas mark job payload and failure-detail containers sensitive without marking generic `_tag` or `message` fields sensitive.
11
+
12
+ ## 0.12.1 - 2026-10-30
13
+
14
+ ### Changed
15
+
16
+ - Release with updated workspace dependencies.
17
+
18
+ ## 0.12.0 - 2026-10-30
19
+
20
+ ### Added
21
+
22
+ - Access exports `AssignRoles` and `LastRoleAssigner` from `@shivaedev/access/roles.ts` for shared role policy declarations.
23
+ - Identity provides `assignRole(access, userId, role)` for trusted seeds and operator commands. Supply `SqlClient` and `Reactivity`; it returns whether storage changed and uses the Users page's PostgreSQL lock, last-role-assigner guard and commit invalidation.
24
+
25
+ ### Breaking
26
+
27
+ - Identity mounts with `roles` close Better Auth's `/admin/set-role`, `/admin/update-user` and `/admin/create-user` HTTP endpoints and set its admin plugin's `adminRoles` to `[]`. Remove that setup from applications. Use the admin Users page for authorized requests and identity's `assignRole` for trusted server commands.
28
+ - Admin consumers import `AssignRoles` and `LastRoleAssigner` from `@shivaedev/access/roles.ts` instead of `@shivaedev/admin/permissions.ts` and `@shivaedev/admin/users/roles.ts`. The Users page uses identity's shared assignment operation; its permission checks, typed refusal and audit log remain.
29
+
30
+ ## 0.11.2 - 2026-10-30
31
+
32
+ ### Changed
33
+
34
+ - Release with updated workspace dependencies.
35
+
36
+ ## 0.11.1 - 2026-10-30
37
+
38
+ ### Fixed
39
+
40
+ - Stack UsersView users as labelled cards below 640px so role controls fit on phone screens, while retaining the desktop table.
41
+
42
+ ## 0.11.0 - 2026-10-30
43
+
44
+ ### Fixed
45
+
46
+ - Live reads and change subscriptions preserve policy failures instead of reporting read denial. Generated starter apps report notes database connection failures as `ServiceUnavailable` during the owner's live read.
47
+
48
+ ### Breaking
49
+
50
+ - Query read policies declare their error and service channels with `QueryReadPolicy<Payload, E, R>`. Declare policy errors in the query's `rejections` and provide policy services when building its handler Layer. Custom subscription adapters call `querySubscription(rpc, references, viewer)` instead of resolving requests themselves. Use the native RPC type when calling `authorizeReads` or `resolveChanges` so their inferred channels include policy requirements and errors. The generated change stream includes the queries' declared rejections and service requirements; consumers handling that stream must handle those errors too.
51
+ - Admin pages install their permission's read policy for every query, preserving additional query restrictions. Remove repeated page-grant policies from individual queries and supply the page's permission middleware with the handler Layers.
52
+
53
+ ## 0.10.2 - 2026-10-30
54
+
55
+ ### Changed
56
+
57
+ - Release with updated workspace dependencies.
58
+
59
+ ## 0.10.1 - 2026-10-30
60
+
61
+ ### Changed
62
+
63
+ - Release with updated workspace dependencies.
64
+
65
+ ## 0.10.0 - 2026-10-30
66
+
67
+ ### Added
68
+
69
+ - Access exports the `Permission` Schema and derives its type from it. Role resolution and identity session decoding use that Schema.
70
+ - Access exports `forbidden(permission)` and `unauthorized()` from `refusal.ts` for consistent permission refusals.
71
+ - Jobs services share one scoped pg-boss client through the Effect environment. Registration, worker and producer Layers use the same connection and pool settings.
72
+ - Service definitions accept marked generic methods alongside declared dependencies. Generic signatures retain their caller requirements unchanged; initialization can capture declared dependencies as private state.
73
+
74
+ ### Changed
75
+
76
+ - User reads validate rows with `SqlSchema` using the shared `AppUser` fields. User operation spans are named `Admin.listUsers` and `Admin.changeUserRole`; adjust trace filters that used the `Platform` names.
77
+
78
+ ### Fixed
79
+
80
+ - Retry wake-up reads run within the worker scope and log redacted failures without failing other jobs in the batch or spending their retries.
81
+ - Default pg-boss client error logs redact secrets in messages through `@shivaedev/errors`.
82
+
83
+ ### Breaking
84
+
85
+ - Retrying failed jobs now requires `RetryJobs` (`jobs.retry`) in addition to `ReadJobs` (`jobs.read`). Add `RetryJobs` from `@shivaedev/admin/permissions.ts` to application roles that should keep retrying jobs; roles with only `ReadJobs` can still inspect jobs but receive `Forbidden` when retrying.
86
+ - `AppUser` now decodes PostgreSQL `Date` timestamps into UTC `DateTime` values. Direct Schema callers must pass a `Date` for `createdAt`; use `Schema.toCodecJson(AppUser)` when decoding or encoding JSON timestamps. Native RPC keeps ISO strings on the wire and UTC `DateTime` values for callers.
87
+ - Jobs handler failures persist only `JobFailure` (`_tag` and a redacted `message`); failed and dead-letter listings and admin job responses expose that shape or `null`. Consumers can import the shared `JobFailure` Schema from `@shivaedev/jobs/JobFailure.ts` and must read these fields instead of arbitrary error properties, stacks or causes. Older and native pg-boss failures without a tag decode with `_tag: "Error"`, and their messages are redacted when read; outputs without a string message fail decoding.
88
+ - Jobs listings reject invalid page limits and cursors with `SchemaError`; consumers must handle it alongside `PgBossError` and `PgBossPayloadError`. Admin listings report these inputs as `BadRequest`; clients must handle that rejection instead of `JobsUnavailable`.
89
+ - Access, identity and React now share access's grant evaluator: an `any` grant covers an `own` check for the same permission name. An `own` grant still cannot cover an `any` check. Applications that need separate capabilities must declare separate permission names; record ownership checks still belong in `canAccess` or `requireAccess`.
90
+ - Replace `Access.requirePermission(user, permission)` with `requirePermission(yield* Access.resolve(user.role), permission)` from `@shivaedev/access/requirePermission.ts`. The new function takes a signed-in user; reject an absent session with `unauthorized()` from `@shivaedev/access/refusal.ts` before resolving its role. `requireAccess` continues to handle signed-out users itself.
91
+ - Replace identity's `requirePermission(permission)` with access's `requirePermission(yield* SessionUser, permission)`. There is no identity re-export. Admin's built-in handlers use this shared enforcement.
92
+ - Access's `requireAccess` now uses the shared permission refusal message, `Permission required: <name> (<strength>)`, instead of `Access denied: <name>`. Consumers should branch on the `Forbidden` tag.
93
+ - Move connection, pool, client factory, cache key and stop options from each `Jobs.layer` call into one `pgBossLayer` from `@shivaedev/jobs/server/service.ts`. Supply `connectionString` as `Redacted<string>` and provide that Layer to the merged jobs services. Keep only `jobs` and `onError` in `Jobs.layer`.
94
+ - Call `jobs.health()` instead of yielding `jobs.health`. Custom jobs service implementations must expose health as a method. Admin's built-in jobs handlers call the method automatically. Jobs services passed to webhook routes and enqueue helpers must also implement the new method shape.
95
+ - Identity treats an undeclared stored user role as a defect naming the role, rather than `AuthUnavailable`. RPC request tracing logs the defect and Better Auth's session endpoint returns HTTP 500. Consumers must correct the user's stored role or restore its application declaration; reserve `AuthUnavailable` handling for provider outages.
96
+ - Admin role assignment trusts its typed role input and leaves session role resolution to identity. RPC consumers need no change: the contract decodes the role. Direct callers of `changeUserRole` must decode untrusted role input with the application's `Role` schema before calling it.
97
+
98
+ ## 0.9.0 - 2026-10-30
99
+
100
+ ### Changed
101
+
102
+ - Require Effect 4.0.6 and align the Effect companion package peers and generated starter catalog to the same exact release. Install the 4.0.6 Effect stack together.
103
+
104
+ ### Fixed
105
+
106
+ - Register hosted RPC cache-control handling through Effect 4.0.6's request-scoped pre-response API so responses keep `private, no-store`.
107
+ - Accept native RPC's `application/x-ndjson` media type while preserving `application/ndjson` callers at the transport guard.
108
+ - Keep subscriptions open after their HTTP request body completes; closing the socket still cancels them.
109
+
110
+ ### Breaking
111
+
112
+ - `@shivaedev/admin`: Move page declarations and `registerAdmin` handler maps into their owning modules. Combine their registries with `mergeAdminRegistries` in browser composition and their registrations with `mergeAdminRegistrations` in the application host. Registration now exposes its pages; duplicate page ids are rejected by TypeScript as well as at runtime. Keep each module's handler Layer with its page registration.
113
+ - `@shivaedev/create-app`: The starter foundation owns Users and Jobs, and notes registers only its statistics page. Move application pages and handlers into their owning module registrations and combine them at the host; client modules contribute navigation through their own registry. Run `create-app update` to merge the starter side, preserving application customizations through its normal merge flow. Minimal apps retain Users and Jobs when notes is removed.
114
+
115
+ ## 0.8.2 - 2026-10-29
116
+
117
+ ### Changed
118
+
119
+ - Release with updated workspace dependencies.
120
+
121
+ ## 0.8.1 - 2026-10-29
122
+
123
+ ### Changed
124
+
125
+ - Release with updated workspace dependencies.
126
+
127
+ ## 0.8.0 - 2026-10-28
128
+
129
+ ### Added
130
+
131
+ - Register schedule definitions beside queues on the admin Jobs page, with null payloads in failed runs, dead-letter listings and job lookups. Pages with no queues can register handlers and serve health.
132
+ - Read stored jobs with null payload schemas through the jobs service without changing queue payload validation.
133
+ - Show an empty state in the starter Jobs view when no queues or schedules are registered.
134
+
135
+ ### Fixed
136
+
137
+ - Enforce declared query read policies at the hosted RPC handler boundary, including contracts without identity middleware, whose viewer is anonymous. Query RPC error schemas include `QueryReadDenied` so native clients receive typed refusals before handlers run.
138
+ - Keep collection methods and untyped schema internals from making data parameters appear to carry callable services. Direct service implementations, nested dependency fields and service arrays remain subject to `effect/service-parameters`.
139
+
140
+ ### Breaking
141
+
142
+ - Move key imports from `@shivaedev/contract/keys.ts` to `@shivaedev/changes/keys.ts`. Declare bucket fields with `collection(name, idSchema, fields)` and publish affected buckets alongside record keys.
143
+ - Replace collection policy maps, `mergeReadPolicies`, `ReadPolicy` and `ReadPolicyMemoWindow` with each query's `readPolicy(payload, viewer)`. Declare the same query's live scope with `reads(payload, viewer)`. Bound query atoms and subscriptions refuse missing policies with a declaration error; one-off query `run` calls remain available. Denied queries refuse the entire subscription. Server adapters replace `QueryReads` and `ChangesReads` with `QueryDefinition` and `ChangesQueries`. Custom middleware calls `authorizeReads(effect, request, viewer)` and declares `MissingReadPolicy` and `QueryReadDenied` errors.
144
+ - Custom subscription adapters yield `ChangesQueries.resolve(references)`, call `querySubscription(requests, viewer)` and pass the authorized result to `makeLiveServer.subscribe(subscription, context)`. Metadata values expose `QueryDefinition.definition` and `CommandInvalidation.invalidates` instead of bare definitions and callbacks. Yield the Effect returned by `queryKeys(queries, references)` when projecting keys for a custom stream. `resolveChanges` supplies the authorized subscription in hosted applications. Changed hints can carry query positions so bindings can rerun session-scoped reads without deriving session scopes in the browser.
145
+ - Remove `appHost`'s `readPolicy` option and module policy registration. Session and permission middleware apply query policies using the current session viewer. Handle the new typed policy errors in native clients, including `QueryReadDenied` on query RPCs without identity middleware; widen explicit query error annotations accordingly.
146
+ - Replace `sessionCommandChanges` with `commandChanges` for custom session middleware. Command invalidation callbacks can receive the session viewer as their third argument. Announce viewer buckets there; background writers must explicitly publish those bucket keys after commit.
147
+ - Built-in admin queries declare their permission policies alongside their schemas and read scopes. Consumers keep supplying the existing session and permission middleware layers.
148
+ - Local Work Board and Fleet queries declare their existing loopback read access explicitly so their generated live subscriptions remain available.
149
+
150
+ ## 0.7.0 - 2026-10-27
151
+
152
+ ### Added
153
+
154
+ - Admin pages declare domain permissions shared by RPC middleware and client route metadata. Generated apps declare one role per file, with explicit grants and one permission fallback page.
155
+ - Users with `roles.assign` assign a user's single role from the application's declared role set. Role changes cannot remove the final holder of that permission.
156
+
157
+ ### Breaking
158
+
159
+ - Replace `OpenAdmin` and `AdminPermission` with each page's domain permission: `ReadUsers`/`UsersPermission` or `ReadJobs`/`JobsPermission`. Custom `adminPage` declarations must pass their own `permissionMiddleware` as `permission`; provide its `permissionLayer` at the server host and use `page.route.permission` with React's `permissionGuard` and `PermissionBoundary`.
160
+ - Replace the `UsersPage` singleton with `usersPage(AppAccess)` and register `usersHandlers(UsersPage, AppAccess)`. Pass `roles={AppAccess.Role.literals}` to `UsersView`. Server callers pass `AppAccess` first to `listUsers` and `changeUserRole`.
161
+ - Replace `ChangeUserRoles` with `AssignRoles` (`roles.assign`), and handle `LastRoleAssigner` instead of `LastOwner`. User results contain `role` instead of `roles`; `changeRole` takes `{ userId, role }` without `grant`. The fixed `UserRole` Schema is removed; use `AppAccess.Role`.
162
+ - Existing generated apps must migrate stored comma-separated roles to one declared role string before running the new app. Preserve every final role assigner's access during that data migration. Run the create-app updater to merge the starter's new role files, imports, server permission Layers and client permission boundary; resolve customized wiring conflicts and install dependencies. The updater does not migrate database values. Bootstrap now creates one `owner` role, whose explicit grants include access to all admin pages.
163
+
164
+ ## 0.6.0 - 2026-10-27
165
+
166
+ ### Added
167
+
168
+ - Own the app-user modules that lived in Platform: `users/roles.ts` holds the `user`, `admin` and `owner` roles, the browser-safe user schemas, `ChangeUserRoles` and `LastOwner`, and `server/users.ts` holds `listUsers` and `changeUserRole`.
169
+
170
+ ### Changed
171
+
172
+ - Depend on `@shivaedev/identity`, `@shivaedev/errors`, `@shivaedev/access`, `@shivaedev/contract` and `@shivaedev/sql` instead of `@shivaedev/platform`.
173
+
174
+ ## 0.5.0 - 2026-10-26
175
+
176
+ ### Added
177
+
178
+ - Access role sets resolve stored role strings into their decoded role and declared permissions.
179
+ - Platform resolves application roles per request, exposes grants to handlers and the client session, and enforces declared permissions on RPCs and HTTP routes.
180
+
181
+ ### Breaking
182
+
183
+ - Platform removes `requireAdmin`, `hasRole`, `AuthenticatedAdmin`, `AuthenticatedOwner`, their Layers, and `adminRoute`. Declare roles and permissions with `@shivaedev/access`, pass the role set once in `betterAuthMount(options, { roles })` and reuse its returned `sessions`, or configure `sessions.roles` for another provider. Replace role middleware with a class extending `permissionMiddleware<Self>()(id, permission)`, provide `permissionLayer(Middleware, sessions)`, and use `permissionRoute(sessions, permission)` for HTTP routes. Read `SessionUser.permissions` or the client session's `user.permissions` with `hasPermission`; use the application's access policy for record ownership. Unknown stored roles fail visibly and must be migrated to declared strings.
184
+ - Admin pages require `AdminPermission` from `@shivaedev/admin/permissions.ts`. Grant its `OpenAdmin` permission to the application's operator roles and provide `permissionLayer(AdminPermission, sessions)`. User role writes and controls require Platform's `ChangeUserRoles` permission. The existing admin role-list editor and last-owner invariant retain their storage format; declare its stored combinations in the application role set until migrating that editor.
185
+
186
+ ## 0.4.0 - 2026-10-26
187
+
188
+ ### Added
189
+
190
+ - Add the admin Users page, native RPC handlers and React view for paginated app users and owner-managed roles. Register `UsersPage` with `usersHandlers` beside Jobs and mount `UsersView` using its bound query and role action.
191
+ - Add Platform auth user listing and transactional role changes on the existing Better Auth PostgreSQL schema, with typed owner-only and last-owner failures, change invalidation and actor/timestamp logs.
192
+ - Mount Users in the starter and generated apps. Existing apps receive the wiring with `pnpm dlx @shivaedev/create-app@latest update` after these packages are released; review template conflicts and install dependencies. Newly bootstrapped administrators also hold the owner role.
193
+ - Provide the shared expected failure schemas and `rejectedField` in `@shivaedev/effect-contract/errors/`, so browser-safe contract consumers can use them without depending on Platform. Tags, schema fields and RPC encoding remain the same.
194
+
195
+ ### Breaking
196
+
197
+ - Move all imports from `@shivaedev/platform/errors/taxonomy.ts` to `@shivaedev/effect-contract/errors/taxonomy.ts`, and from `@shivaedev/platform/errors/rejectedField.ts` to `@shivaedev/effect-contract/errors/rejectedField.ts`. The old modules are removed. Add a direct `@shivaedev/effect-contract` dependency if the consuming package does not already declare one. Admin, GitHub, Work Board and Work Fleet public failure types now refer to these shared classes.
198
+ - Generated apps use the new imports. The create-app updater applies the starter changes through its usual three-way patch; it does not rewrite imports in app-owned files. Replace both old import paths above in those files when upgrading existing apps.
199
+
200
+ ## 0.3.0 - 2026-10-25
201
+
202
+ ### Added
203
+
204
+ - Add an explicitly retry-enabled Jobs page and handlers for registered failed originals, with administrator-only RPC access and query invalidation after retry.
205
+
206
+ ## 0.2.0 - 2026-10-25
207
+
208
+ ### Added
209
+
210
+ - `@shivaedev/admin` provides a query-only Jobs page with explicitly registered queues, payload codecs, health, counts, paginated failed and dead-lettered jobs, and job lookup through the protected admin RPC group. Jobs failures remain declared and do not prevent other pages from serving requests.
211
+ - `@shivaedev/effect-pg-boss` job reads accept a queue's name and payload Schema without requiring its worker configuration.
212
+
213
+ ## 0.1.5 - 2026-10-25
214
+
215
+ ### Changed
216
+
217
+ - Release with updated workspace dependencies.
218
+
219
+ ## 0.1.4 - 2026-10-25
220
+
221
+ ### Changed
222
+
223
+ - Release with updated workspace dependencies.
224
+
225
+ ## 0.1.3 - 2026-10-25
226
+
227
+ ### Changed
228
+
229
+ - Release with updated workspace dependencies.
230
+
231
+ ## 0.1.2 - 2026-10-25
232
+
233
+ ### Changed
234
+
235
+ - Release with updated workspace dependencies.
236
+
237
+ ## 0.1.1 - 2026-10-25
238
+
239
+ ### Changed
240
+
241
+ - Release with updated workspace dependencies.
242
+
243
+ ## 0.1.0 - 2026-10-25
244
+
245
+ ### Added
246
+
247
+ - Declare admin pages with native Effect contracts protected by `AuthenticatedAdmin`, including generated change subscriptions. Merge pages into one registry with unique ids, paths and RPC tags, and register one typed handler Layer per page for the existing RPC host.
@@ -58,7 +58,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
58
58
  readonly retryLimit: Schema.Number;
59
59
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
60
60
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
61
- readonly data: JobsPayload<TQueues[number]>;
61
+ readonly data: JobsPayload<TQueues[number]>["Rebuild"];
62
62
  readonly queue: Schema.Literal<string>;
63
63
  }>[]>>;
64
64
  readonly next: Schema.OptionFromNullOr<Schema.String>;
@@ -91,7 +91,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
91
91
  readonly retryLimit: Schema.Number;
92
92
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
93
93
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
94
- readonly data: JobsPayload<TQueues[number]>;
94
+ readonly data: JobsPayload<TQueues[number]>["Rebuild"];
95
95
  readonly queue: Schema.Literal<string>;
96
96
  readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
97
97
  readonly sourceOutput: Schema.NullOr<Schema.Struct<{
@@ -127,7 +127,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
127
127
  readonly retryLimit: Schema.Number;
128
128
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
129
129
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
130
- readonly data: JobsPayload<TQueues[number]>;
130
+ readonly data: JobsPayload<TQueues[number]>["Rebuild"];
131
131
  readonly queue: Schema.Literal<string>;
132
132
  }>[]>>, {
133
133
  BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
@@ -212,7 +212,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
212
212
  readonly retryLimit: Schema.Number;
213
213
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
214
214
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
215
- readonly data: JobsPayload<TQueues[number]>;
215
+ readonly data: JobsPayload<TQueues[number]>["Rebuild"];
216
216
  readonly queue: Schema.Literal<string>;
217
217
  readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
218
218
  readonly sourceOutput: Schema.NullOr<Schema.Struct<{
@@ -239,7 +239,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
239
239
  readonly retryLimit: Schema.Number;
240
240
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
241
241
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
242
- readonly data: JobsPayload<TQueues[number]>;
242
+ readonly data: JobsPayload<TQueues[number]>["Rebuild"];
243
243
  readonly queue: Schema.Literal<string>;
244
244
  }>[]>>;
245
245
  readonly next: Schema.OptionFromNullOr<Schema.String>;
@@ -273,7 +273,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
273
273
  readonly retryLimit: Schema.Number;
274
274
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
275
275
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
276
- readonly data: JobsPayload<TQueues[number]>;
276
+ readonly data: JobsPayload<TQueues[number]>["Rebuild"];
277
277
  readonly queue: Schema.Literal<string>;
278
278
  }>[]>>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never>, readonly [], undefined>;
279
279
  } & {
@@ -71,7 +71,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
71
71
  readonly retryLimit: Schema.Number;
72
72
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
73
73
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
74
- readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>;
74
+ readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>["Rebuild"];
75
75
  readonly queue: Schema.Literal<string>;
76
76
  }>[]>>;
77
77
  readonly next: Schema.OptionFromNullOr<Schema.String>;
@@ -110,7 +110,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
110
110
  readonly retryLimit: Schema.Number;
111
111
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
112
112
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
113
- readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>;
113
+ readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>["Rebuild"];
114
114
  readonly queue: Schema.Literal<string>;
115
115
  readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
116
116
  readonly sourceOutput: Schema.NullOr<Schema.Struct<{
@@ -152,7 +152,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
152
152
  readonly retryLimit: Schema.Number;
153
153
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
154
154
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
155
- readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>;
155
+ readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>["Rebuild"];
156
156
  readonly queue: Schema.Literal<string>;
157
157
  }>[]>>, {
158
158
  BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
@@ -179,25 +179,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
179
179
  readonly JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
180
180
  readonly Forbidden: typeof Forbidden;
181
181
  readonly JobsNotFailed: typeof JobsNotFailed;
182
- }>>], import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
183
- id: Schema.String;
184
- queue: Schema.String;
185
- }>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
186
- readonly attempt: Schema.Number;
187
- readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
188
- readonly createdOn: Schema.DateTimeUtcFromString;
189
- readonly id: Schema.String;
190
- readonly output: Schema.NullOr<Schema.Struct<{
191
- readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
192
- readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
193
- }>>;
194
- readonly retryCount: Schema.Number;
195
- readonly retryLimit: Schema.Number;
196
- readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
197
- readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
198
- readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>;
199
- readonly queue: Schema.Literal<string>;
200
- }>[]>>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.$changes", Schema.Struct<{
182
+ }>>], import("effect/rpc/Rpc").Rpc<"admin.jobs.$changes", Schema.Struct<{
201
183
  queries: Schema.$Array<Schema.Union<readonly (Schema.Struct<{
202
184
  query: Schema.Literal<"counts">;
203
185
  payload: Schema.Struct<{
@@ -245,28 +227,17 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
245
227
  readonly queryIndexes: Schema.optional<Schema.$Array<Schema.Number>>;
246
228
  }>, Schema.Struct<{
247
229
  readonly _tag: Schema.Literal<"Resync">;
248
- }>]>, ...never[]]>, Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, ...Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>[]]>>, Schema.Never, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.counts", Schema.Struct<{
230
+ }>]>, ...never[]]>, Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, ...Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>[]]>>, Schema.Never, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.retry", Schema.Struct<{
231
+ id: Schema.String;
232
+ queue: Schema.String;
233
+ }>, Schema.Void, Schema.Union<readonly (typeof Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered | typeof JobsNotFailed)[]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.counts", Schema.Struct<{
249
234
  queue: Schema.String;
250
235
  }>, Schema.Struct<{
251
236
  readonly activeCount: Schema.Number;
252
237
  readonly failedCount: Schema.Number;
253
238
  readonly queuedCount: Schema.Number;
254
239
  readonly totalCount: Schema.Number;
255
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
256
- readonly activeTotal: Schema.Number;
257
- readonly deadLetteredTotal: Schema.Number;
258
- readonly failedTotal: Schema.Number;
259
- readonly jobs: Schema.$Array<Schema.Struct<{
260
- readonly activeCount: Schema.Number;
261
- readonly deadLetteredCount: Schema.Number;
262
- readonly failedCount: Schema.Number;
263
- readonly name: Schema.String;
264
- readonly queuedCount: Schema.Number;
265
- readonly readyCount: Schema.Number;
266
- }>>;
267
- readonly queuedTotal: Schema.Number;
268
- readonly readyTotal: Schema.Number;
269
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
240
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
270
241
  cursor: Schema.optionalKey<Schema.String>;
271
242
  limit: Schema.Number;
272
243
  queue: Schema.String;
@@ -284,11 +255,16 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
284
255
  readonly retryLimit: Schema.Number;
285
256
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
286
257
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
287
- readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>;
258
+ readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>["Rebuild"];
288
259
  readonly queue: Schema.Literal<string>;
260
+ readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
261
+ readonly sourceOutput: Schema.NullOr<Schema.Struct<{
262
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
263
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
264
+ }>>;
289
265
  }>[]>>;
290
266
  readonly next: Schema.OptionFromNullOr<Schema.String>;
291
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
267
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
292
268
  cursor: Schema.optionalKey<Schema.String>;
293
269
  limit: Schema.Number;
294
270
  queue: Schema.String;
@@ -306,19 +282,43 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
306
282
  readonly retryLimit: Schema.Number;
307
283
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
308
284
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
309
- readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>;
285
+ readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>["Rebuild"];
310
286
  readonly queue: Schema.Literal<string>;
311
- readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
312
- readonly sourceOutput: Schema.NullOr<Schema.Struct<{
313
- readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
314
- readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
315
- }>>;
316
287
  }>[]>>;
317
288
  readonly next: Schema.OptionFromNullOr<Schema.String>;
318
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.retry", Schema.Struct<{
289
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
290
+ readonly activeTotal: Schema.Number;
291
+ readonly deadLetteredTotal: Schema.Number;
292
+ readonly failedTotal: Schema.Number;
293
+ readonly jobs: Schema.$Array<Schema.Struct<{
294
+ readonly activeCount: Schema.Number;
295
+ readonly deadLetteredCount: Schema.Number;
296
+ readonly failedCount: Schema.Number;
297
+ readonly name: Schema.String;
298
+ readonly queuedCount: Schema.Number;
299
+ readonly readyCount: Schema.Number;
300
+ }>>;
301
+ readonly queuedTotal: Schema.Number;
302
+ readonly readyTotal: Schema.Number;
303
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
319
304
  id: Schema.String;
320
305
  queue: Schema.String;
321
- }>, Schema.Void, Schema.Union<readonly (typeof Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered | typeof JobsNotFailed)[]>, typeof JobsPermission, never>, readonly [], undefined>;
306
+ }>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
307
+ readonly attempt: Schema.Number;
308
+ readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
309
+ readonly createdOn: Schema.DateTimeUtcFromString;
310
+ readonly id: Schema.String;
311
+ readonly output: Schema.NullOr<Schema.Struct<{
312
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
313
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
314
+ }>>;
315
+ readonly retryCount: Schema.Number;
316
+ readonly retryLimit: Schema.Number;
317
+ readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
318
+ readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
319
+ readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>["Rebuild"];
320
+ readonly queue: Schema.Literal<string>;
321
+ }>[]>>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never>, readonly [], undefined>;
322
322
  } & {
323
323
  queues: TQueues;
324
324
  };
@@ -91,7 +91,7 @@ export declare function jobSchema<TPayload extends Schema.Top>(queue: {
91
91
  readonly retryLimit: Schema.Number;
92
92
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
93
93
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
94
- readonly data: TPayload;
94
+ readonly data: TPayload["Rebuild"];
95
95
  readonly queue: Schema.Literal<string>;
96
96
  }>;
97
97
  export declare function deadLetteredSchema<TPayload extends Schema.Top>(queue: {
@@ -110,7 +110,7 @@ export declare function deadLetteredSchema<TPayload extends Schema.Top>(queue: {
110
110
  readonly retryLimit: Schema.Number;
111
111
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
112
112
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
113
- readonly data: TPayload;
113
+ readonly data: TPayload["Rebuild"];
114
114
  readonly queue: Schema.Literal<string>;
115
115
  readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
116
116
  readonly sourceOutput: Schema.NullOr<Schema.Struct<{
@@ -41,7 +41,7 @@ export const JobFields = {
41
41
  completedOn: Schema.OptionFromNullOr(Schema.DateTimeUtcFromString),
42
42
  createdOn: Schema.DateTimeUtcFromString,
43
43
  id: Schema.String,
44
- output: Schema.NullOr(JobFailure),
44
+ output: Schema.NullOr(JobFailure).annotate({ sensitive: true }),
45
45
  retryCount: Schema.Number,
46
46
  retryLimit: Schema.Number,
47
47
  startedOn: Schema.OptionFromNullOr(Schema.DateTimeUtcFromString),
@@ -49,16 +49,16 @@ export const JobFields = {
49
49
  };
50
50
  export const PageFields = { cursor: Schema.optionalKey(Schema.String), limit: Schema.Number };
51
51
  export function jobSchema(queue) {
52
- return Schema.Struct({ ...JobFields, data: queue.schema, queue: Schema.Literal(queue.name) });
52
+ return Schema.Struct({ ...JobFields, data: queue.schema.annotate({ sensitive: true }), queue: Schema.Literal(queue.name) });
53
53
  }
54
54
  export function deadLetteredSchema(queue) {
55
55
  const name = `${queue.name}-dlq`;
56
56
  return Schema.Struct({
57
57
  ...JobFields,
58
- data: queue.schema,
58
+ data: queue.schema.annotate({ sensitive: true }),
59
59
  queue: Schema.Literal(name),
60
60
  sourceId: Schema.OptionFromNullOr(Schema.String),
61
- sourceOutput: Schema.NullOr(JobFailure),
61
+ sourceOutput: Schema.NullOr(JobFailure).annotate({ sensitive: true }),
62
62
  });
63
63
  }
64
64
  export function jobPage(job) {
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/jobs/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAO3D,MAAM,OAAO,eAAgB,SAAQ,MAAM,CAAC,WAAW,EAAmB,CAAC,iBAAiB,EAAE;IAC7F,SAAS,EAAE,MAAM,CAAC,MAAM;CACxB,CAAC;CAAG;AAEL,MAAM,OAAO,kBAAmB,SAAQ,MAAM,CAAC,WAAW,EAAsB,CAAC,oBAAoB,EAAE;IACtG,KAAK,EAAE,MAAM,CAAC,MAAM;CACpB,CAAC;CAAG;AAEL,MAAM,OAAO,qBAAsB,SAAQ,MAAM,CAAC,WAAW,EAAyB,CAAC,uBAAuB,EAAE;IA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AAS,CAA8B,KAA2D;IACjH,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC7H,CAAC;AAED,MAAM,UAAU,kBAAkB,CAA8B,KAA2D;IAC1H,MAAM,IAAI,GAAW,GAAG,KAAK,CAAC,IAAI,MAAM,CAAC;IACzC,OAAO,MAAM,CAAC,MAAM,CAAC;QACpB,GAAG,SAAS;QACZ,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAChD,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;QAC3B,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC;QAChD,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;KACrE,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,OAAO,CAA0B,GAAS;IACzD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACjG,CAAC"}
@@ -71,7 +71,10 @@ export declare function usersPage<const TRole extends string>(access: Pick<Acces
71
71
  readonly queryIndexes: Schema.optional<Schema.$Array<Schema.Number>>;
72
72
  }>, Schema.Struct<{
73
73
  readonly _tag: Schema.Literal<"Resync">;
74
- }>]>, ...never[]]>, Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, ...Schema.Union<readonly (typeof Forbidden | typeof AuthUnavailable)[]>[]]>>, Schema.Never, typeof UsersPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.users.list", Schema.Struct<{
74
+ }>]>, ...never[]]>, Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, ...Schema.Union<readonly (typeof Forbidden | typeof AuthUnavailable)[]>[]]>>, Schema.Never, typeof UsersPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.users.changeRole", Schema.Struct<{
75
+ role: Schema.Literals<TRole[]>;
76
+ userId: Schema.String;
77
+ }>, Schema.Void, Schema.Union<readonly (typeof NotFound | typeof Forbidden | typeof AuthUnavailable | typeof LastRoleAssigner)[]>, typeof UsersPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.users.list", Schema.Struct<{
75
78
  readonly cursor: Schema.optionalKey<Schema.String>;
76
79
  readonly limit: Schema.Number;
77
80
  }>, Schema.Struct<{
@@ -84,9 +87,6 @@ export declare function usersPage<const TRole extends string>(access: Pick<Acces
84
87
  readonly role: Schema.String;
85
88
  }>>;
86
89
  readonly canChangeRoles: Schema.Boolean;
87
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof Forbidden | typeof AuthUnavailable)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof UsersPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.users.changeRole", Schema.Struct<{
88
- role: Schema.Literals<TRole[]>;
89
- userId: Schema.String;
90
- }>, Schema.Void, Schema.Union<readonly (typeof NotFound | typeof Forbidden | typeof AuthUnavailable | typeof LastRoleAssigner)[]>, typeof UsersPermission, never>, readonly [], undefined>;
90
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof Forbidden | typeof AuthUnavailable)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof UsersPermission, never>, readonly [], undefined>;
91
91
  };
92
92
  //# sourceMappingURL=page.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shivaedev/admin",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "Explicit admin page contracts and a protected native Effect RPC registry",
5
5
  "homepage": "https://github.com/ShivaeDev/platform/tree/main/packages/admin#readme",
6
6
  "bugs": {
@@ -38,23 +38,24 @@
38
38
  "!src/**/*.spec.ts",
39
39
  "!src/**/*.spec.tsx",
40
40
  "!src/**/test-support",
41
+ "CHANGELOG.md",
41
42
  "README.md"
42
43
  ],
43
44
  "dependencies": {
44
- "@shivaedev/access": "0.3.0",
45
+ "@shivaedev/access": "0.3.1",
45
46
  "@shivaedev/changes": "0.6.0",
46
- "@shivaedev/contract": "0.25.0",
47
- "@shivaedev/errors": "0.1.2",
48
- "@shivaedev/identity": "0.9.1",
49
- "@shivaedev/jobs": "0.23.2",
50
- "@shivaedev/react": "0.25.0"
47
+ "@shivaedev/contract": "0.26.0",
48
+ "@shivaedev/errors": "0.1.3",
49
+ "@shivaedev/identity": "0.10.0",
50
+ "@shivaedev/jobs": "0.24.0",
51
+ "@shivaedev/react": "0.26.0"
51
52
  },
52
53
  "devDependencies": {
53
54
  "@effect/atom-react": "4.0.6",
54
55
  "@shivaedev/quality": "0.48.1",
55
- "@shivaedev/server": "0.9.2",
56
+ "@shivaedev/server": "0.9.3",
56
57
  "@shivaedev/test-sql": "0.15.0",
57
- "@shivaedev/test-story": "0.26.3",
58
+ "@shivaedev/test-story": "0.27.0",
58
59
  "@types/node": "24.19.2",
59
60
  "@types/react": "19.3.0",
60
61
  "@types/react-dom": "19.3.0",
@@ -51,7 +51,7 @@ export const JobFields = {
51
51
  completedOn: Schema.OptionFromNullOr(Schema.DateTimeUtcFromString),
52
52
  createdOn: Schema.DateTimeUtcFromString,
53
53
  id: Schema.String,
54
- output: Schema.NullOr(JobFailure),
54
+ output: Schema.NullOr(JobFailure).annotate({ sensitive: true }),
55
55
  retryCount: Schema.Number,
56
56
  retryLimit: Schema.Number,
57
57
  startedOn: Schema.OptionFromNullOr(Schema.DateTimeUtcFromString),
@@ -61,17 +61,17 @@ export const JobFields = {
61
61
  export const PageFields = { cursor: Schema.optionalKey(Schema.String), limit: Schema.Number };
62
62
 
63
63
  export function jobSchema<TPayload extends Schema.Top>(queue: { readonly name: string; readonly schema: TPayload }) {
64
- return Schema.Struct({ ...JobFields, data: queue.schema, queue: Schema.Literal(queue.name) });
64
+ return Schema.Struct({ ...JobFields, data: queue.schema.annotate({ sensitive: true }), queue: Schema.Literal(queue.name) });
65
65
  }
66
66
 
67
67
  export function deadLetteredSchema<TPayload extends Schema.Top>(queue: { readonly name: string; readonly schema: TPayload }) {
68
68
  const name: string = `${queue.name}-dlq`;
69
69
  return Schema.Struct({
70
70
  ...JobFields,
71
- data: queue.schema,
71
+ data: queue.schema.annotate({ sensitive: true }),
72
72
  queue: Schema.Literal(name),
73
73
  sourceId: Schema.OptionFromNullOr(Schema.String),
74
- sourceOutput: Schema.NullOr(JobFailure),
74
+ sourceOutput: Schema.NullOr(JobFailure).annotate({ sensitive: true }),
75
75
  });
76
76
  }
77
77