@shivaedev/admin 0.1.5 → 0.3.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.
- package/README.md +50 -0
- package/dist/jobs/keys.d.ts +8 -0
- package/dist/jobs/keys.d.ts.map +1 -0
- package/dist/jobs/keys.js +10 -0
- package/dist/jobs/keys.js.map +1 -0
- package/dist/jobs/page.d.ts +223 -0
- package/dist/jobs/page.d.ts.map +1 -0
- package/dist/jobs/page.js +45 -0
- package/dist/jobs/page.js.map +1 -0
- package/dist/jobs/retryPage.d.ts +241 -0
- package/dist/jobs/retryPage.d.ts.map +1 -0
- package/dist/jobs/retryPage.js +36 -0
- package/dist/jobs/retryPage.js.map +1 -0
- package/dist/jobs/schemas.d.ts +112 -0
- package/dist/jobs/schemas.d.ts.map +1 -0
- package/dist/jobs/schemas.js +65 -0
- package/dist/jobs/schemas.js.map +1 -0
- package/dist/page.d.ts +3 -5
- package/dist/page.d.ts.map +1 -1
- package/dist/page.js.map +1 -1
- package/dist/server/jobsHandlers.d.ts +49 -0
- package/dist/server/jobsHandlers.d.ts.map +1 -0
- package/dist/server/jobsHandlers.js +63 -0
- package/dist/server/jobsHandlers.js.map +1 -0
- package/dist/server/jobsHandlersWithRetry.d.ts +6 -0
- package/dist/server/jobsHandlersWithRetry.d.ts.map +1 -0
- package/dist/server/jobsHandlersWithRetry.js +22 -0
- package/dist/server/jobsHandlersWithRetry.js.map +1 -0
- package/package.json +5 -3
- package/src/jobs/keys.ts +10 -0
- package/src/jobs/page.ts +45 -0
- package/src/jobs/retryPage.ts +39 -0
- package/src/jobs/schemas.ts +78 -0
- package/src/page.ts +8 -1
- package/src/server/jobsHandlers.ts +83 -0
- package/src/server/jobsHandlersWithRetry.ts +27 -0
package/README.md
CHANGED
|
@@ -60,3 +60,53 @@ const handlers = registration.handlers.pipe(
|
|
|
60
60
|
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
61
|
|
|
62
62
|
Page declarations and the registry are browser-safe. Server registration lives under `/server`; views belong in the application. This package ships no UI components and adds no transport. The package's stories prove role enforcement through native in-process RPC, with an already resolved session as a precondition.
|
|
63
|
+
|
|
64
|
+
## Built-in Jobs page
|
|
65
|
+
|
|
66
|
+
Share each queue's name and payload Schema with the browser declaration. The page exposes only the queues passed to `jobsPage`; a queue registered with the jobs runtime is not automatically available to operators.
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
import { Schema } from "effect";
|
|
70
|
+
import { jobsPage } from "@shivaedev/admin/jobs/page.ts";
|
|
71
|
+
import { adminRegistry } from "@shivaedev/admin/registry.ts";
|
|
72
|
+
|
|
73
|
+
const MailPayload = Schema.Struct({ id: Schema.NumberFromString });
|
|
74
|
+
const JobsPage = jobsPage({ name: "mail", schema: MailPayload });
|
|
75
|
+
const Admin = adminRegistry(JobsPage);
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Register its handlers with the application's existing `makePgBoss` service:
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import { jobsHandlers } from "@shivaedev/admin/server/jobsHandlers.ts";
|
|
82
|
+
import { registerAdmin } from "@shivaedev/admin/server/registerAdmin.ts";
|
|
83
|
+
|
|
84
|
+
const registration = registerAdmin(Admin, {
|
|
85
|
+
jobs: jobsHandlers(JobsPage, JobsService),
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
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
|
+
|
|
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.
|
|
92
|
+
|
|
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.
|
|
94
|
+
|
|
95
|
+
### Declare retry explicitly
|
|
96
|
+
|
|
97
|
+
Use `jobsPageWithRetry` and `jobsHandlersWithRetry` when administrators should be able to retry failed original jobs:
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
import { jobsPageWithRetry } from "@shivaedev/admin/jobs/retryPage.ts";
|
|
101
|
+
import { jobsHandlersWithRetry } from "@shivaedev/admin/server/jobsHandlersWithRetry.ts";
|
|
102
|
+
|
|
103
|
+
const JobsPage = jobsPageWithRetry({ name: "mail", schema: MailPayload });
|
|
104
|
+
const Admin = adminRegistry(JobsPage);
|
|
105
|
+
const registration = registerAdmin(Admin, {
|
|
106
|
+
jobs: jobsHandlersWithRetry(JobsPage, JobsService),
|
|
107
|
+
});
|
|
108
|
+
```
|
|
109
|
+
|
|
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.
|
|
111
|
+
|
|
112
|
+
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.
|
|
@@ -0,0 +1,8 @@
|
|
|
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>;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/jobs/keys.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ;IACpB,MAAM;IACN,YAAY;IACZ,MAAM;IACN,MAAM;IACN,GAAG,UAAU,MAAM;CACnB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { collection } from "@shivaedev/effect-contract/keys.ts";
|
|
3
|
+
export const jobsKeys = {
|
|
4
|
+
counts: collection("admin.jobs.counts", Schema.String),
|
|
5
|
+
deadLettered: collection("admin.jobs.deadLettered", Schema.String),
|
|
6
|
+
failed: collection("admin.jobs.failed", Schema.String),
|
|
7
|
+
health: collection("admin.jobs.health", Schema.String),
|
|
8
|
+
job: (queue) => collection(`admin.jobs.job.${queue}`, Schema.String),
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=keys.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type JobsQueue } from "./schemas.ts";
|
|
3
|
+
export declare function jobsPage<const TQueues extends readonly JobsQueue[]>(...queues: TQueues): import("#page.ts").AdminPage & {
|
|
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<{
|
|
6
|
+
readonly activeTotal: Schema.Number;
|
|
7
|
+
readonly deadLetteredTotal: Schema.Number;
|
|
8
|
+
readonly failedTotal: Schema.Number;
|
|
9
|
+
readonly jobs: Schema.$Array<Schema.Struct<{
|
|
10
|
+
readonly activeCount: Schema.Number;
|
|
11
|
+
readonly deadLetteredCount: Schema.Number;
|
|
12
|
+
readonly failedCount: Schema.Number;
|
|
13
|
+
readonly name: Schema.String;
|
|
14
|
+
readonly queuedCount: Schema.Number;
|
|
15
|
+
readonly readyCount: Schema.Number;
|
|
16
|
+
}>>;
|
|
17
|
+
readonly queuedTotal: Schema.Number;
|
|
18
|
+
readonly readyTotal: Schema.Number;
|
|
19
|
+
}>, {
|
|
20
|
+
JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
|
|
21
|
+
JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
|
|
22
|
+
JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
|
|
23
|
+
}>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"counts", Schema.Struct<{
|
|
24
|
+
queue: Schema.String;
|
|
25
|
+
}>, Schema.Struct<{
|
|
26
|
+
readonly activeCount: Schema.Number;
|
|
27
|
+
readonly failedCount: Schema.Number;
|
|
28
|
+
readonly queuedCount: Schema.Number;
|
|
29
|
+
readonly totalCount: Schema.Number;
|
|
30
|
+
}>, {
|
|
31
|
+
JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
|
|
32
|
+
JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
|
|
33
|
+
JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
|
|
34
|
+
}>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"failed", Schema.Struct<{
|
|
35
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
36
|
+
limit: Schema.Number;
|
|
37
|
+
queue: Schema.String;
|
|
38
|
+
}>, Schema.Struct<{
|
|
39
|
+
readonly jobs: Schema.$Array<Schema.Union<Schema.Struct<{
|
|
40
|
+
readonly attempt: Schema.Number;
|
|
41
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
42
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
43
|
+
readonly id: Schema.String;
|
|
44
|
+
readonly output: Schema.Unknown;
|
|
45
|
+
readonly retryCount: Schema.Number;
|
|
46
|
+
readonly retryLimit: Schema.Number;
|
|
47
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
48
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
49
|
+
readonly data: TQueues[number]["schema"];
|
|
50
|
+
readonly queue: Schema.Literal<string>;
|
|
51
|
+
}>[]>>;
|
|
52
|
+
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
53
|
+
}>, {
|
|
54
|
+
JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
|
|
55
|
+
JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
|
|
56
|
+
JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
|
|
57
|
+
}>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"deadLettered", Schema.Struct<{
|
|
58
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
59
|
+
limit: Schema.Number;
|
|
60
|
+
queue: Schema.String;
|
|
61
|
+
}>, Schema.Struct<{
|
|
62
|
+
readonly jobs: Schema.$Array<Schema.Union<Schema.Struct<{
|
|
63
|
+
readonly attempt: Schema.Number;
|
|
64
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
65
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
66
|
+
readonly id: Schema.String;
|
|
67
|
+
readonly output: Schema.Unknown;
|
|
68
|
+
readonly retryCount: Schema.Number;
|
|
69
|
+
readonly retryLimit: Schema.Number;
|
|
70
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
71
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
72
|
+
readonly data: TQueues[number]["schema"];
|
|
73
|
+
readonly queue: Schema.Literal<string>;
|
|
74
|
+
readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
|
|
75
|
+
readonly sourceOutput: Schema.Unknown;
|
|
76
|
+
}>[]>>;
|
|
77
|
+
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
78
|
+
}>, {
|
|
79
|
+
JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
|
|
80
|
+
JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
|
|
81
|
+
JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
|
|
82
|
+
}>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"job", Schema.Struct<{
|
|
83
|
+
id: Schema.String;
|
|
84
|
+
queue: Schema.String;
|
|
85
|
+
}>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
|
|
86
|
+
readonly attempt: Schema.Number;
|
|
87
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
88
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
89
|
+
readonly id: Schema.String;
|
|
90
|
+
readonly output: Schema.Unknown;
|
|
91
|
+
readonly retryCount: Schema.Number;
|
|
92
|
+
readonly retryLimit: Schema.Number;
|
|
93
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
94
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
95
|
+
readonly data: TQueues[number]["schema"];
|
|
96
|
+
readonly queue: Schema.Literal<string>;
|
|
97
|
+
}>[]>>, {
|
|
98
|
+
JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
|
|
99
|
+
JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
|
|
100
|
+
JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
|
|
101
|
+
}>>], readonly [], import("effect/rpc/Rpc").Rpc<"admin.jobs.$changes", Schema.Struct<{
|
|
102
|
+
queries: Schema.$Array<Schema.Union<readonly (Schema.Struct<{
|
|
103
|
+
query: Schema.Literal<"counts">;
|
|
104
|
+
payload: Schema.Struct<{
|
|
105
|
+
queue: Schema.String;
|
|
106
|
+
}>;
|
|
107
|
+
}> | Schema.Struct<{
|
|
108
|
+
query: Schema.Literal<"deadLettered">;
|
|
109
|
+
payload: Schema.Struct<{
|
|
110
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
111
|
+
limit: Schema.Number;
|
|
112
|
+
queue: Schema.String;
|
|
113
|
+
}>;
|
|
114
|
+
}> | Schema.Struct<{
|
|
115
|
+
query: Schema.Literal<"failed">;
|
|
116
|
+
payload: Schema.Struct<{
|
|
117
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
118
|
+
limit: Schema.Number;
|
|
119
|
+
queue: Schema.String;
|
|
120
|
+
}>;
|
|
121
|
+
}> | Schema.Struct<{
|
|
122
|
+
query: Schema.Literal<"health">;
|
|
123
|
+
payload: Schema.Void;
|
|
124
|
+
}> | Schema.Struct<{
|
|
125
|
+
query: Schema.Literal<"job">;
|
|
126
|
+
payload: Schema.Struct<{
|
|
127
|
+
id: Schema.String;
|
|
128
|
+
queue: Schema.String;
|
|
129
|
+
}>;
|
|
130
|
+
}>)[]>>;
|
|
131
|
+
}>, import("effect/rpc/RpcSchema").Stream<Schema.Union<readonly [Schema.Struct<{
|
|
132
|
+
readonly _tag: Schema.Literal<"Changed">;
|
|
133
|
+
readonly keys: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
134
|
+
readonly _tag: Schema.Literal<"List">;
|
|
135
|
+
readonly collection: Schema.String;
|
|
136
|
+
}>, Schema.Struct<{
|
|
137
|
+
readonly _tag: Schema.Literal<"Item">;
|
|
138
|
+
readonly collection: Schema.String;
|
|
139
|
+
readonly id: Schema.Union<readonly [Schema.String, Schema.Number]>;
|
|
140
|
+
}>]>>;
|
|
141
|
+
}>, Schema.Struct<{
|
|
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<{
|
|
144
|
+
queue: Schema.String;
|
|
145
|
+
}>, Schema.Struct<{
|
|
146
|
+
readonly activeCount: Schema.Number;
|
|
147
|
+
readonly failedCount: Schema.Number;
|
|
148
|
+
readonly queuedCount: Schema.Number;
|
|
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<{
|
|
151
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
152
|
+
limit: Schema.Number;
|
|
153
|
+
queue: Schema.String;
|
|
154
|
+
}>, Schema.Struct<{
|
|
155
|
+
readonly jobs: Schema.$Array<Schema.Union<Schema.Struct<{
|
|
156
|
+
readonly attempt: Schema.Number;
|
|
157
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
158
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
159
|
+
readonly id: Schema.String;
|
|
160
|
+
readonly output: Schema.Unknown;
|
|
161
|
+
readonly retryCount: Schema.Number;
|
|
162
|
+
readonly retryLimit: Schema.Number;
|
|
163
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
164
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
165
|
+
readonly data: TQueues[number]["schema"];
|
|
166
|
+
readonly queue: Schema.Literal<string>;
|
|
167
|
+
readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
|
|
168
|
+
readonly sourceOutput: Schema.Unknown;
|
|
169
|
+
}>[]>>;
|
|
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<{
|
|
172
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
173
|
+
limit: Schema.Number;
|
|
174
|
+
queue: Schema.String;
|
|
175
|
+
}>, Schema.Struct<{
|
|
176
|
+
readonly jobs: Schema.$Array<Schema.Union<Schema.Struct<{
|
|
177
|
+
readonly attempt: Schema.Number;
|
|
178
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
179
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
180
|
+
readonly id: Schema.String;
|
|
181
|
+
readonly output: Schema.Unknown;
|
|
182
|
+
readonly retryCount: Schema.Number;
|
|
183
|
+
readonly retryLimit: Schema.Number;
|
|
184
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
185
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
186
|
+
readonly data: TQueues[number]["schema"];
|
|
187
|
+
readonly queue: Schema.Literal<string>;
|
|
188
|
+
}>[]>>;
|
|
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<{
|
|
191
|
+
readonly activeTotal: Schema.Number;
|
|
192
|
+
readonly deadLetteredTotal: Schema.Number;
|
|
193
|
+
readonly failedTotal: Schema.Number;
|
|
194
|
+
readonly jobs: Schema.$Array<Schema.Struct<{
|
|
195
|
+
readonly activeCount: Schema.Number;
|
|
196
|
+
readonly deadLetteredCount: Schema.Number;
|
|
197
|
+
readonly failedCount: Schema.Number;
|
|
198
|
+
readonly name: Schema.String;
|
|
199
|
+
readonly queuedCount: Schema.Number;
|
|
200
|
+
readonly readyCount: Schema.Number;
|
|
201
|
+
}>>;
|
|
202
|
+
readonly queuedTotal: Schema.Number;
|
|
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<{
|
|
205
|
+
id: Schema.String;
|
|
206
|
+
queue: Schema.String;
|
|
207
|
+
}>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
|
|
208
|
+
readonly attempt: Schema.Number;
|
|
209
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
210
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
211
|
+
readonly id: Schema.String;
|
|
212
|
+
readonly output: Schema.Unknown;
|
|
213
|
+
readonly retryCount: Schema.Number;
|
|
214
|
+
readonly retryLimit: Schema.Number;
|
|
215
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
216
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
217
|
+
readonly data: TQueues[number]["schema"];
|
|
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>;
|
|
220
|
+
} & {
|
|
221
|
+
queues: TQueues;
|
|
222
|
+
};
|
|
223
|
+
//# sourceMappingURL=page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/jobs/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKhC,OAAO,EAAgD,KAAK,SAAS,EAA+C,MAAM,cAAc,CAAC;AAEzI,wBAAgB,QAAQ,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,SAAS,EAAE,EAAE,GAAG,MAAM,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqCtF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { contract } from "@shivaedev/effect-contract/contract.ts";
|
|
3
|
+
import { query } from "@shivaedev/effect-contract/operation.ts";
|
|
4
|
+
import { adminPage } from "#page.ts";
|
|
5
|
+
import { jobsKeys } from "./keys.js";
|
|
6
|
+
import { deadLetteredSchema, JobsFailures, JobsHealth, jobPage, jobSchema, PageFields, QueueCounts } from "./schemas.js";
|
|
7
|
+
export function jobsPage(...queues) {
|
|
8
|
+
const Job = Schema.Union(queues.map((queue) => jobSchema(queue)));
|
|
9
|
+
const DeadLettered = Schema.Union(queues.map((queue) => deadLetteredSchema(queue)));
|
|
10
|
+
const page = adminPage({
|
|
11
|
+
contract: contract("admin.jobs", {
|
|
12
|
+
queries: [
|
|
13
|
+
query("health", { reads: () => [jobsKeys.health.list], rejections: JobsFailures, success: JobsHealth }),
|
|
14
|
+
query("counts", {
|
|
15
|
+
payload: { queue: Schema.String },
|
|
16
|
+
reads: ({ queue }) => [jobsKeys.counts.item(queue)],
|
|
17
|
+
rejections: JobsFailures,
|
|
18
|
+
success: QueueCounts,
|
|
19
|
+
}),
|
|
20
|
+
query("failed", {
|
|
21
|
+
payload: { ...PageFields, queue: Schema.String },
|
|
22
|
+
reads: ({ queue }) => [jobsKeys.failed.item(queue)],
|
|
23
|
+
rejections: JobsFailures,
|
|
24
|
+
success: jobPage(Job),
|
|
25
|
+
}),
|
|
26
|
+
query("deadLettered", {
|
|
27
|
+
payload: { ...PageFields, queue: Schema.String },
|
|
28
|
+
reads: ({ queue }) => [jobsKeys.deadLettered.item(queue)],
|
|
29
|
+
rejections: JobsFailures,
|
|
30
|
+
success: jobPage(DeadLettered),
|
|
31
|
+
}),
|
|
32
|
+
query("job", {
|
|
33
|
+
payload: { id: Schema.String, queue: Schema.String },
|
|
34
|
+
reads: ({ queue, id }) => [jobsKeys.job(queue).item(id)],
|
|
35
|
+
rejections: JobsFailures,
|
|
36
|
+
success: Schema.OptionFromNullOr(Job),
|
|
37
|
+
}),
|
|
38
|
+
],
|
|
39
|
+
}),
|
|
40
|
+
id: "jobs",
|
|
41
|
+
route: { path: "/admin/jobs", title: "Jobs" },
|
|
42
|
+
});
|
|
43
|
+
return Object.assign(page, { queues });
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../src/jobs/page.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type JobsQueue } from "./schemas.ts";
|
|
3
|
+
declare const JobsNotFailed_base: Schema.Class<JobsNotFailed, Schema.TaggedStruct<"JobsNotFailed", {
|
|
4
|
+
readonly id: Schema.String;
|
|
5
|
+
readonly queue: Schema.String;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
export declare class JobsNotFailed extends JobsNotFailed_base {
|
|
8
|
+
}
|
|
9
|
+
export declare function jobsPageWithRetry<const TQueues extends readonly JobsQueue[]>(...queues: TQueues): import("#page.ts").AdminPage & {
|
|
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<{
|
|
12
|
+
readonly activeTotal: Schema.Number;
|
|
13
|
+
readonly deadLetteredTotal: Schema.Number;
|
|
14
|
+
readonly failedTotal: Schema.Number;
|
|
15
|
+
readonly jobs: Schema.$Array<Schema.Struct<{
|
|
16
|
+
readonly activeCount: Schema.Number;
|
|
17
|
+
readonly deadLetteredCount: Schema.Number;
|
|
18
|
+
readonly failedCount: Schema.Number;
|
|
19
|
+
readonly name: Schema.String;
|
|
20
|
+
readonly queuedCount: Schema.Number;
|
|
21
|
+
readonly readyCount: Schema.Number;
|
|
22
|
+
}>>;
|
|
23
|
+
readonly queuedTotal: Schema.Number;
|
|
24
|
+
readonly readyTotal: Schema.Number;
|
|
25
|
+
}>, {
|
|
26
|
+
JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
|
|
27
|
+
JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
|
|
28
|
+
JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
|
|
29
|
+
}>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"counts", Schema.Struct<{
|
|
30
|
+
queue: Schema.String;
|
|
31
|
+
}>, Schema.Struct<{
|
|
32
|
+
readonly activeCount: Schema.Number;
|
|
33
|
+
readonly failedCount: Schema.Number;
|
|
34
|
+
readonly queuedCount: Schema.Number;
|
|
35
|
+
readonly totalCount: Schema.Number;
|
|
36
|
+
}>, {
|
|
37
|
+
JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
|
|
38
|
+
JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
|
|
39
|
+
JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
|
|
40
|
+
}>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"failed", Schema.Struct<{
|
|
41
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
42
|
+
limit: Schema.Number;
|
|
43
|
+
queue: Schema.String;
|
|
44
|
+
}>, Schema.Struct<{
|
|
45
|
+
readonly jobs: Schema.$Array<Schema.Union<Schema.Struct<{
|
|
46
|
+
readonly attempt: Schema.Number;
|
|
47
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
48
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
49
|
+
readonly id: Schema.String;
|
|
50
|
+
readonly output: Schema.Unknown;
|
|
51
|
+
readonly retryCount: Schema.Number;
|
|
52
|
+
readonly retryLimit: Schema.Number;
|
|
53
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
54
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
55
|
+
readonly data: [...TQueues][number]["schema"];
|
|
56
|
+
readonly queue: Schema.Literal<string>;
|
|
57
|
+
}>[]>>;
|
|
58
|
+
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
59
|
+
}>, {
|
|
60
|
+
JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
|
|
61
|
+
JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
|
|
62
|
+
JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
|
|
63
|
+
}>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"deadLettered", Schema.Struct<{
|
|
64
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
65
|
+
limit: Schema.Number;
|
|
66
|
+
queue: Schema.String;
|
|
67
|
+
}>, Schema.Struct<{
|
|
68
|
+
readonly jobs: Schema.$Array<Schema.Union<Schema.Struct<{
|
|
69
|
+
readonly attempt: Schema.Number;
|
|
70
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
71
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
72
|
+
readonly id: Schema.String;
|
|
73
|
+
readonly output: Schema.Unknown;
|
|
74
|
+
readonly retryCount: Schema.Number;
|
|
75
|
+
readonly retryLimit: Schema.Number;
|
|
76
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
77
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
78
|
+
readonly data: [...TQueues][number]["schema"];
|
|
79
|
+
readonly queue: Schema.Literal<string>;
|
|
80
|
+
readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
|
|
81
|
+
readonly sourceOutput: Schema.Unknown;
|
|
82
|
+
}>[]>>;
|
|
83
|
+
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
84
|
+
}>, {
|
|
85
|
+
JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
|
|
86
|
+
JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
|
|
87
|
+
JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
|
|
88
|
+
}>>, NoInfer<import("@shivaedev/effect-contract/operation.ts").Query<"job", Schema.Struct<{
|
|
89
|
+
id: Schema.String;
|
|
90
|
+
queue: Schema.String;
|
|
91
|
+
}>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
|
|
92
|
+
readonly attempt: Schema.Number;
|
|
93
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
94
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
95
|
+
readonly id: Schema.String;
|
|
96
|
+
readonly output: Schema.Unknown;
|
|
97
|
+
readonly retryCount: Schema.Number;
|
|
98
|
+
readonly retryLimit: Schema.Number;
|
|
99
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
100
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
101
|
+
readonly data: [...TQueues][number]["schema"];
|
|
102
|
+
readonly queue: Schema.Literal<string>;
|
|
103
|
+
}>[]>>, {
|
|
104
|
+
JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
|
|
105
|
+
JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
|
|
106
|
+
JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
|
|
107
|
+
}>>], readonly [NoInfer<import("@shivaedev/effect-contract/operation.ts").Command<"retry", Schema.Struct<{
|
|
108
|
+
id: Schema.String;
|
|
109
|
+
queue: Schema.String;
|
|
110
|
+
}>, Schema.Void, {
|
|
111
|
+
readonly JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
|
|
112
|
+
readonly JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
|
|
113
|
+
readonly JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
|
|
114
|
+
readonly JobsNotFailed: typeof JobsNotFailed;
|
|
115
|
+
}>>], import("effect/rpc/Rpc").Rpc<"admin.jobs.$changes", Schema.Struct<{
|
|
116
|
+
queries: Schema.$Array<Schema.Union<readonly (Schema.Struct<{
|
|
117
|
+
query: Schema.Literal<"counts">;
|
|
118
|
+
payload: Schema.Struct<{
|
|
119
|
+
queue: Schema.String;
|
|
120
|
+
}>;
|
|
121
|
+
}> | Schema.Struct<{
|
|
122
|
+
query: Schema.Literal<"deadLettered">;
|
|
123
|
+
payload: Schema.Struct<{
|
|
124
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
125
|
+
limit: Schema.Number;
|
|
126
|
+
queue: Schema.String;
|
|
127
|
+
}>;
|
|
128
|
+
}> | Schema.Struct<{
|
|
129
|
+
query: Schema.Literal<"failed">;
|
|
130
|
+
payload: Schema.Struct<{
|
|
131
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
132
|
+
limit: Schema.Number;
|
|
133
|
+
queue: Schema.String;
|
|
134
|
+
}>;
|
|
135
|
+
}> | Schema.Struct<{
|
|
136
|
+
query: Schema.Literal<"health">;
|
|
137
|
+
payload: Schema.Void;
|
|
138
|
+
}> | Schema.Struct<{
|
|
139
|
+
query: Schema.Literal<"job">;
|
|
140
|
+
payload: Schema.Struct<{
|
|
141
|
+
id: Schema.String;
|
|
142
|
+
queue: Schema.String;
|
|
143
|
+
}>;
|
|
144
|
+
}>)[]>>;
|
|
145
|
+
}>, import("effect/rpc/RpcSchema").Stream<Schema.Union<readonly [Schema.Struct<{
|
|
146
|
+
readonly _tag: Schema.Literal<"Changed">;
|
|
147
|
+
readonly keys: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
148
|
+
readonly _tag: Schema.Literal<"List">;
|
|
149
|
+
readonly collection: Schema.String;
|
|
150
|
+
}>, Schema.Struct<{
|
|
151
|
+
readonly _tag: Schema.Literal<"Item">;
|
|
152
|
+
readonly collection: Schema.String;
|
|
153
|
+
readonly id: Schema.Union<readonly [Schema.String, Schema.Number]>;
|
|
154
|
+
}>]>>;
|
|
155
|
+
}>, Schema.Struct<{
|
|
156
|
+
readonly _tag: Schema.Literal<"Resync">;
|
|
157
|
+
}>]>, Schema.Never>, Schema.Never, typeof import("@shivaedev/platform/rpc/middleware.ts").AuthenticatedAdmin, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.counts", Schema.Struct<{
|
|
158
|
+
queue: Schema.String;
|
|
159
|
+
}>, Schema.Struct<{
|
|
160
|
+
readonly activeCount: Schema.Number;
|
|
161
|
+
readonly failedCount: Schema.Number;
|
|
162
|
+
readonly queuedCount: Schema.Number;
|
|
163
|
+
readonly totalCount: Schema.Number;
|
|
164
|
+
}>, 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<{
|
|
165
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
166
|
+
limit: Schema.Number;
|
|
167
|
+
queue: Schema.String;
|
|
168
|
+
}>, Schema.Struct<{
|
|
169
|
+
readonly jobs: Schema.$Array<Schema.Union<Schema.Struct<{
|
|
170
|
+
readonly attempt: Schema.Number;
|
|
171
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
172
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
173
|
+
readonly id: Schema.String;
|
|
174
|
+
readonly output: Schema.Unknown;
|
|
175
|
+
readonly retryCount: Schema.Number;
|
|
176
|
+
readonly retryLimit: Schema.Number;
|
|
177
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
178
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
179
|
+
readonly data: [...TQueues][number]["schema"];
|
|
180
|
+
readonly queue: Schema.Literal<string>;
|
|
181
|
+
}>[]>>;
|
|
182
|
+
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
183
|
+
}>, 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<{
|
|
184
|
+
cursor: Schema.optionalKey<Schema.String>;
|
|
185
|
+
limit: Schema.Number;
|
|
186
|
+
queue: Schema.String;
|
|
187
|
+
}>, Schema.Struct<{
|
|
188
|
+
readonly jobs: Schema.$Array<Schema.Union<Schema.Struct<{
|
|
189
|
+
readonly attempt: Schema.Number;
|
|
190
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
191
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
192
|
+
readonly id: Schema.String;
|
|
193
|
+
readonly output: Schema.Unknown;
|
|
194
|
+
readonly retryCount: Schema.Number;
|
|
195
|
+
readonly retryLimit: Schema.Number;
|
|
196
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
197
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
198
|
+
readonly data: [...TQueues][number]["schema"];
|
|
199
|
+
readonly queue: Schema.Literal<string>;
|
|
200
|
+
readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
|
|
201
|
+
readonly sourceOutput: Schema.Unknown;
|
|
202
|
+
}>[]>>;
|
|
203
|
+
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
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<{
|
|
205
|
+
id: Schema.String;
|
|
206
|
+
queue: Schema.String;
|
|
207
|
+
}>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
|
|
208
|
+
readonly attempt: Schema.Number;
|
|
209
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
210
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
211
|
+
readonly id: Schema.String;
|
|
212
|
+
readonly output: Schema.Unknown;
|
|
213
|
+
readonly retryCount: Schema.Number;
|
|
214
|
+
readonly retryLimit: Schema.Number;
|
|
215
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
216
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
217
|
+
readonly data: [...TQueues][number]["schema"];
|
|
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> | import("effect/rpc/Rpc").Rpc<"admin.jobs.retry", Schema.Struct<{
|
|
220
|
+
id: Schema.String;
|
|
221
|
+
queue: Schema.String;
|
|
222
|
+
}>, 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> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
|
|
223
|
+
readonly activeTotal: Schema.Number;
|
|
224
|
+
readonly deadLetteredTotal: Schema.Number;
|
|
225
|
+
readonly failedTotal: Schema.Number;
|
|
226
|
+
readonly jobs: Schema.$Array<Schema.Struct<{
|
|
227
|
+
readonly activeCount: Schema.Number;
|
|
228
|
+
readonly deadLetteredCount: Schema.Number;
|
|
229
|
+
readonly failedCount: Schema.Number;
|
|
230
|
+
readonly name: Schema.String;
|
|
231
|
+
readonly queuedCount: Schema.Number;
|
|
232
|
+
readonly readyCount: Schema.Number;
|
|
233
|
+
}>>;
|
|
234
|
+
readonly queuedTotal: Schema.Number;
|
|
235
|
+
readonly readyTotal: Schema.Number;
|
|
236
|
+
}>, 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>;
|
|
237
|
+
} & {
|
|
238
|
+
queues: TQueues;
|
|
239
|
+
};
|
|
240
|
+
export {};
|
|
241
|
+
//# sourceMappingURL=retryPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retryPage.d.ts","sourceRoot":"","sources":["../../src/jobs/retryPage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMhC,OAAO,EAAgB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;;;;;AAE5D,qBAAa,aAAc,SAAQ,kBAGjC;CAAG;AAEL,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,SAAS,EAAE,EAAE,GAAG,MAAM,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyB/F"}
|