@shivaedev/admin 0.21.0 → 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 +9 -0
- package/README.md +1 -1
- package/dist/jobs/page.d.ts +30 -30
- 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 +13 -13
- package/src/server/adminDocuments.ts +3 -4
- package/src/server/pagePermissions.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
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
|
+
|
|
3
12
|
## 0.21.0 - 2026-11-05
|
|
4
13
|
|
|
5
14
|
### Breaking
|
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/page.d.ts
CHANGED
|
@@ -218,7 +218,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
218
218
|
"~ClientError": never;
|
|
219
219
|
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]>;
|
|
220
220
|
requiredForClient: false;
|
|
221
|
-
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.
|
|
221
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
|
|
222
222
|
cursor: Schema.optionalKey<Schema.String>;
|
|
223
223
|
limit: Schema.Number;
|
|
224
224
|
queue: Schema.String;
|
|
@@ -238,6 +238,12 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
238
238
|
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
239
239
|
readonly data: Schema.Unknown;
|
|
240
240
|
readonly queue: Schema.Literal<string>;
|
|
241
|
+
readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
|
|
242
|
+
readonly sourceOutput: Schema.NullOr<Schema.Struct<{
|
|
243
|
+
readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
244
|
+
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
245
|
+
}>>;
|
|
246
|
+
readonly sourceQueue: Schema.Literal<string>;
|
|
241
247
|
}>[]>>;
|
|
242
248
|
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
243
249
|
}>, 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 | (import("effect/Context").Reference<<A, E, R>(effect: Effect.Effect<A, E, R>, request: {
|
|
@@ -248,7 +254,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
248
254
|
"~ClientError": never;
|
|
249
255
|
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]>;
|
|
250
256
|
requiredForClient: false;
|
|
251
|
-
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.
|
|
257
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
|
|
252
258
|
cursor: Schema.optionalKey<Schema.String>;
|
|
253
259
|
limit: Schema.Number;
|
|
254
260
|
queue: Schema.String;
|
|
@@ -268,12 +274,6 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
268
274
|
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
269
275
|
readonly data: Schema.Unknown;
|
|
270
276
|
readonly queue: Schema.Literal<string>;
|
|
271
|
-
readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
|
|
272
|
-
readonly sourceOutput: Schema.NullOr<Schema.Struct<{
|
|
273
|
-
readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
274
|
-
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
275
|
-
}>>;
|
|
276
|
-
readonly sourceQueue: Schema.Literal<string>;
|
|
277
277
|
}>[]>>;
|
|
278
278
|
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
279
279
|
}>, 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 | (import("effect/Context").Reference<<A, E, R>(effect: Effect.Effect<A, E, R>, request: {
|
|
@@ -284,6 +284,28 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
284
284
|
"~ClientError": never;
|
|
285
285
|
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]>;
|
|
286
286
|
requiredForClient: false;
|
|
287
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
|
|
288
|
+
readonly activeTotal: Schema.Number;
|
|
289
|
+
readonly deadLetteredTotal: Schema.Number;
|
|
290
|
+
readonly failedTotal: Schema.Number;
|
|
291
|
+
readonly jobs: Schema.$Array<Schema.Struct<{
|
|
292
|
+
readonly activeCount: Schema.Number;
|
|
293
|
+
readonly deadLetteredCount: Schema.Number;
|
|
294
|
+
readonly failedCount: Schema.Number;
|
|
295
|
+
readonly name: Schema.String;
|
|
296
|
+
readonly queuedCount: Schema.Number;
|
|
297
|
+
readonly readyCount: Schema.Number;
|
|
298
|
+
}>>;
|
|
299
|
+
readonly queuedTotal: Schema.Number;
|
|
300
|
+
readonly readyTotal: Schema.Number;
|
|
301
|
+
}>, 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 | (import("effect/Context").Reference<<A, E, R>(effect: Effect.Effect<A, E, R>, request: {
|
|
302
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
303
|
+
readonly payload: unknown;
|
|
304
|
+
}) => Effect.Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
305
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
306
|
+
"~ClientError": never;
|
|
307
|
+
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]>;
|
|
308
|
+
requiredForClient: false;
|
|
287
309
|
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
|
|
288
310
|
id: Schema.String;
|
|
289
311
|
queue: Schema.String;
|
|
@@ -310,28 +332,6 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
310
332
|
"~ClientError": never;
|
|
311
333
|
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]>;
|
|
312
334
|
requiredForClient: false;
|
|
313
|
-
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
|
|
314
|
-
readonly activeTotal: Schema.Number;
|
|
315
|
-
readonly deadLetteredTotal: Schema.Number;
|
|
316
|
-
readonly failedTotal: Schema.Number;
|
|
317
|
-
readonly jobs: Schema.$Array<Schema.Struct<{
|
|
318
|
-
readonly activeCount: Schema.Number;
|
|
319
|
-
readonly deadLetteredCount: Schema.Number;
|
|
320
|
-
readonly failedCount: Schema.Number;
|
|
321
|
-
readonly name: Schema.String;
|
|
322
|
-
readonly queuedCount: Schema.Number;
|
|
323
|
-
readonly readyCount: Schema.Number;
|
|
324
|
-
}>>;
|
|
325
|
-
readonly queuedTotal: Schema.Number;
|
|
326
|
-
readonly readyTotal: Schema.Number;
|
|
327
|
-
}>, 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 | (import("effect/Context").Reference<<A, E, R>(effect: Effect.Effect<A, E, R>, request: {
|
|
328
|
-
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
329
|
-
readonly payload: unknown;
|
|
330
|
-
}) => Effect.Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
331
|
-
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
332
|
-
"~ClientError": never;
|
|
333
|
-
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]>;
|
|
334
|
-
requiredForClient: false;
|
|
335
335
|
}), never>, readonly [], undefined>;
|
|
336
336
|
} & {
|
|
337
337
|
queues: TQueues;
|
|
@@ -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.21.
|
|
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": {
|
|
@@ -44,21 +44,21 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@shivaedev/access": "0.6.0",
|
|
46
46
|
"@shivaedev/changes": "0.11.0",
|
|
47
|
-
"@shivaedev/contract": "0.
|
|
47
|
+
"@shivaedev/contract": "0.40.0",
|
|
48
48
|
"@shivaedev/errors": "0.10.0",
|
|
49
|
-
"@shivaedev/identity": "0.
|
|
50
|
-
"@shivaedev/jobs": "0.
|
|
49
|
+
"@shivaedev/identity": "0.28.0",
|
|
50
|
+
"@shivaedev/jobs": "0.40.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@effect/atom-react": "4.1.0",
|
|
54
|
-
"@shivaedev/quality": "0.
|
|
55
|
-
"@shivaedev/rate-limit": "0.6.
|
|
56
|
-
"@shivaedev/react": "0.44.
|
|
57
|
-
"@shivaedev/server": "0.
|
|
58
|
-
"@shivaedev/sql": "0.
|
|
59
|
-
"@shivaedev/test-kits": "0.8.
|
|
60
|
-
"@shivaedev/test-sql": "0.24.
|
|
61
|
-
"@shivaedev/test-story": "0.42.
|
|
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",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"@effect/atom-react": "4.1.0",
|
|
74
|
-
"@shivaedev/react": "0.44.
|
|
74
|
+
"@shivaedev/react": "0.44.1",
|
|
75
75
|
"effect": "4.1.0",
|
|
76
76
|
"react": "19.3.1"
|
|
77
77
|
},
|
|
@@ -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) {
|