@shivaedev/admin 0.23.1 → 0.23.3
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 +20 -0
- package/dist/client/adapters/JobDetail.d.ts +1 -1
- package/dist/client/adapters/JobDetail.d.ts.map +1 -1
- package/dist/client/adapters/JobDetail.js +2 -2
- package/dist/client/adapters/JobDetail.js.map +1 -1
- package/dist/client/adapters/JobList.d.ts +1 -1
- package/dist/client/adapters/JobList.d.ts.map +1 -1
- package/dist/client/adapters/JobList.js +4 -4
- package/dist/client/adapters/JobList.js.map +1 -1
- package/dist/client/adapters/JobPagination.js +1 -1
- package/dist/client/adapters/JobPagination.js.map +1 -1
- package/dist/client/adapters/JobTable.d.ts +1 -1
- package/dist/client/adapters/JobTable.d.ts.map +1 -1
- package/dist/client/adapters/JobTable.js +1 -1
- package/dist/client/adapters/JobTable.js.map +1 -1
- package/dist/client/adapters/JobsMetrics.d.ts.map +1 -1
- package/dist/client/adapters/JobsMetrics.js +1 -1
- package/dist/client/adapters/JobsMetrics.js.map +1 -1
- package/dist/client/adapters/JobsQueryPanel.js +1 -1
- package/dist/client/adapters/JobsQueryPanel.js.map +1 -1
- package/dist/client/adapters/JobsQueueView.d.ts +1 -1
- package/dist/client/adapters/JobsQueueView.d.ts.map +1 -1
- package/dist/client/adapters/JobsQueueView.js +3 -3
- package/dist/client/adapters/JobsQueueView.js.map +1 -1
- package/dist/client/adapters/JobsView.d.ts +1 -1
- package/dist/client/adapters/JobsView.d.ts.map +1 -1
- package/dist/client/adapters/JobsView.js +3 -3
- package/dist/client/adapters/JobsView.js.map +1 -1
- package/dist/client/adapters/RunScheduleControl.d.ts +1 -1
- package/dist/client/adapters/RunScheduleControl.d.ts.map +1 -1
- package/dist/client/adapters/RunScheduleControl.js +1 -1
- package/dist/client/adapters/RunScheduleControl.js.map +1 -1
- package/dist/client/adapters/SessionsView.js +3 -3
- package/dist/client/adapters/SessionsView.js.map +1 -1
- package/dist/client/adapters/UsersView.d.ts.map +1 -1
- package/dist/client/adapters/UsersView.js +1 -1
- package/dist/client/adapters/UsersView.js.map +1 -1
- package/dist/jobs/entry.d.ts +1 -1
- package/dist/jobs/entry.d.ts.map +1 -1
- package/dist/jobs/retryPage.d.ts +96 -96
- package/dist/jobs/retryPage.d.ts.map +1 -1
- package/dist/jobs/retryPage.js +3 -3
- package/dist/jobs/retryPage.js.map +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/server/jobsHandlersWithRetry.js +1 -1
- package/dist/server/jobsHandlersWithRetry.js.map +1 -1
- package/dist/server/registerAdmin.js +1 -1
- package/dist/server/registerAdmin.js.map +1 -1
- package/package.json +25 -20
- package/src/client/adapters/JobDetail.tsx +3 -3
- package/src/client/adapters/JobList.tsx +5 -5
- package/src/client/adapters/JobPagination.tsx +1 -1
- package/src/client/adapters/JobTable.tsx +2 -2
- package/src/client/adapters/JobsMetrics.tsx +1 -1
- package/src/client/adapters/JobsQueryPanel.tsx +1 -1
- package/src/client/adapters/JobsQueueView.tsx +4 -4
- package/src/client/adapters/JobsView.ts +4 -4
- package/src/client/adapters/RunScheduleControl.tsx +2 -2
- package/src/client/adapters/SessionsView.ts +3 -3
- package/src/client/adapters/UsersView.ts +1 -1
- package/src/jobs/entry.ts +1 -1
- package/src/jobs/retryPage.ts +4 -4
- package/src/registry.ts +1 -1
- package/src/server/jobsHandlersWithRetry.ts +1 -1
- package/src/server/registerAdmin.ts +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useState } from "react";
|
|
2
2
|
import type { QueueDisplay } from "@shivaedev/jobs/display.ts";
|
|
3
3
|
import { useQuery } from "@shivaedev/react/client/resultState.ts";
|
|
4
|
-
import { JobList } from "
|
|
5
|
-
import { JobsMetrics } from "
|
|
6
|
-
import { JobsQueryPanel } from "
|
|
7
|
-
import type { JobsViewClient, RetryJob } from "
|
|
4
|
+
import { JobList } from "#client/adapters/JobList.tsx";
|
|
5
|
+
import { JobsMetrics } from "#client/adapters/JobsMetrics.tsx";
|
|
6
|
+
import { JobsQueryPanel } from "#client/adapters/JobsQueryPanel.tsx";
|
|
7
|
+
import type { JobsViewClient, RetryJob } from "#client/adapters/jobsTypes.ts";
|
|
8
8
|
|
|
9
9
|
export function JobsQueueView({
|
|
10
10
|
api,
|
|
@@ -2,10 +2,10 @@ import { Cause, Option, Predicate } from "effect";
|
|
|
2
2
|
import { createElement, useState } from "react";
|
|
3
3
|
import type { QueueDisplay } from "@shivaedev/jobs/display.ts";
|
|
4
4
|
import { useQuery } from "@shivaedev/react/client/resultState.ts";
|
|
5
|
-
import { JobsHealthMetrics } from "
|
|
6
|
-
import { JobsQueuePicker, JobsQueueView } from "
|
|
7
|
-
import type { JobsViewClient, RetryJob, RunScheduleNow } from "
|
|
8
|
-
import { RunScheduleControl } from "
|
|
5
|
+
import { JobsHealthMetrics } from "#client/adapters/JobsMetrics.tsx";
|
|
6
|
+
import { JobsQueuePicker, JobsQueueView } from "#client/adapters/JobsQueueView.tsx";
|
|
7
|
+
import type { JobsViewClient, RetryJob, RunScheduleNow } from "#client/adapters/jobsTypes.ts";
|
|
8
|
+
import { RunScheduleControl } from "#client/adapters/RunScheduleControl.tsx";
|
|
9
9
|
|
|
10
10
|
export interface JobsViewProps {
|
|
11
11
|
readonly api: JobsViewClient;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Option } from "effect";
|
|
2
2
|
import { useAction } from "@shivaedev/react/client/resultState.ts";
|
|
3
|
-
import { JobButton } from "
|
|
4
|
-
import type { RunScheduleNow } from "
|
|
3
|
+
import { JobButton } from "#client/adapters/JobButton.tsx";
|
|
4
|
+
import type { RunScheduleNow } from "#client/adapters/jobsTypes.ts";
|
|
5
5
|
|
|
6
6
|
export function RunScheduleControl({ queue, run }: { readonly queue: string; readonly run: RunScheduleNow }) {
|
|
7
7
|
const action = useAction(run);
|
|
@@ -5,9 +5,9 @@ import { createElement, useState } from "react";
|
|
|
5
5
|
import type { SessionList, SessionListInput, SignedInSession } from "@shivaedev/identity/sessions.ts";
|
|
6
6
|
import type { AtomServices } from "@shivaedev/react/AtomServices.ts";
|
|
7
7
|
import { useAction, useQuery } from "@shivaedev/react/client/resultState.ts";
|
|
8
|
-
import { SessionConfirmation } from "
|
|
9
|
-
import { SessionListView } from "
|
|
10
|
-
import { SessionPagination } from "
|
|
8
|
+
import { SessionConfirmation } from "#client/adapters/SessionConfirmation.tsx";
|
|
9
|
+
import { SessionListView } from "#client/adapters/SessionListView.tsx";
|
|
10
|
+
import { SessionPagination } from "#client/adapters/SessionPagination.tsx";
|
|
11
11
|
|
|
12
12
|
export interface SessionsViewProps<R, E> {
|
|
13
13
|
readonly currentSessionId: string | undefined;
|
|
@@ -4,9 +4,9 @@ import type * as Atom from "effect/reactivity/Atom";
|
|
|
4
4
|
import { createElement, useState } from "react";
|
|
5
5
|
import type { UserListInput } from "@shivaedev/identity/users.ts";
|
|
6
6
|
import { useAction, useQuery } from "@shivaedev/react/client/resultState.ts";
|
|
7
|
+
import { UsersTable } from "#client/adapters/UsersTable.tsx";
|
|
7
8
|
import type { ChangeRoleInput } from "#users/ChangeRoleInput.ts";
|
|
8
9
|
import type { UsersList } from "#users/page.ts";
|
|
9
|
-
import { UsersTable } from "./UsersTable.tsx";
|
|
10
10
|
|
|
11
11
|
export interface UsersViewProps<TRole extends string> {
|
|
12
12
|
readonly changeRole: Atom.AtomResultFn<ChangeRoleInput<TRole>, void, unknown>;
|
package/src/jobs/entry.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import type { QueueDisplay } from "@shivaedev/jobs/display.ts";
|
|
3
|
-
import type { JobsQueue } from "
|
|
3
|
+
import type { JobsQueue } from "#jobs/schemas.ts";
|
|
4
4
|
|
|
5
5
|
export type JobsEntry = (JobsQueue | { readonly name: string; readonly scheduleOptions?: { readonly key?: string } }) & QueueDisplay;
|
|
6
6
|
|
package/src/jobs/retryPage.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { Schema } from "effect";
|
|
|
2
2
|
import { contract } from "@shivaedev/contract/contract.ts";
|
|
3
3
|
import { command } from "@shivaedev/contract/operation.ts";
|
|
4
4
|
import { Forbidden } from "@shivaedev/errors/taxonomy.ts";
|
|
5
|
+
import type { JobsEntry } from "#jobs/entry.ts";
|
|
6
|
+
import { jobsKeys } from "#jobs/keys.ts";
|
|
7
|
+
import { jobsPage } from "#jobs/page.ts";
|
|
8
|
+
import { JobsFailures } from "#jobs/schemas.ts";
|
|
5
9
|
import { adminPage } from "#page.ts";
|
|
6
10
|
import { JobsPermission } from "#permissions.ts";
|
|
7
|
-
import type { JobsEntry } from "./entry.ts";
|
|
8
|
-
import { jobsKeys } from "./keys.ts";
|
|
9
|
-
import { jobsPage } from "./page.ts";
|
|
10
|
-
import { JobsFailures } from "./schemas.ts";
|
|
11
11
|
|
|
12
12
|
export class JobsNotFailed extends Schema.TaggedError<JobsNotFailed>()("JobsNotFailed", {
|
|
13
13
|
id: Schema.String,
|
package/src/registry.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RpcGroup } from "effect/rpc";
|
|
2
2
|
import { validateAdminRoutes } from "#adapters/validateAdminRoutes.ts";
|
|
3
|
-
import type { AdminPage } from "
|
|
3
|
+
import type { AdminPage } from "#page.ts";
|
|
4
4
|
|
|
5
5
|
export interface AdminRegistry<TPages extends readonly AdminPage[]> {
|
|
6
6
|
readonly group: RpcGroup.RpcGroup<RpcGroup.Rpcs<TPages[number]["contract"]>>;
|
|
@@ -6,7 +6,7 @@ import { type JobsEntry, type JobsPayload, jobsQueue } from "#jobs/entry.ts";
|
|
|
6
6
|
import { JobsNotFailed, type jobsPageWithRetry } from "#jobs/retryPage.ts";
|
|
7
7
|
import { JobsQueueUnregistered } from "#jobs/schemas.ts";
|
|
8
8
|
import { RetryJobs } from "#permissions.ts";
|
|
9
|
-
import { jobsFailures, jobsReadHandlers } from "
|
|
9
|
+
import { jobsFailures, jobsReadHandlers } from "#server/jobsHandlers.ts";
|
|
10
10
|
|
|
11
11
|
export function jobsHandlersWithRetry<const TQueues extends readonly JobsEntry[], TService>(
|
|
12
12
|
page: ReturnType<typeof jobsPageWithRetry<TQueues>>,
|
|
@@ -3,7 +3,7 @@ import type { Rpc, RpcGroup } from "effect/rpc";
|
|
|
3
3
|
import type { SessionPolicy } from "@shivaedev/identity/server/SessionPolicy.ts";
|
|
4
4
|
import type { AdminPage } from "#page.ts";
|
|
5
5
|
import type { AdminRegistry } from "#registry.ts";
|
|
6
|
-
import { pagePermissions } from "
|
|
6
|
+
import { pagePermissions } from "#server/pagePermissions.ts";
|
|
7
7
|
|
|
8
8
|
type HandlerLayers<TPages extends readonly AdminPage[]> = {
|
|
9
9
|
readonly [TPage in TPages[number] as TPage["id"]]: Layer.Layer<Rpc.ToHandler<RpcGroup.Rpcs<TPage["contract"]["application"]>>, unknown, unknown>;
|