@shivaedev/admin 0.4.0 → 0.6.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.
Files changed (59) hide show
  1. package/README.md +18 -13
  2. package/dist/client/UsersTable.d.ts +1 -1
  3. package/dist/client/UsersTable.d.ts.map +1 -1
  4. package/dist/client/UsersTable.js +1 -1
  5. package/dist/client/UsersTable.js.map +1 -1
  6. package/dist/client/UsersView.d.ts +1 -1
  7. package/dist/client/UsersView.d.ts.map +1 -1
  8. package/dist/client/UsersView.js +1 -1
  9. package/dist/client/UsersView.js.map +1 -1
  10. package/dist/jobs/keys.d.ts +5 -5
  11. package/dist/jobs/keys.js +1 -1
  12. package/dist/jobs/keys.js.map +1 -1
  13. package/dist/jobs/page.d.ts +11 -11
  14. package/dist/jobs/page.js +2 -2
  15. package/dist/jobs/page.js.map +1 -1
  16. package/dist/jobs/retryPage.d.ts +13 -13
  17. package/dist/jobs/retryPage.js +2 -2
  18. package/dist/jobs/retryPage.js.map +1 -1
  19. package/dist/page.d.ts +4 -4
  20. package/dist/page.d.ts.map +1 -1
  21. package/dist/page.js +2 -2
  22. package/dist/page.js.map +1 -1
  23. package/dist/permissions.d.ts +15 -0
  24. package/dist/permissions.d.ts.map +1 -0
  25. package/dist/permissions.js +6 -0
  26. package/dist/permissions.js.map +1 -0
  27. package/dist/server/jobsHandlers.d.ts +7 -7
  28. package/dist/server/jobsHandlers.d.ts.map +1 -1
  29. package/dist/server/jobsHandlersWithRetry.d.ts +2 -2
  30. package/dist/server/jobsHandlersWithRetry.d.ts.map +1 -1
  31. package/dist/server/users.d.ts +24 -0
  32. package/dist/server/users.d.ts.map +1 -0
  33. package/dist/server/users.js +65 -0
  34. package/dist/server/users.js.map +1 -0
  35. package/dist/server/usersHandlers.d.ts.map +1 -1
  36. package/dist/server/usersHandlers.js +5 -4
  37. package/dist/server/usersHandlers.js.map +1 -1
  38. package/dist/users/page.d.ts +7 -7
  39. package/dist/users/page.d.ts.map +1 -1
  40. package/dist/users/page.js +5 -5
  41. package/dist/users/page.js.map +1 -1
  42. package/dist/users/roles.d.ts +44 -0
  43. package/dist/users/roles.d.ts.map +1 -0
  44. package/dist/users/roles.js +20 -0
  45. package/dist/users/roles.js.map +1 -0
  46. package/package.json +12 -8
  47. package/src/client/UsersTable.tsx +1 -1
  48. package/src/client/UsersView.ts +2 -2
  49. package/src/jobs/keys.ts +1 -1
  50. package/src/jobs/page.ts +2 -2
  51. package/src/jobs/retryPage.ts +2 -2
  52. package/src/page.ts +5 -5
  53. package/src/permissions.ts +5 -0
  54. package/src/server/jobsHandlers.ts +2 -2
  55. package/src/server/jobsHandlersWithRetry.ts +1 -1
  56. package/src/server/users.ts +67 -0
  57. package/src/server/usersHandlers.ts +5 -4
  58. package/src/users/page.ts +5 -5
  59. package/src/users/roles.ts +23 -0
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @shivaedev/admin
2
2
 
3
- Admin tooling starts with an explicit list of pages and the operations each page needs. This package collects native Effect contracts behind the administrator role, so every page operation shares the same boundary.
3
+ Admin tooling starts with an explicit list of pages and the operations each page needs. This package collects native Effect contracts behind a declared permission, so every page operation shares the same boundary.
4
4
 
5
5
  ## Declare the tools operators can use
6
6
 
@@ -13,18 +13,18 @@ const Jobs = adminPage({
13
13
  const Admin = adminRegistry(Jobs);
14
14
  ```
15
15
 
16
- The page exposes `admin.jobs.failed` and the generated `admin.jobs.$changes` subscription. Both require `AuthenticatedAdmin`. A query-only contract has no command; an owner without the `admin` role remains forbidden.
16
+ The page exposes `admin.jobs.failed` and the generated `admin.jobs.$changes` subscription. Both require `AdminPermission`, which checks the `OpenAdmin` permission (`admin.open`). A query-only contract has no command. The application grants this permission to its chosen roles.
17
17
 
18
18
  ## Use native contracts and Layers
19
19
 
20
- Install `@shivaedev/admin` with `effect`, `react` and `@effect/atom-react`. Declare each page's queries, commands and streams with `@shivaedev/effect-contract`, then pass its native contract to `adminPage`. The stable id identifies the page at server registration; route metadata belongs to the application's view. Author RPC namespaces in the contract name, such as `admin.jobs`.
20
+ Install `@shivaedev/admin` with `effect`, `react` and `@effect/atom-react`. Declare each page's queries, commands and streams with `@shivaedev/contract`, then pass its native contract to `adminPage`. The stable id identifies the page at server registration; route metadata belongs to the application's view. Author RPC namespaces in the contract name, such as `admin.jobs`.
21
21
 
22
22
  ```ts
23
23
  import { Schema } from "effect";
24
24
  import { adminPage } from "@shivaedev/admin/page.ts";
25
25
  import { adminRegistry } from "@shivaedev/admin/registry.ts";
26
- import { contract } from "@shivaedev/effect-contract/contract.ts";
27
- import { query } from "@shivaedev/effect-contract/operation.ts";
26
+ import { contract } from "@shivaedev/contract/contract.ts";
27
+ import { query } from "@shivaedev/contract/operation.ts";
28
28
 
29
29
  const Failed = query("failed", {
30
30
  reads: () => [],
@@ -45,7 +45,8 @@ Register server handler Layers by page id:
45
45
  ```ts
46
46
  import { Effect, Layer } from "effect";
47
47
  import { registerAdmin } from "@shivaedev/admin/server/registerAdmin.ts";
48
- import { authenticatedAdminLayer } from "@shivaedev/platform/server/rpc-server/roles.ts";
48
+ import { AdminPermission, OpenAdmin } from "@shivaedev/admin/permissions.ts";
49
+ import { permissionLayer } from "@shivaedev/identity/server/permissions.ts";
49
50
 
50
51
  const registration = registerAdmin(Admin, {
51
52
  jobs: Jobs.contract.application.toLayer({
@@ -53,13 +54,15 @@ const registration = registerAdmin(Admin, {
53
54
  }),
54
55
  });
55
56
  const handlers = registration.handlers.pipe(
56
- Layer.provideMerge(authenticatedAdminLayer(sessions)),
57
+ Layer.provideMerge(permissionLayer(AdminPermission, sessions)),
57
58
  );
58
59
  ```
59
60
 
61
+ Declare application roles with `@shivaedev/access`, grant `OpenAdmin` explicitly, and supply that role set through the session or auth configuration of `@shivaedev/identity`.
62
+
60
63
  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 fail at registration; TypeScript also checks each Layer provides the handlers for its page.
61
64
 
62
- Page declarations and the registry are browser-safe. Server registration lives under `/server`; applications own route composition and styling. The built-in Users view uses React; server declarations add no transport. The package's stories prove role enforcement through native in-process RPC, with an already resolved session as a precondition.
65
+ Page declarations and the registry are browser-safe. Server registration lives under `/server`; applications own route composition and styling. The built-in Users view uses React; server declarations add no transport. The package's stories prove permission enforcement through native in-process RPC, with an already resolved session as a precondition.
63
66
 
64
67
  ## Built-in Jobs page
65
68
 
@@ -88,9 +91,9 @@ const registration = registerAdmin(Admin, {
88
91
 
89
92
  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<Job>`. Each job carries its queue, decoded payload, state, attempt and retry counts, output and timestamps. Dead-letter listings also carry `sourceId` and `sourceOutput`. Timestamps use UTC `DateTime` values; the RPC encodes timestamps as strings and Options as nullable values. The queue's original codec encodes and decodes its payload across RPC, preserving its service requirements.
90
93
 
91
- Health filters the runtime's monitor snapshot to the page's queues and recomputes totals from those queues. It has the same refresh timing as effect-pg-boss 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.
94
+ Health filters the runtime's monitor snapshot to the page's queues and recomputes totals from 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.
92
95
 
93
- The default `jobsPage` 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. PostgreSQL stories exercise these queries through serialized `/rpc` requests, including pagination, transformed payloads, missing jobs, queue restrictions and role enforcement. The application supplies the Jobs view and mounts the registration on its existing RPC host.
96
+ The default `jobsPage` 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. PostgreSQL stories exercise these queries through serialized `/rpc` requests, including pagination, transformed payloads, missing jobs, queue restrictions and permission enforcement. The application supplies the Jobs view and mounts the registration on its existing RPC host.
94
97
 
95
98
  ### Declare retry explicitly
96
99
 
@@ -107,7 +110,7 @@ const registration = registerAdmin(Admin, {
107
110
  });
108
111
  ```
109
112
 
110
- This variant adds only `admin.jobs.retry`, taking `{ queue, id }` and returning void. It requires the `admin` role, including when the caller has the `owner` role. The handler uses effect-pg-boss's existing retry for a failed job in a declared queue. Missing jobs and jobs in other states fail with `JobsNotFailed`; unregistered queue names, including dead-letter queues, fail with `JobsQueueUnregistered`. A dead-letter copy's id cannot retry its original.
113
+ This variant adds only `admin.jobs.retry`, taking `{ queue, id }` and returning void. It requires `OpenAdmin`, through the same page middleware. The handler 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`; unregistered queue names, including dead-letter queues, fail with `JobsQueueUnregistered`. A dead-letter copy's id cannot retry its original.
111
114
 
112
115
  A successful bound retry invalidates health, the affected queue's counts and both listings, and the original job's detail. PostgreSQL stories mount these query atoms, retry through authenticated serialized RPC, and observe refetching and a second worker execution. Health retains the runtime monitor's refresh timing.
113
116
 
@@ -126,8 +129,10 @@ const changeRole = Client.runtime.fn(users.changeRole.run);
126
129
  <UsersView list={users.list.query} changeRole={changeRole} />;
127
130
  ```
128
131
 
129
- `admin.users.list` takes `{ limit, cursor? }` (1–100 users), returns `{ users, next, canChangeRoles }`, and orders pages by user id. Each user has id, name, email, roles and a UTC sign-up time. All reads and subscriptions require `admin`. Only callers who also have `owner` see role controls. `admin.users.changeRole` takes `{ userId, role, grant }` for Platform's `user`, `admin` and `owner` roles. It returns typed `Forbidden` for a non-owner, `LastOwner` when revoking the final owner, and `NotFound` for a missing user. Role changes preserve other roles, invalidate the list after commit, and emit an Effect log with actor id, target id, role, action and timestamp. There is no durable audit-history store.
132
+ `admin.users.list` takes `{ limit, cursor? }` (1–100 users), returns `{ users, next, canChangeRoles }`, and orders pages by user id. Each user has id, name, email, roles and a UTC sign-up time. All reads and subscriptions require `OpenAdmin`. Callers granted `ChangeUserRoles` (`users.roles.change`) from `@shivaedev/admin/users/roles.ts` see role controls. `admin.users.changeRole` takes `{ userId, role, grant }` for the `user`, `admin` and `owner` roles that module declares, with the browser-safe user schemas and the typed `LastOwner` failure. It returns typed `Forbidden` without that permission, `LastOwner` when revoking the final owner, and `NotFound` for a missing user. Role changes preserve other roles, invalidate the list after commit, and emit an Effect log with actor id, target id, role, action and timestamp. There is no durable audit-history store.
133
+
134
+ The handlers call `listUsers({ limit, cursor? })` and `changeUserRole({ userId, role, grant })` from `@shivaedev/admin/server/users.ts`, which an application can also call from its own server code. Role writes require an owner `SessionUser` and serialize role changes in a transaction.
130
135
 
131
- Keep Better Auth cookie caching disabled so requests see current roles. Applications must route role writes through this operation to retain its owner and last-owner policy. The starter disables Better Auth's `/admin/set-role`, `/admin/update-user` and `/admin/create-user` browser endpoints; its server-side bootstrap API remains available.
136
+ Keep Better Auth cookie caching disabled so requests see current roles. Applications must route role writes through this operation to retain its permission and last-owner policy. The starter disables Better Auth's `/admin/set-role`, `/admin/update-user` and `/admin/create-user` browser endpoints; its server-side bootstrap API remains available.
132
137
 
133
138
  The starter mounts Users beside Jobs and bootstraps new administrators with both `admin` and `owner`. Existing generated apps receive this wiring through `pnpm dlx @shivaedev/create-app@latest update` after release; review conflicts and install dependencies. For an existing database with no owner, bootstrap a new administrator with `pnpm admin:create`.
@@ -1,5 +1,5 @@
1
- import { type ChangeRoleInput } from "@shivaedev/platform/rpc/userRoles.ts";
2
1
  import type { UsersList } from "#users/page.ts";
2
+ import { type ChangeRoleInput } from "#users/roles.ts";
3
3
  interface RoleControls {
4
4
  readonly dispatch: (input: typeof ChangeRoleInput.Type) => void;
5
5
  readonly pending: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"UsersTable.d.ts","sourceRoot":"","sources":["../../src/client/UsersTable.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgB,KAAK,eAAe,EAAY,MAAM,sCAAsC,CAAC;AACpG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,UAAU,YAAY;IACrB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,eAAe,CAAC,IAAI,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC1B;AAuFD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,QAAQ,EAAE,EAAE,YAAY,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,SAAS,CAAC,IAAI,CAAA;CAAE,+BAOxG"}
1
+ {"version":3,"file":"UsersTable.d.ts","sourceRoot":"","sources":["../../src/client/UsersTable.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAgB,KAAK,eAAe,EAAY,MAAM,iBAAiB,CAAC;AAE/E,UAAU,YAAY;IACrB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,eAAe,CAAC,IAAI,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC1B;AAuFD,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,QAAQ,EAAE,EAAE,YAAY,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,SAAS,CAAC,IAAI,CAAA;CAAE,+BAOxG"}
@@ -1,7 +1,7 @@
1
1
  import { createElement as _createElement } from "react";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { DateTime } from "effect";
4
- import { UserRole } from "@shivaedev/platform/rpc/userRoles.ts";
4
+ import { UserRole } from "#users/roles.ts";
5
5
  function UserHeaders() {
6
6
  return (_jsx("tr", { children: ["Name", "Email", "Roles", "Signed up"].map((label) => (_jsx("th", { className: "whitespace-nowrap p-3", scope: "col", children: label }, label))) }));
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UsersTable.js","sourceRoot":"","sources":["../../src/client/UsersTable.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAsC,QAAQ,EAAE,MAAM,sCAAsC,CAAC;AAQpG,SAAS,WAAW;IACnB,OAAO,CACN,uBACE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACvD,aAAI,SAAS,EAAC,uBAAuB,EAAa,KAAK,EAAC,KAAK,YAC3D,KAAK,IADoC,KAAK,CAE3C,CACL,CAAC,GACE,CACL,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAA8F;IAClJ,OAAO,CACN,iBAAO,SAAS,EAAC,wBAAwB,aACxC,8BACa,GAAG,IAAI,QAAQ,IAAI,CAAC,KAAK,EAAE,EACvC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAClC,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,EACrF,IAAI,EAAC,UAAU,GACd,EACD,IAAI,IACE,CACR,CAAC;AACH,CAAC;AAED,SAAS,SAAS,CAAC,EAClB,IAAI,EACJ,cAAc,EACd,QAAQ,EACR,OAAO,GAIP;IACA,OAAO,CACN,0BACC,sBAAI,IAAI,CAAC,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EAAE,IAAI,EAAE,GAAG,QAAQ,EAA2D;IAC/F,OAAO,CACN,cAAK,SAAS,EAAC,mCAAmC,YACjD,iBAAO,SAAS,EAAC,0BAA0B,aAC1C,kBAAS,SAAS,EAAC,SAAS,oCAA8B,EAC1D,gBAAO,SAAS,EAAC,UAAU,YAC1B,KAAC,WAAW,KAAG,GACR,EACR,0BACE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACzB,eAAC,OAAO,OAAK,QAAQ,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,GAAI,CACxF,CAAC,GACK,IACD,GACH,CACN,CAAC;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,GAAG,QAAQ,EAA2D;IACxG,OAAO,CACN,eAAK,SAAS,EAAC,WAAW,aACxB,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,wDAAoC,EACjE,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,oCAAgB,CAAC,CAAC,CAAC,KAAC,QAAQ,OAAK,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAI,IAC/E,CACN,CAAC;AACH,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import type * as AsyncResult from "effect/reactivity/AsyncResult";
2
2
  import type * as Atom from "effect/reactivity/Atom";
3
- import type { ChangeRoleInput, UserListInput } from "@shivaedev/platform/rpc/userRoles.ts";
4
3
  import type { UsersList } from "#users/page.ts";
4
+ import type { ChangeRoleInput, UserListInput } from "#users/roles.ts";
5
5
  export interface UsersViewProps {
6
6
  readonly changeRole: Atom.AtomResultFn<typeof ChangeRoleInput.Type, void, unknown>;
7
7
  readonly list: (input: typeof UserListInput.Type) => Atom.Atom<AsyncResult.AsyncResult<typeof UsersList.Type, unknown>>;
@@ -1 +1 @@
1
- {"version":3,"file":"UsersView.d.ts","sourceRoot":"","sources":["../../src/client/UsersView.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAGpD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC3F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACnF,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,aAAa,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;CACxH;AAaD,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,cAAc;;;gBA6C7D"}
1
+ {"version":3,"file":"UsersView.d.ts","sourceRoot":"","sources":["../../src/client/UsersView.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAGpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGtE,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,OAAO,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACnF,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,aAAa,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,OAAO,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;CACxH;AAaD,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,cAAc;;;gBA6C7D"}
@@ -1,6 +1,6 @@
1
1
  import { Cause, Option, Predicate } from "effect";
2
2
  import { createElement, useState } from "react";
3
- import { useAction, useQuery } from "@shivaedev/effect-react/client/resultState.ts";
3
+ import { useAction, useQuery } from "@shivaedev/react/client/resultState.ts";
4
4
  import { UsersTable } from "./UsersTable.js";
5
5
  function failure(cause) {
6
6
  const error = Option.getOrUndefined(Cause.findErrorOption(cause));
@@ -1 +1 @@
1
- {"version":3,"file":"UsersView.js","sourceRoot":"","sources":["../../src/client/UsersView.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGlD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAGpF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAkB,CAAC;AAO9C,SAAS,OAAO,CAAC,KAA2B;IAC3C,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;IAClE,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE,CAAC;QAC5C,OAAO,sEAAsE,CAAC;IAC/E,CAAC;IACD,IAAI,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,EAAE,CAAC;QAC5C,OAAO,sCAAsC,CAAC;IAC/C,CAAC;IACD,OAAO,uCAAuC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU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CAAC;YAC/C,IAAI,EAAE,QAAQ;SACd,EACD,gBAAgB,CAChB,EACD,aAAa,CACZ,QAAQ,EACR;YACC,SAAS,EAAE,iDAAiD;YAC5D,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO;YACnD,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;YAC9E,IAAI,EAAE,QAAQ;SACd,EACD,YAAY,CACZ,CACD,CACH,CAAC;AACH,CAAC"}
@@ -1,8 +1,8 @@
1
1
  export declare const jobsKeys: {
2
- counts: import("@shivaedev/effect-contract/keys.ts").Collection<"admin.jobs.counts", string>;
3
- deadLettered: import("@shivaedev/effect-contract/keys.ts").Collection<"admin.jobs.deadLettered", string>;
4
- failed: import("@shivaedev/effect-contract/keys.ts").Collection<"admin.jobs.failed", string>;
5
- health: import("@shivaedev/effect-contract/keys.ts").Collection<"admin.jobs.health", string>;
6
- job: (queue: string) => import("@shivaedev/effect-contract/keys.ts").Collection<`admin.jobs.job.${string}`, string>;
2
+ counts: import("@shivaedev/contract/keys.ts").Collection<"admin.jobs.counts", string>;
3
+ deadLettered: import("@shivaedev/contract/keys.ts").Collection<"admin.jobs.deadLettered", string>;
4
+ failed: import("@shivaedev/contract/keys.ts").Collection<"admin.jobs.failed", string>;
5
+ health: import("@shivaedev/contract/keys.ts").Collection<"admin.jobs.health", string>;
6
+ job: (queue: string) => import("@shivaedev/contract/keys.ts").Collection<`admin.jobs.job.${string}`, string>;
7
7
  };
8
8
  //# sourceMappingURL=keys.d.ts.map
package/dist/jobs/keys.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { collection } from "@shivaedev/effect-contract/keys.ts";
2
+ import { collection } from "@shivaedev/contract/keys.ts";
3
3
  export const jobsKeys = {
4
4
  counts: collection("admin.jobs.counts", Schema.String),
5
5
  deadLettered: collection("admin.jobs.deadLettered", Schema.String),
@@ -1 +1 @@
1
- {"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/jobs/keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB,MAAM,EAAE,UAAU,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC;IACtD,YAAY,EAAE,UAAU,CAAC,yBAAyB,EAAE,MAAM,CAAC,MAAM,CAAC;IAClE,MAAM,EAAE,UAAU,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC;IACtD,MAAM,EAAE,UAAU,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC;IACtD,GAAG,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,UAAU,CAAC,kBAAkB,KAAK,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC;CAC5E,CAAC"}
1
+ {"version":3,"file":"keys.js","sourceRoot":"","sources":["../../src/jobs/keys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB,MAAM,EAAE,UAAU,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC;IACtD,YAAY,EAAE,UAAU,CAAC,yBAAyB,EAAE,MAAM,CAAC,MAAM,CAAC;IAClE,MAAM,EAAE,UAAU,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC;IACtD,MAAM,EAAE,UAAU,CAAC,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC;IACtD,GAAG,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,UAAU,CAAC,kBAAkB,KAAK,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC;CAC5E,CAAC"}
@@ -2,7 +2,7 @@ import { Schema } from "effect";
2
2
  import { type JobsQueue } from "./schemas.ts";
3
3
  export declare function jobsPage<const TQueues extends readonly JobsQueue[]>(...queues: TQueues): import("#page.ts").AdminPage & {
4
4
  readonly id: "jobs";
5
- readonly contract: import("@shivaedev/effect-contract/contract.ts").Contract<"admin.jobs", readonly [NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"health", Schema.Void, Schema.Struct<{
5
+ readonly contract: import("@shivaedev/contract/contract.ts").Contract<"admin.jobs", readonly [NoInfer<import("@shivaedev/contract/operation.ts").Query<"health", Schema.Void, Schema.Struct<{
6
6
  readonly activeTotal: Schema.Number;
7
7
  readonly deadLetteredTotal: Schema.Number;
8
8
  readonly failedTotal: Schema.Number;
@@ -20,7 +20,7 @@ export declare function jobsPage<const TQueues extends readonly JobsQueue[]>(...
20
20
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
21
21
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
22
22
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
23
- }>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"counts", Schema.Struct<{
23
+ }>>, NoInfer<import("@shivaedev/contract/operation.ts").Query<"counts", Schema.Struct<{
24
24
  queue: Schema.String;
25
25
  }>, Schema.Struct<{
26
26
  readonly activeCount: Schema.Number;
@@ -31,7 +31,7 @@ export declare function jobsPage<const TQueues extends readonly JobsQueue[]>(...
31
31
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
32
32
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
33
33
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
34
- }>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"failed", Schema.Struct<{
34
+ }>>, NoInfer<import("@shivaedev/contract/operation.ts").Query<"failed", Schema.Struct<{
35
35
  cursor: Schema.optionalKey<Schema.String>;
36
36
  limit: Schema.Number;
37
37
  queue: Schema.String;
@@ -54,7 +54,7 @@ export declare function jobsPage<const TQueues extends readonly JobsQueue[]>(...
54
54
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
55
55
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
56
56
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
57
- }>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"deadLettered", Schema.Struct<{
57
+ }>>, NoInfer<import("@shivaedev/contract/operation.ts").Query<"deadLettered", Schema.Struct<{
58
58
  cursor: Schema.optionalKey<Schema.String>;
59
59
  limit: Schema.Number;
60
60
  queue: Schema.String;
@@ -79,7 +79,7 @@ export declare function jobsPage<const TQueues extends readonly JobsQueue[]>(...
79
79
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
80
80
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
81
81
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
82
- }>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"job", Schema.Struct<{
82
+ }>>, NoInfer<import("@shivaedev/contract/operation.ts").Query<"job", Schema.Struct<{
83
83
  id: Schema.String;
84
84
  queue: Schema.String;
85
85
  }>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
@@ -140,14 +140,14 @@ export declare function jobsPage<const TQueues extends readonly JobsQueue[]>(...
140
140
  }>]>>;
141
141
  }>, Schema.Struct<{
142
142
  readonly _tag: Schema.Literal<"Resync">;
143
- }>]>, Schema.Never>, Schema.Never, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.counts", Schema.Struct<{
143
+ }>]>, Schema.Never>, Schema.Never, typeof import("../permissions.ts").AdminPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.counts", Schema.Struct<{
144
144
  queue: Schema.String;
145
145
  }>, Schema.Struct<{
146
146
  readonly activeCount: Schema.Number;
147
147
  readonly failedCount: Schema.Number;
148
148
  readonly queuedCount: Schema.Number;
149
149
  readonly totalCount: Schema.Number;
150
- }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
150
+ }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("../permissions.ts").AdminPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
151
151
  cursor: Schema.optionalKey<Schema.String>;
152
152
  limit: Schema.Number;
153
153
  queue: Schema.String;
@@ -168,7 +168,7 @@ export declare function jobsPage<const TQueues extends readonly JobsQueue[]>(...
168
168
  readonly sourceOutput: Schema.Unknown;
169
169
  }>[]>>;
170
170
  readonly next: Schema.OptionFromNullOr<Schema.String>;
171
- }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
171
+ }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("../permissions.ts").AdminPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
172
172
  cursor: Schema.optionalKey<Schema.String>;
173
173
  limit: Schema.Number;
174
174
  queue: Schema.String;
@@ -187,7 +187,7 @@ export declare function jobsPage<const TQueues extends readonly JobsQueue[]>(...
187
187
  readonly queue: Schema.Literal<string>;
188
188
  }>[]>>;
189
189
  readonly next: Schema.OptionFromNullOr<Schema.String>;
190
- }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
190
+ }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("../permissions.ts").AdminPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
191
191
  readonly activeTotal: Schema.Number;
192
192
  readonly deadLetteredTotal: Schema.Number;
193
193
  readonly failedTotal: Schema.Number;
@@ -201,7 +201,7 @@ export declare function jobsPage<const TQueues extends readonly JobsQueue[]>(...
201
201
  }>>;
202
202
  readonly queuedTotal: Schema.Number;
203
203
  readonly readyTotal: Schema.Number;
204
- }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
204
+ }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("../permissions.ts").AdminPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
205
205
  id: Schema.String;
206
206
  queue: Schema.String;
207
207
  }>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
@@ -216,7 +216,7 @@ export declare function jobsPage<const TQueues extends readonly JobsQueue[]>(...
216
216
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
217
217
  readonly data: TQueues[number]["schema"];
218
218
  readonly queue: Schema.Literal<string>;
219
- }>[]>>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never>, readonly [], undefined>;
219
+ }>[]>>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("../permissions.ts").AdminPermission, never>, readonly [], undefined>;
220
220
  } & {
221
221
  queues: TQueues;
222
222
  };
package/dist/jobs/page.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
- import { contract } from "@shivaedev/effect-contract/contract.ts";
3
- import { query } from "@shivaedev/effect-contract/operation.ts";
2
+ import { contract } from "@shivaedev/contract/contract.ts";
3
+ import { query } from "@shivaedev/contract/operation.ts";
4
4
  import { adminPage } from "#page.ts";
5
5
  import { jobsKeys } from "./keys.js";
6
6
  import { deadLetteredSchema, JobsFailures, JobsHealth, jobPage, jobSchema, PageFields, QueueCounts } from "./schemas.js";
@@ -1 +1 @@
1
- {"version":3,"file":"page.js","sourceRoot":"","sources":["../../src/jobs/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,yCAAyC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,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,CAAC,MAAM,EAAE;oBAChD,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBACnD,UAAU,EAAE,YAAY;oBACxB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC;iBACrB,CAAC;gBACF,KAAK,CAAC,cAAc,EAAE;oBACrB,OAAO,EAAE,EAAE,GAAG,UAAU,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;oBAChD,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBACzD,UAAU,EAAE,YAAY;oBACxB,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC;iBAC9B,CAAC;gBACF,KAAK,CAAC,KAAK,EAAE;oBACZ,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;oBACpD,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBACxD,UAAU,EAAE,YAAY;oBACxB,OAAO,EAAE,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC;iBACrC,CAAC;aACF;SACD,CAAC;QACF,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE;KAC7C,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AACxC,CAAC"}
@@ -8,7 +8,7 @@ export declare class JobsNotFailed extends JobsNotFailed_base {
8
8
  }
9
9
  export declare function jobsPageWithRetry<const TQueues extends readonly JobsQueue[]>(...queues: TQueues): import("#page.ts").AdminPage & {
10
10
  readonly id: "jobs";
11
- readonly contract: import("@shivaedev/effect-contract/contract.ts").Contract<"admin.jobs", readonly [NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"health", Schema.Void, Schema.Struct<{
11
+ readonly contract: import("@shivaedev/contract/contract.ts").Contract<"admin.jobs", readonly [NoInfer<import("@shivaedev/contract/operation.ts").Query<"health", Schema.Void, Schema.Struct<{
12
12
  readonly activeTotal: Schema.Number;
13
13
  readonly deadLetteredTotal: Schema.Number;
14
14
  readonly failedTotal: Schema.Number;
@@ -26,7 +26,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsQue
26
26
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
27
27
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
28
28
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
29
- }>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"counts", Schema.Struct<{
29
+ }>>, NoInfer<import("@shivaedev/contract/operation.ts").Query<"counts", Schema.Struct<{
30
30
  queue: Schema.String;
31
31
  }>, Schema.Struct<{
32
32
  readonly activeCount: Schema.Number;
@@ -37,7 +37,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsQue
37
37
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
38
38
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
39
39
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
40
- }>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"failed", Schema.Struct<{
40
+ }>>, NoInfer<import("@shivaedev/contract/operation.ts").Query<"failed", Schema.Struct<{
41
41
  cursor: Schema.optionalKey<Schema.String>;
42
42
  limit: Schema.Number;
43
43
  queue: Schema.String;
@@ -60,7 +60,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsQue
60
60
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
61
61
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
62
62
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
63
- }>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"deadLettered", Schema.Struct<{
63
+ }>>, NoInfer<import("@shivaedev/contract/operation.ts").Query<"deadLettered", Schema.Struct<{
64
64
  cursor: Schema.optionalKey<Schema.String>;
65
65
  limit: Schema.Number;
66
66
  queue: Schema.String;
@@ -85,7 +85,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsQue
85
85
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
86
86
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
87
87
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
88
- }>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"job", Schema.Struct<{
88
+ }>>, NoInfer<import("@shivaedev/contract/operation.ts").Query<"job", Schema.Struct<{
89
89
  id: Schema.String;
90
90
  queue: Schema.String;
91
91
  }>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
@@ -104,7 +104,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsQue
104
104
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
105
105
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
106
106
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
107
- }>>], readonly [NoInfer<import("@shivaedev/effect-contract/operation.ts").Command<"retry", Schema.Struct<{
107
+ }>>], readonly [NoInfer<import("@shivaedev/contract/operation.ts").Command<"retry", Schema.Struct<{
108
108
  id: Schema.String;
109
109
  queue: Schema.String;
110
110
  }>, Schema.Void, {
@@ -127,7 +127,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsQue
127
127
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
128
128
  readonly data: [...TQueues][number]["schema"];
129
129
  readonly queue: Schema.Literal<string>;
130
- }>[]>>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.$changes", Schema.Struct<{
130
+ }>[]>>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("../permissions.ts").AdminPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.$changes", Schema.Struct<{
131
131
  queries: Schema.$Array<Schema.Union<readonly (Schema.Struct<{
132
132
  query: Schema.Literal<"counts">;
133
133
  payload: Schema.Struct<{
@@ -169,14 +169,14 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsQue
169
169
  }>]>>;
170
170
  }>, Schema.Struct<{
171
171
  readonly _tag: Schema.Literal<"Resync">;
172
- }>]>, Schema.Never>, Schema.Never, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.counts", Schema.Struct<{
172
+ }>]>, Schema.Never>, Schema.Never, typeof import("../permissions.ts").AdminPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.counts", Schema.Struct<{
173
173
  queue: Schema.String;
174
174
  }>, Schema.Struct<{
175
175
  readonly activeCount: Schema.Number;
176
176
  readonly failedCount: Schema.Number;
177
177
  readonly queuedCount: Schema.Number;
178
178
  readonly totalCount: Schema.Number;
179
- }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
179
+ }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("../permissions.ts").AdminPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
180
180
  readonly activeTotal: Schema.Number;
181
181
  readonly deadLetteredTotal: Schema.Number;
182
182
  readonly failedTotal: Schema.Number;
@@ -190,7 +190,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsQue
190
190
  }>>;
191
191
  readonly queuedTotal: Schema.Number;
192
192
  readonly readyTotal: Schema.Number;
193
- }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
193
+ }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("../permissions.ts").AdminPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
194
194
  cursor: Schema.optionalKey<Schema.String>;
195
195
  limit: Schema.Number;
196
196
  queue: Schema.String;
@@ -209,7 +209,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsQue
209
209
  readonly queue: Schema.Literal<string>;
210
210
  }>[]>>;
211
211
  readonly next: Schema.OptionFromNullOr<Schema.String>;
212
- }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
212
+ }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("../permissions.ts").AdminPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
213
213
  cursor: Schema.optionalKey<Schema.String>;
214
214
  limit: Schema.Number;
215
215
  queue: Schema.String;
@@ -230,10 +230,10 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsQue
230
230
  readonly sourceOutput: Schema.Unknown;
231
231
  }>[]>>;
232
232
  readonly next: Schema.OptionFromNullOr<Schema.String>;
233
- }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.retry", Schema.Struct<{
233
+ }>, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("../permissions.ts").AdminPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.retry", Schema.Struct<{
234
234
  id: Schema.String;
235
235
  queue: Schema.String;
236
- }>, Schema.Void, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered | typeof JobsNotFailed)[]>, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never>, readonly [], undefined>;
236
+ }>, Schema.Void, Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered | typeof JobsNotFailed)[]>, typeof import("../permissions.ts").AdminPermission, never>, readonly [], undefined>;
237
237
  } & {
238
238
  queues: TQueues;
239
239
  };
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
- import { contract } from "@shivaedev/effect-contract/contract.ts";
3
- import { command } from "@shivaedev/effect-contract/operation.ts";
2
+ import { contract } from "@shivaedev/contract/contract.ts";
3
+ import { command } from "@shivaedev/contract/operation.ts";
4
4
  import { adminPage } from "#page.ts";
5
5
  import { jobsKeys } from "./keys.js";
6
6
  import { jobsPage } from "./page.js";
@@ -1 +1 @@
1
- {"version":3,"file":"retryPage.js","sourceRoot":"","sources":["../../src/jobs/retryPage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAkB,MAAM,cAAc,CAAC;AAE5D,MAAM,OAAO,aAAc,SAAQ,MAAM,CAAC,WAAW,EAAiB,CAAC,eAAe,EAAE;IACvF,EAAE,EAAE,MAAM,CAAC,MAAM;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM;CACpB,CAAC;CAAG;AAEL,MAAM,UAAU,iBAAiB,CAA6C,GAAG,MAAe;IAC/F,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,MAAM,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC,MAAM,CACnB,SAAS,CAAC;QACT,QAAQ,EAAE,QAAQ,CAAC,YAAY,EAAE;YAChC,QAAQ,EAAE;gBACT,OAAO,CAAC,OAAO,EAAE;oBAChB,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;wBAC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AM;CACpB,CAAC;CAAG;AAEL,MAAM,UAAU,iBAAiB,CAA6C,GAAG,MAAe;IAC/F,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,MAAM,CAAC,CAAC;IACjC,OAAO,MAAM,CAAC,MAAM,CACnB,SAAS,CAAC;QACT,QAAQ,EAAE,QAAQ,CAAC,YAAY,EAAE;YAChC,QAAQ,EAAE;gBACT,OAAO,CAAC,OAAO,EAAE;oBAChB,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;wBAC/B,QAAQ,CAAC,MAAM,CAAC,IAAI;wBACpB,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;wBAC3B,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;wBAC3B,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC;wBACjC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;qBAC5B;oBACD,OAAO,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;oBACpD,UAAU,EAAE,EAAE,GAAG,YAAY,EAAE,aAAa,EAAE;iBAC9C,CAAC;aACF;YACD,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO;SAC1C,CAAC;QACF,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,KAAK,EAAE,IAAI,CAAC,KAAK;KACjB,CAAC,EACF,EAAE,MAAM,EAAE,CACV,CAAC;AACH,CAAC"}
package/dist/page.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { Rpc, RpcGroup } from "effect/rpc";
2
- import type { Contract } from "@shivaedev/effect-contract/contract.ts";
3
- import type { CommandShape, QueryShape, StreamShape } from "@shivaedev/effect-contract/operation.ts";
4
- import { AuthenticatedAdmin } from "@shivaedev/platform/rpc/middleware.ts";
2
+ import type { Contract } from "@shivaedev/contract/contract.ts";
3
+ import type { CommandShape, QueryShape, StreamShape } from "@shivaedev/contract/operation.ts";
4
+ import { AdminPermission } from "#permissions.ts";
5
5
  export interface AdminRoute {
6
6
  readonly path: string;
7
7
  readonly title: string;
@@ -22,7 +22,7 @@ export declare function adminPage<const TId extends string, const TName extends
22
22
  readonly contract: Contract<TName, TQueries, TCommands, TRpcs, TStreams>;
23
23
  }): AdminPage & {
24
24
  readonly id: TId;
25
- readonly contract: Contract<TName, TQueries, TCommands, Rpc.AddMiddleware<TRpcs, typeof AuthenticatedAdmin>, TStreams>;
25
+ readonly contract: Contract<TName, TQueries, TCommands, Rpc.AddMiddleware<TRpcs, typeof AdminPermission>, TStreams>;
26
26
  };
27
27
  export {};
28
28
  //# sourceMappingURL=page.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../src/page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AACrG,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAE3E,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,QAAA,MAAM,eAAe,eAAsC,CAAC;AAE5D,MAAM,WAAW,SAAS;IACzB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,GAAG;QACjC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG,CAAC;QACnC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC;KAChD,CA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,QAAQ,CAAC,CAAC;CACpH,CAEA"}
package/dist/page.js CHANGED
@@ -1,6 +1,6 @@
1
- import { AuthenticatedAdmin } from "@shivaedev/platform/rpc/middleware.ts";
1
+ import { AdminPermission } from "#permissions.ts";
2
2
  const AdminPageTypeId = Symbol.for("@shivaedev/admin/Page");
3
3
  export function adminPage(page) {
4
- return { ...page, [AdminPageTypeId]: true, contract: page.contract.middleware(AuthenticatedAdmin) };
4
+ return { ...page, [AdminPageTypeId]: true, contract: page.contract.middleware(AdminPermission) };
5
5
  }
6
6
  //# sourceMappingURL=page.js.map
package/dist/page.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"page.js","sourceRoot":"","sources":["../src/page.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAO3E,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAY5D,MAAM,UAAU,SAAS,CAOvB,IAID;IAIA,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,eAAe,CAAC,EAAE,IAAa,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;AAC9G,CAAC"}
1
+ {"version":3,"file":"page.js","sourceRoot":"","sources":["../src/page.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAOlD,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAY5D,MAAM,UAAU,SAAS,CAOvB,IAID;IAIA,OAAO,EAAE,GAAG,IAAI,EAAE,CAAC,eAAe,CAAC,EAAE,IAAa,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;AAC3G,CAAC"}
@@ -0,0 +1,15 @@
1
+ export declare const OpenAdmin: {
2
+ readonly any: {
3
+ readonly name: "admin.open";
4
+ readonly strength: "any";
5
+ };
6
+ readonly name: "admin.open";
7
+ readonly strength: "own";
8
+ };
9
+ declare const AdminPermission_base: import("effect/rpc/RpcMiddleware").ServiceClass<AdminPermission, "@shivaedev/admin/Permission", import("@shivaedev/identity/identity.ts").Identity | import("@shivaedev/identity/identity.ts").SessionUser, import("effect/Schema").Union<readonly [typeof import("@shivaedev/errors/taxonomy.ts").Unauthorized, typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable, typeof import("@shivaedev/errors/taxonomy.ts").Forbidden]>, never, never, false> & {
10
+ permission: import("@shivaedev/access/permission.ts").Permission;
11
+ };
12
+ export declare class AdminPermission extends AdminPermission_base {
13
+ }
14
+ export {};
15
+ //# sourceMappingURL=permissions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;CAA2B,CAAC;;;;AAClD,qBAAa,eAAgB,SAAQ,oBAAiF;CAAG"}
@@ -0,0 +1,6 @@
1
+ import { permission } from "@shivaedev/access/permission.ts";
2
+ import { permissionMiddleware } from "@shivaedev/identity/permission.ts";
3
+ export const OpenAdmin = permission("admin.open");
4
+ export class AdminPermission extends permissionMiddleware()("@shivaedev/admin/Permission", OpenAdmin) {
5
+ }
6
+ //# sourceMappingURL=permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;AAClD,MAAM,OAAO,eAAgB,SAAQ,oBAAoB,EAAmB,CAAC,6BAA6B,EAAE,SAAS,CAAC;CAAG"}