@shivaedev/admin 0.20.4 → 0.21.1
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 +24 -0
- package/README.md +1 -1
- package/dist/jobs/retryPage.d.ts +5 -5
- package/dist/server/adminDocuments.d.ts +1 -2
- package/dist/server/adminDocuments.d.ts.map +1 -1
- package/dist/server/adminDocuments.js +3 -3
- package/dist/server/adminDocuments.js.map +1 -1
- package/dist/server/pagePermissions.js +1 -1
- package/dist/server/pagePermissions.js.map +1 -1
- package/dist/sessions/Page.d.ts +4 -4
- package/dist/users/page.d.ts +5 -5
- package/package.json +20 -20
- package/src/server/adminDocuments.ts +3 -4
- package/src/server/pagePermissions.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.21.1 - 2026-11-05
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Update `@shivaedev/contract` from 0.39.0 to 0.40.0.
|
|
8
|
+
- Update `@shivaedev/identity` from 0.27.0 to 0.28.0.
|
|
9
|
+
- Update `@shivaedev/jobs` from 0.39.0 to 0.40.0.
|
|
10
|
+
- Update `@shivaedev/react` from 0.44.0 to 0.44.1.
|
|
11
|
+
|
|
12
|
+
## 0.21.0 - 2026-11-05
|
|
13
|
+
|
|
14
|
+
### Breaking
|
|
15
|
+
|
|
16
|
+
- Require Effect 4.1.0 and its matching companion packages. Move `effect`, `@effect/platform-node`, `@effect/platform-node-shared`, `@effect/sql-pg`, `@effect/sql-sqlite-node`, `@effect/atom-react` and `@effect/vitest` to exactly 4.1.0 together.
|
|
17
|
+
|
|
18
|
+
## 0.20.5 - 2026-11-05
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Update `@shivaedev/contract` from 0.37.0 to 0.38.0.
|
|
23
|
+
- Update `@shivaedev/identity` from 0.26.2 to 0.26.3.
|
|
24
|
+
- Update `@shivaedev/jobs` from 0.37.1 to 0.38.0.
|
|
25
|
+
- Update `@shivaedev/react` from 0.42.0 to 0.43.0.
|
|
26
|
+
|
|
3
27
|
## 0.20.4 - 2026-11-05
|
|
4
28
|
|
|
5
29
|
### Changed
|
package/README.md
CHANGED
|
@@ -270,4 +270,4 @@ Install `@shivaedev/admin` with its required `effect` peer. Registry, contract a
|
|
|
270
270
|
|
|
271
271
|
Page declarations and the registry are browser-safe and add no transport. Server registration lives under `/server`, and the optional default Jobs, Users and Sessions views under `/client/adapters` use React. Applications own route composition and styling.
|
|
272
272
|
|
|
273
|
-
This package declares the permission middleware and does not resolve sessions. `permissionLayer` from `@shivaedev/identity/server/
|
|
273
|
+
This package declares the permission middleware and does not resolve sessions. `permissionLayer` from `@shivaedev/identity/server/permissionLayer.ts` resolves each request's session through the session policy the application supplies, then checks the page's permission.
|
package/dist/jobs/retryPage.d.ts
CHANGED
|
@@ -243,10 +243,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
|
|
|
243
243
|
"~ClientError": never;
|
|
244
244
|
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
245
245
|
requiredForClient: false;
|
|
246
|
-
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.
|
|
247
|
-
id: Schema.String;
|
|
248
|
-
queue: Schema.String;
|
|
249
|
-
}>, 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<{
|
|
246
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.counts", Schema.Struct<{
|
|
250
247
|
queue: Schema.String;
|
|
251
248
|
}>, Schema.Struct<{
|
|
252
249
|
readonly activeCount: Schema.Number;
|
|
@@ -375,7 +372,10 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
|
|
|
375
372
|
"~ClientError": never;
|
|
376
373
|
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
377
374
|
requiredForClient: false;
|
|
378
|
-
}), never
|
|
375
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.retry", Schema.Struct<{
|
|
376
|
+
id: Schema.String;
|
|
377
|
+
queue: Schema.String;
|
|
378
|
+
}>, 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>;
|
|
379
379
|
} & {
|
|
380
380
|
queues: TQueues;
|
|
381
381
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import
|
|
3
|
-
import { HttpRouter, HttpServerResponse } from "effect/http";
|
|
2
|
+
import { HttpRouter, HttpServerRequest, HttpServerResponse } from "effect/http";
|
|
4
3
|
import type { AnyAdminRegistry } from "#registry.ts";
|
|
5
4
|
export declare function adminDocuments<E, R>(registry: AnyAdminRegistry, handler: (request: HttpServerRequest.HttpServerRequest) => Effect.Effect<HttpServerResponse.HttpServerResponse, E, R>): import("effect/Layer").Layer<never, never, HttpRouter.HttpRouter | HttpRouter.Request<"Requires", import("@shivaedev/identity/server/SessionPolicy.ts").SessionPolicy> | Exclude<HttpRouter.Request.From<"Error", E>, import("effect/Scope").Scope> | Exclude<HttpRouter.Request.From<"Requires", Exclude<Exclude<R, import("@shivaedev/identity/identity.ts").Identity | import("@shivaedev/identity/identity.ts").SessionUser>, HttpRouter.Provided>>, import("effect/Scope").Scope>>;
|
|
6
5
|
//# sourceMappingURL=adminDocuments.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adminDocuments.d.ts","sourceRoot":"","sources":["../../src/server/adminDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,
|
|
1
|
+
{"version":3,"file":"adminDocuments.d.ts","sourceRoot":"","sources":["../../src/server/adminDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIhF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,EAClC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,CAAC,OAAO,EAAE,iBAAiB,CAAC,iBAAiB,KAAK,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,kBAAkB,EAAE,CAAC,EAAE,CAAC,CAAC,2dAcrH"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import { HttpRouter, HttpServerResponse } from "effect/http";
|
|
2
|
+
import { HttpRouter, HttpServerRequest, HttpServerResponse } from "effect/http";
|
|
3
3
|
import * as HttpStatus from "effect/http/HttpStatus";
|
|
4
|
-
import { permissionRoute } from "@shivaedev/identity/server/
|
|
4
|
+
import { permissionRoute } from "@shivaedev/identity/server/adapters/permissionRoute.ts";
|
|
5
5
|
import { matchAdminRoute } from "#adapters/matchAdminRoute.ts";
|
|
6
6
|
export function adminDocuments(registry, handler) {
|
|
7
7
|
const routes = registry.pages.map((page) => page.route);
|
|
@@ -11,7 +11,7 @@ export function adminDocuments(registry, handler) {
|
|
|
11
11
|
const route = matchAdminRoute(routes, path);
|
|
12
12
|
return route === undefined
|
|
13
13
|
? Effect.succeed(HttpServerResponse.empty({ status: HttpStatus.fromLiteral("NotFound") }))
|
|
14
|
-
: permissionRoute(route.permission)(handler)
|
|
14
|
+
: permissionRoute(route.permission)(Effect.flatMap(HttpServerRequest.HttpServerRequest, handler));
|
|
15
15
|
});
|
|
16
16
|
}));
|
|
17
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adminDocuments.js","sourceRoot":"","sources":["../../src/server/adminDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"adminDocuments.js","sourceRoot":"","sources":["../../src/server/adminDocuments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACzF,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D,MAAM,UAAU,cAAc,CAC7B,QAA0B,EAC1B,OAAqH;IAErH,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxD,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAChC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACnB,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE;YAChD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC;YAC/D,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAC5C,OAAO,KAAK,KAAK,SAAS;gBACzB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;gBAC1F,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC;QACpG,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CACF,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, Layer } from "effect";
|
|
2
|
-
import { permissionLayer } from "@shivaedev/identity/server/
|
|
2
|
+
import { permissionLayer } from "@shivaedev/identity/server/permissionLayer.ts";
|
|
3
3
|
export function pagePermissions(registry) {
|
|
4
4
|
return Layer.mergeAll(Layer.empty, ...registry.pages.map((page) => {
|
|
5
5
|
const middleware = Context.Service(page.permissionKey);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagePermissions.js","sourceRoot":"","sources":["../../src/server/pagePermissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"pagePermissions.js","sourceRoot":"","sources":["../../src/server/pagePermissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAIxC,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAGhF,MAAM,UAAU,eAAe,CAAC,QAA0B;IACzD,OAAO,KAAK,CAAC,QAAQ,CACpB,KAAK,CAAC,KAAK,EACX,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC9B,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAwF,IAAI,CAAC,aAAa,CAAC,CAAC;QAC9I,OAAO,eAAe,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC1F,CAAC,CAAC,CACF,CAAC;AACH,CAAC"}
|
package/dist/sessions/Page.d.ts
CHANGED
|
@@ -84,9 +84,7 @@ export declare const SessionsPage: import("#page.ts").AdminPage & {
|
|
|
84
84
|
"~ClientError": never;
|
|
85
85
|
error: import("effect/Schema").Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
86
86
|
requiredForClient: false;
|
|
87
|
-
}), never> | import("effect/rpc/Rpc").Rpc<"identity.sessions.
|
|
88
|
-
id: import("effect/Schema").String;
|
|
89
|
-
}>, import("effect/Schema").Void, import("effect/Schema").Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").NotFound | typeof import("@shivaedev/errors/taxonomy.ts").Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable)[]>, typeof SessionsPermission, never> | import("effect/rpc/Rpc").Rpc<"identity.sessions.list", import("effect/Schema").Struct<{
|
|
87
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"identity.sessions.list", import("effect/Schema").Struct<{
|
|
90
88
|
readonly cursor: import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
|
|
91
89
|
readonly id: import("effect/Schema").String;
|
|
92
90
|
readonly lastActivityAt: import("effect/Schema").DateTimeUtcFromString;
|
|
@@ -116,6 +114,8 @@ export declare const SessionsPage: import("#page.ts").AdminPage & {
|
|
|
116
114
|
"~ClientError": never;
|
|
117
115
|
error: import("effect/Schema").Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
118
116
|
requiredForClient: false;
|
|
119
|
-
}), never
|
|
117
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"identity.sessions.revoke", import("effect/Schema").Struct<{
|
|
118
|
+
id: import("effect/Schema").String;
|
|
119
|
+
}>, import("effect/Schema").Void, import("effect/Schema").Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").NotFound | typeof import("@shivaedev/errors/taxonomy.ts").Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable)[]>, typeof SessionsPermission, never>, readonly [], undefined>;
|
|
120
120
|
};
|
|
121
121
|
//# sourceMappingURL=Page.d.ts.map
|
package/dist/users/page.d.ts
CHANGED
|
@@ -86,10 +86,7 @@ export declare function usersPage<const TRole extends string>(access: Pick<Acces
|
|
|
86
86
|
"~ClientError": never;
|
|
87
87
|
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
88
88
|
requiredForClient: false;
|
|
89
|
-
}), never> | import("effect/rpc/Rpc").Rpc<"admin.users.
|
|
90
|
-
role: Schema.Literals<TRole[]>;
|
|
91
|
-
userId: Schema.String;
|
|
92
|
-
}>, 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<{
|
|
89
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.users.list", Schema.Struct<{
|
|
93
90
|
readonly cursor: Schema.optionalKey<Schema.String>;
|
|
94
91
|
readonly limit: Schema.Number;
|
|
95
92
|
}>, Schema.Struct<{
|
|
@@ -110,6 +107,9 @@ export declare function usersPage<const TRole extends string>(access: Pick<Acces
|
|
|
110
107
|
"~ClientError": never;
|
|
111
108
|
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
112
109
|
requiredForClient: false;
|
|
113
|
-
}), never
|
|
110
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.users.changeRole", Schema.Struct<{
|
|
111
|
+
role: Schema.Literals<TRole[]>;
|
|
112
|
+
userId: Schema.String;
|
|
113
|
+
}>, Schema.Void, Schema.Union<readonly (typeof NotFound | typeof Forbidden | typeof AuthUnavailable | typeof LastRoleAssigner)[]>, typeof UsersPermission, never>, readonly [], undefined>;
|
|
114
114
|
};
|
|
115
115
|
//# sourceMappingURL=page.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/admin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.1",
|
|
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": {
|
|
@@ -42,27 +42,27 @@
|
|
|
42
42
|
"README.md"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@shivaedev/access": "0.
|
|
46
|
-
"@shivaedev/changes": "0.
|
|
47
|
-
"@shivaedev/contract": "0.
|
|
48
|
-
"@shivaedev/errors": "0.
|
|
49
|
-
"@shivaedev/identity": "0.
|
|
50
|
-
"@shivaedev/jobs": "0.
|
|
45
|
+
"@shivaedev/access": "0.6.0",
|
|
46
|
+
"@shivaedev/changes": "0.11.0",
|
|
47
|
+
"@shivaedev/contract": "0.40.0",
|
|
48
|
+
"@shivaedev/errors": "0.10.0",
|
|
49
|
+
"@shivaedev/identity": "0.28.0",
|
|
50
|
+
"@shivaedev/jobs": "0.40.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@effect/atom-react": "4.0
|
|
54
|
-
"@shivaedev/quality": "0.
|
|
55
|
-
"@shivaedev/rate-limit": "0.
|
|
56
|
-
"@shivaedev/react": "0.
|
|
57
|
-
"@shivaedev/server": "0.
|
|
58
|
-
"@shivaedev/sql": "0.
|
|
59
|
-
"@shivaedev/test-kits": "0.
|
|
60
|
-
"@shivaedev/test-sql": "0.
|
|
61
|
-
"@shivaedev/test-story": "0.
|
|
53
|
+
"@effect/atom-react": "4.1.0",
|
|
54
|
+
"@shivaedev/quality": "0.66.0",
|
|
55
|
+
"@shivaedev/rate-limit": "0.6.1",
|
|
56
|
+
"@shivaedev/react": "0.44.1",
|
|
57
|
+
"@shivaedev/server": "0.28.0",
|
|
58
|
+
"@shivaedev/sql": "0.43.0",
|
|
59
|
+
"@shivaedev/test-kits": "0.8.1",
|
|
60
|
+
"@shivaedev/test-sql": "0.24.1",
|
|
61
|
+
"@shivaedev/test-story": "0.42.1",
|
|
62
62
|
"@types/node": "24.19.2",
|
|
63
63
|
"@types/react": "19.3.0",
|
|
64
64
|
"@types/react-dom": "19.3.0",
|
|
65
|
-
"effect": "4.0
|
|
65
|
+
"effect": "4.1.0",
|
|
66
66
|
"happy-dom": "21.0.4",
|
|
67
67
|
"react": "19.3.1",
|
|
68
68
|
"react-dom": "19.3.1",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"vitest": "5.0.5"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
|
-
"@effect/atom-react": "4.0
|
|
74
|
-
"@shivaedev/react": "0.
|
|
75
|
-
"effect": "4.0
|
|
73
|
+
"@effect/atom-react": "4.1.0",
|
|
74
|
+
"@shivaedev/react": "0.44.1",
|
|
75
|
+
"effect": "4.1.0",
|
|
76
76
|
"react": "19.3.1"
|
|
77
77
|
},
|
|
78
78
|
"peerDependenciesMeta": {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import
|
|
3
|
-
import { HttpRouter, HttpServerResponse } from "effect/http";
|
|
2
|
+
import { HttpRouter, HttpServerRequest, HttpServerResponse } from "effect/http";
|
|
4
3
|
import * as HttpStatus from "effect/http/HttpStatus";
|
|
5
|
-
import { permissionRoute } from "@shivaedev/identity/server/
|
|
4
|
+
import { permissionRoute } from "@shivaedev/identity/server/adapters/permissionRoute.ts";
|
|
6
5
|
import { matchAdminRoute } from "#adapters/matchAdminRoute.ts";
|
|
7
6
|
import type { AnyAdminRegistry } from "#registry.ts";
|
|
8
7
|
|
|
@@ -18,7 +17,7 @@ export function adminDocuments<E, R>(
|
|
|
18
17
|
const route = matchAdminRoute(routes, path);
|
|
19
18
|
return route === undefined
|
|
20
19
|
? Effect.succeed(HttpServerResponse.empty({ status: HttpStatus.fromLiteral("NotFound") }))
|
|
21
|
-
: permissionRoute(route.permission)(handler)
|
|
20
|
+
: permissionRoute(route.permission)(Effect.flatMap(HttpServerRequest.HttpServerRequest, handler));
|
|
22
21
|
});
|
|
23
22
|
}),
|
|
24
23
|
);
|
|
@@ -2,7 +2,7 @@ import { Context, Layer } from "effect";
|
|
|
2
2
|
import type { RpcMiddleware } from "effect/rpc";
|
|
3
3
|
import type { Identity, SessionUser } from "@shivaedev/identity/identity.ts";
|
|
4
4
|
import type { IdentityFailures } from "@shivaedev/identity/middleware.ts";
|
|
5
|
-
import { permissionLayer } from "@shivaedev/identity/server/
|
|
5
|
+
import { permissionLayer } from "@shivaedev/identity/server/permissionLayer.ts";
|
|
6
6
|
import type { AnyAdminRegistry } from "#registry.ts";
|
|
7
7
|
|
|
8
8
|
export function pagePermissions(registry: AnyAdminRegistry) {
|