@shivaedev/admin 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +3 -3
  2. package/dist/jobs/page.d.ts +42 -13
  3. package/dist/jobs/page.d.ts.map +1 -1
  4. package/dist/jobs/retryPage.d.ts +49 -17
  5. package/dist/jobs/retryPage.d.ts.map +1 -1
  6. package/dist/jobs/retryPage.js +2 -1
  7. package/dist/jobs/retryPage.js.map +1 -1
  8. package/dist/jobs/schemas.d.ts +18 -4
  9. package/dist/jobs/schemas.d.ts.map +1 -1
  10. package/dist/jobs/schemas.js +5 -3
  11. package/dist/jobs/schemas.js.map +1 -1
  12. package/dist/permissions.d.ts +16 -2
  13. package/dist/permissions.d.ts.map +1 -1
  14. package/dist/permissions.js +1 -0
  15. package/dist/permissions.js.map +1 -1
  16. package/dist/server/jobsHandlers.d.ts +28 -9
  17. package/dist/server/jobsHandlers.d.ts.map +1 -1
  18. package/dist/server/jobsHandlers.js +23 -6
  19. package/dist/server/jobsHandlers.js.map +1 -1
  20. package/dist/server/jobsHandlersWithRetry.d.ts +2 -1
  21. package/dist/server/jobsHandlersWithRetry.d.ts.map +1 -1
  22. package/dist/server/jobsHandlersWithRetry.js +4 -0
  23. package/dist/server/jobsHandlersWithRetry.js.map +1 -1
  24. package/dist/server/users.d.ts +9 -34
  25. package/dist/server/users.d.ts.map +1 -1
  26. package/dist/server/users.js +24 -27
  27. package/dist/server/users.js.map +1 -1
  28. package/dist/server/usersHandlers.d.ts +2 -2
  29. package/dist/server/usersHandlers.d.ts.map +1 -1
  30. package/dist/server/usersHandlers.js.map +1 -1
  31. package/dist/users/page.d.ts +5 -5
  32. package/dist/users/page.d.ts.map +1 -1
  33. package/dist/users/page.js.map +1 -1
  34. package/dist/users/roles.d.ts +2 -2
  35. package/dist/users/roles.js +1 -1
  36. package/dist/users/roles.js.map +1 -1
  37. package/package.json +12 -12
  38. package/src/jobs/retryPage.ts +2 -1
  39. package/src/jobs/schemas.ts +5 -3
  40. package/src/permissions.ts +1 -0
  41. package/src/server/jobsHandlers.ts +26 -9
  42. package/src/server/jobsHandlersWithRetry.ts +4 -0
  43. package/src/server/users.ts +27 -30
  44. package/src/server/usersHandlers.ts +2 -2
  45. package/src/users/page.ts +2 -2
  46. package/src/users/roles.ts +1 -1
package/README.md CHANGED
@@ -110,7 +110,7 @@ const registration = registerAdmin(Admin, {
110
110
  });
111
111
  ```
112
112
 
113
- 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.
113
+ 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`. Output and source output use the jobs package's `JobFailure | null` shape (`_tag` and redacted `message`). A zero page limit or malformed listing cursor is rejected as `BadRequest`. 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.
114
114
 
115
115
  Schedule definitions from `defineSchedule` can be passed beside queues. A browser declaration can share just `{ _tag: "ScheduleDefinition", name }`; scheduled runs use a null payload schema for failed and dead-letter listings and job lookup. Calling `jobsPage()` with no arguments registers the same read-only page and serves health with no jobs and zero totals.
116
116
 
@@ -133,7 +133,7 @@ const registration = registerAdmin(Admin, {
133
133
  });
134
134
  ```
135
135
 
136
- This variant adds only `admin.jobs.retry`, taking `{ queue, id }` and returning void. It requires `ReadJobs`, through the same page middleware. The handler uses the jobs package's existing retry for a failed job in a declared queue. Missing jobs and jobs in other states fail with `JobsNotFailed`; unregistered queue names, including dead-letter queues, fail with `JobsQueueUnregistered`. A dead-letter copy's id cannot retry its original.
136
+ This variant adds only `admin.jobs.retry`, taking `{ queue, id }` and returning void. It requires `ReadJobs` (`jobs.read`) through the page middleware and `RetryJobs` (`jobs.retry`) from `@shivaedev/admin/permissions.ts` in the handler. A caller with only `jobs.read` receives `Forbidden` and the job stays failed. The handler uses the jobs package's existing retry for a failed job in a declared queue. Missing jobs and jobs in other states fail with `JobsNotFailed`; unregistered queue names, including dead-letter queues, fail with `JobsQueueUnregistered`. A dead-letter copy's id cannot retry its original.
137
137
 
138
138
  A successful bound retry invalidates health, the affected queue's counts and both listings, and the original job's detail. Health retains the runtime monitor's refresh timing.
139
139
 
@@ -158,7 +158,7 @@ const changeRole = Client.runtime.fn(users.changeRole.run);
158
158
 
159
159
  `admin.users.changeRole` takes `{ userId, role }`; its role Schema is the application's declared role union. The handler also requires `AssignRoles` (`roles.assign`). The view shows a role select only to callers with that permission. Role writes serialize in a transaction and return `LastRoleAssigner` if replacing the final holder's role would remove `roles.assign`, regardless of the role's name. A missing user returns `NotFound`. Changes invalidate the list after commit and emit an Effect log with actor id, target id, role and timestamp.
160
160
 
161
- Applications can call `listUsers(AppAccess, input)` and `changeUserRole(AppAccess, input)` from `@shivaedev/admin/server/users.ts` on the server. These enforce their respective domain permissions using `SessionUser`.
161
+ Applications can call `listUsers(AppAccess, input)` and `changeUserRole(AppAccess, input)` from `@shivaedev/admin/server/users.ts` on the server. These enforce their respective domain permissions using `SessionUser`. Decode untrusted role input with `AppAccess.Role` before calling `changeUserRole` directly; native RPC performs that decode at the contract boundary. Identity resolves the caller's stored role through the session policy.
162
162
 
163
163
  Keep Better Auth cookie caching disabled so requests see current permissions. Route role writes through this operation to retain the final-assigner policy: the policy covers only `admin.users.changeRole`, so disable Better Auth's `/admin/set-role`, `/admin/update-user` and `/admin/create-user` browser endpoints, which write roles outside it. Better Auth's server-side APIs stay available for trusted code such as a bootstrap command.
164
164
 
@@ -18,6 +18,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
18
18
  readonly queuedTotal: Schema.Number;
19
19
  readonly readyTotal: Schema.Number;
20
20
  }>, {
21
+ BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
21
22
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
22
23
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
23
24
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
@@ -29,6 +30,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
29
30
  readonly queuedCount: Schema.Number;
30
31
  readonly totalCount: Schema.Number;
31
32
  }>, {
33
+ BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
32
34
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
33
35
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
34
36
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
@@ -42,7 +44,10 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
42
44
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
43
45
  readonly createdOn: Schema.DateTimeUtcFromString;
44
46
  readonly id: Schema.String;
45
- readonly output: Schema.Unknown;
47
+ readonly output: Schema.NullOr<Schema.Struct<{
48
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
49
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
50
+ }>>;
46
51
  readonly retryCount: Schema.Number;
47
52
  readonly retryLimit: Schema.Number;
48
53
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -52,6 +57,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
52
57
  }>[]>>;
53
58
  readonly next: Schema.OptionFromNullOr<Schema.String>;
54
59
  }>, {
60
+ BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
55
61
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
56
62
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
57
63
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
@@ -65,7 +71,10 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
65
71
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
66
72
  readonly createdOn: Schema.DateTimeUtcFromString;
67
73
  readonly id: Schema.String;
68
- readonly output: Schema.Unknown;
74
+ readonly output: Schema.NullOr<Schema.Struct<{
75
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
76
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
77
+ }>>;
69
78
  readonly retryCount: Schema.Number;
70
79
  readonly retryLimit: Schema.Number;
71
80
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -73,10 +82,14 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
73
82
  readonly data: JobsPayload<TQueues[number]>;
74
83
  readonly queue: Schema.Literal<string>;
75
84
  readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
76
- readonly sourceOutput: Schema.Unknown;
85
+ readonly sourceOutput: Schema.NullOr<Schema.Struct<{
86
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
87
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
88
+ }>>;
77
89
  }>[]>>;
78
90
  readonly next: Schema.OptionFromNullOr<Schema.String>;
79
91
  }>, {
92
+ BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
80
93
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
81
94
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
82
95
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
@@ -88,7 +101,10 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
88
101
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
89
102
  readonly createdOn: Schema.DateTimeUtcFromString;
90
103
  readonly id: Schema.String;
91
- readonly output: Schema.Unknown;
104
+ readonly output: Schema.NullOr<Schema.Struct<{
105
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
106
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
107
+ }>>;
92
108
  readonly retryCount: Schema.Number;
93
109
  readonly retryLimit: Schema.Number;
94
110
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -96,6 +112,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
96
112
  readonly data: JobsPayload<TQueues[number]>;
97
113
  readonly queue: Schema.Literal<string>;
98
114
  }>[]>>, {
115
+ BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
99
116
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
100
117
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
101
118
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
@@ -154,7 +171,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
154
171
  readonly failedCount: Schema.Number;
155
172
  readonly queuedCount: Schema.Number;
156
173
  readonly totalCount: Schema.Number;
157
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
174
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
158
175
  cursor: Schema.optionalKey<Schema.String>;
159
176
  limit: Schema.Number;
160
177
  queue: Schema.String;
@@ -164,7 +181,10 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
164
181
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
165
182
  readonly createdOn: Schema.DateTimeUtcFromString;
166
183
  readonly id: Schema.String;
167
- readonly output: Schema.Unknown;
184
+ readonly output: Schema.NullOr<Schema.Struct<{
185
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
186
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
187
+ }>>;
168
188
  readonly retryCount: Schema.Number;
169
189
  readonly retryLimit: Schema.Number;
170
190
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -172,10 +192,13 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
172
192
  readonly data: JobsPayload<TQueues[number]>;
173
193
  readonly queue: Schema.Literal<string>;
174
194
  readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
175
- readonly sourceOutput: Schema.Unknown;
195
+ readonly sourceOutput: Schema.NullOr<Schema.Struct<{
196
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
197
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
198
+ }>>;
176
199
  }>[]>>;
177
200
  readonly next: Schema.OptionFromNullOr<Schema.String>;
178
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
201
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
179
202
  cursor: Schema.optionalKey<Schema.String>;
180
203
  limit: Schema.Number;
181
204
  queue: Schema.String;
@@ -185,7 +208,10 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
185
208
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
186
209
  readonly createdOn: Schema.DateTimeUtcFromString;
187
210
  readonly id: Schema.String;
188
- readonly output: Schema.Unknown;
211
+ readonly output: Schema.NullOr<Schema.Struct<{
212
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
213
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
214
+ }>>;
189
215
  readonly retryCount: Schema.Number;
190
216
  readonly retryLimit: Schema.Number;
191
217
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -194,7 +220,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
194
220
  readonly queue: Schema.Literal<string>;
195
221
  }>[]>>;
196
222
  readonly next: Schema.OptionFromNullOr<Schema.String>;
197
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
223
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
198
224
  readonly activeTotal: Schema.Number;
199
225
  readonly deadLetteredTotal: Schema.Number;
200
226
  readonly failedTotal: Schema.Number;
@@ -208,7 +234,7 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
208
234
  }>>;
209
235
  readonly queuedTotal: Schema.Number;
210
236
  readonly readyTotal: Schema.Number;
211
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
237
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
212
238
  id: Schema.String;
213
239
  queue: Schema.String;
214
240
  }>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
@@ -216,14 +242,17 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
216
242
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
217
243
  readonly createdOn: Schema.DateTimeUtcFromString;
218
244
  readonly id: Schema.String;
219
- readonly output: Schema.Unknown;
245
+ readonly output: Schema.NullOr<Schema.Struct<{
246
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
247
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
248
+ }>>;
220
249
  readonly retryCount: Schema.Number;
221
250
  readonly retryLimit: Schema.Number;
222
251
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
223
252
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
224
253
  readonly data: JobsPayload<TQueues[number]>;
225
254
  readonly queue: Schema.Literal<string>;
226
- }>[]>>, Schema.Union<readonly [Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never>, readonly [], undefined>;
255
+ }>[]>>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never>, readonly [], undefined>;
227
256
  } & {
228
257
  queues: TQueues;
229
258
  };
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/jobs/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMxC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAa,MAAM,YAAY,CAAC;AAIzE,wBAAgB,QAAQ,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,SAAS,EAAE,EAAE,GAAG,MAAM,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDtF"}
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/jobs/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMxC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAa,MAAM,YAAY,CAAC;AAIzE,wBAAgB,QAAQ,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,SAAS,EAAE,EAAE,GAAG,MAAM,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDtF"}
@@ -1,4 +1,5 @@
1
1
  import { Schema } from "effect";
2
+ import { Forbidden } from "@shivaedev/errors/taxonomy.ts";
2
3
  import { JobsPermission } from "#permissions.ts";
3
4
  import type { JobsEntry } from "./entry.ts";
4
5
  declare const JobsNotFailed_base: Schema.Class<JobsNotFailed, Schema.TaggedStruct<"JobsNotFailed", {
@@ -24,6 +25,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
24
25
  readonly queuedTotal: Schema.Number;
25
26
  readonly readyTotal: Schema.Number;
26
27
  }>, {
28
+ BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
27
29
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
28
30
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
29
31
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
@@ -35,6 +37,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
35
37
  readonly queuedCount: Schema.Number;
36
38
  readonly totalCount: Schema.Number;
37
39
  }>, {
40
+ BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
38
41
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
39
42
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
40
43
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
@@ -48,7 +51,10 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
48
51
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
49
52
  readonly createdOn: Schema.DateTimeUtcFromString;
50
53
  readonly id: Schema.String;
51
- readonly output: Schema.Unknown;
54
+ readonly output: Schema.NullOr<Schema.Struct<{
55
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
56
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
57
+ }>>;
52
58
  readonly retryCount: Schema.Number;
53
59
  readonly retryLimit: Schema.Number;
54
60
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -58,6 +64,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
58
64
  }>[]>>;
59
65
  readonly next: Schema.OptionFromNullOr<Schema.String>;
60
66
  }>, {
67
+ BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
61
68
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
62
69
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
63
70
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
@@ -71,7 +78,10 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
71
78
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
72
79
  readonly createdOn: Schema.DateTimeUtcFromString;
73
80
  readonly id: Schema.String;
74
- readonly output: Schema.Unknown;
81
+ readonly output: Schema.NullOr<Schema.Struct<{
82
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
83
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
84
+ }>>;
75
85
  readonly retryCount: Schema.Number;
76
86
  readonly retryLimit: Schema.Number;
77
87
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -79,10 +89,14 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
79
89
  readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>;
80
90
  readonly queue: Schema.Literal<string>;
81
91
  readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
82
- readonly sourceOutput: Schema.Unknown;
92
+ readonly sourceOutput: Schema.NullOr<Schema.Struct<{
93
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
94
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
95
+ }>>;
83
96
  }>[]>>;
84
97
  readonly next: Schema.OptionFromNullOr<Schema.String>;
85
98
  }>, {
99
+ BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
86
100
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
87
101
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
88
102
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
@@ -94,7 +108,10 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
94
108
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
95
109
  readonly createdOn: Schema.DateTimeUtcFromString;
96
110
  readonly id: Schema.String;
97
- readonly output: Schema.Unknown;
111
+ readonly output: Schema.NullOr<Schema.Struct<{
112
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
113
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
114
+ }>>;
98
115
  readonly retryCount: Schema.Number;
99
116
  readonly retryLimit: Schema.Number;
100
117
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -102,6 +119,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
102
119
  readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>;
103
120
  readonly queue: Schema.Literal<string>;
104
121
  }>[]>>, {
122
+ BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
105
123
  JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
106
124
  JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
107
125
  JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
@@ -109,9 +127,11 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
109
127
  id: Schema.String;
110
128
  queue: Schema.String;
111
129
  }>, Schema.Void, {
130
+ readonly BadRequest: typeof import("@shivaedev/errors/taxonomy.ts").BadRequest;
112
131
  readonly JobsPayloadInvalid: typeof import("./schemas.ts").JobsPayloadInvalid;
113
132
  readonly JobsQueueUnregistered: typeof import("./schemas.ts").JobsQueueUnregistered;
114
133
  readonly JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
134
+ readonly Forbidden: typeof Forbidden;
115
135
  readonly JobsNotFailed: typeof JobsNotFailed;
116
136
  }>>], import("effect/rpc/Rpc").Rpc<"admin.jobs.$changes", Schema.Struct<{
117
137
  queries: Schema.$Array<Schema.Union<readonly (Schema.Struct<{
@@ -161,17 +181,14 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
161
181
  readonly queryIndexes: Schema.optional<Schema.$Array<Schema.Number>>;
162
182
  }>, Schema.Struct<{
163
183
  readonly _tag: Schema.Literal<"Resync">;
164
- }>]>, Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>>, Schema.Never, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.retry", Schema.Struct<{
165
- id: Schema.String;
166
- queue: Schema.String;
167
- }>, Schema.Void, Schema.Union<readonly (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<{
184
+ }>]>, Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>>, Schema.Never, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.counts", Schema.Struct<{
168
185
  queue: Schema.String;
169
186
  }>, Schema.Struct<{
170
187
  readonly activeCount: Schema.Number;
171
188
  readonly failedCount: Schema.Number;
172
189
  readonly queuedCount: Schema.Number;
173
190
  readonly totalCount: Schema.Number;
174
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
191
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
175
192
  cursor: Schema.optionalKey<Schema.String>;
176
193
  limit: Schema.Number;
177
194
  queue: Schema.String;
@@ -181,7 +198,10 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
181
198
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
182
199
  readonly createdOn: Schema.DateTimeUtcFromString;
183
200
  readonly id: Schema.String;
184
- readonly output: Schema.Unknown;
201
+ readonly output: Schema.NullOr<Schema.Struct<{
202
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
203
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
204
+ }>>;
185
205
  readonly retryCount: Schema.Number;
186
206
  readonly retryLimit: Schema.Number;
187
207
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -189,10 +209,13 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
189
209
  readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>;
190
210
  readonly queue: Schema.Literal<string>;
191
211
  readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
192
- readonly sourceOutput: Schema.Unknown;
212
+ readonly sourceOutput: Schema.NullOr<Schema.Struct<{
213
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
214
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
215
+ }>>;
193
216
  }>[]>>;
194
217
  readonly next: Schema.OptionFromNullOr<Schema.String>;
195
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
218
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
196
219
  cursor: Schema.optionalKey<Schema.String>;
197
220
  limit: Schema.Number;
198
221
  queue: Schema.String;
@@ -202,7 +225,10 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
202
225
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
203
226
  readonly createdOn: Schema.DateTimeUtcFromString;
204
227
  readonly id: Schema.String;
205
- readonly output: Schema.Unknown;
228
+ readonly output: Schema.NullOr<Schema.Struct<{
229
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
230
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
231
+ }>>;
206
232
  readonly retryCount: Schema.Number;
207
233
  readonly retryLimit: Schema.Number;
208
234
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -211,7 +237,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
211
237
  readonly queue: Schema.Literal<string>;
212
238
  }>[]>>;
213
239
  readonly next: Schema.OptionFromNullOr<Schema.String>;
214
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
240
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
215
241
  readonly activeTotal: Schema.Number;
216
242
  readonly deadLetteredTotal: Schema.Number;
217
243
  readonly failedTotal: Schema.Number;
@@ -225,7 +251,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
225
251
  }>>;
226
252
  readonly queuedTotal: Schema.Number;
227
253
  readonly readyTotal: Schema.Number;
228
- }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
254
+ }>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
229
255
  id: Schema.String;
230
256
  queue: Schema.String;
231
257
  }>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
@@ -233,14 +259,20 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
233
259
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
234
260
  readonly createdOn: Schema.DateTimeUtcFromString;
235
261
  readonly id: Schema.String;
236
- readonly output: Schema.Unknown;
262
+ readonly output: Schema.NullOr<Schema.Struct<{
263
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
264
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
265
+ }>>;
237
266
  readonly retryCount: Schema.Number;
238
267
  readonly retryLimit: Schema.Number;
239
268
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
240
269
  readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
241
270
  readonly data: import("./entry.ts").JobsPayload<[...TQueues][number]>;
242
271
  readonly queue: Schema.Literal<string>;
243
- }>[]>>, Schema.Union<readonly [Schema.Union<readonly (typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never>, readonly [], undefined>;
272
+ }>[]>>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.retry", Schema.Struct<{
273
+ id: Schema.String;
274
+ queue: Schema.String;
275
+ }>, 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>;
244
276
  } & {
245
277
  queues: TQueues;
246
278
  };
@@ -1 +1 @@
1
- {"version":3,"file":"retryPage.d.ts","sourceRoot":"","sources":["../../src/jobs/retryPage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;;;;;AAK5C,qBAAa,aAAc,SAAQ,kBAGjC;CAAG;AAEL,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,SAAS,EAAE,EAAE,GAAG,MAAM,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B/F"}
1
+ {"version":3,"file":"retryPage.d.ts","sourceRoot":"","sources":["../../src/jobs/retryPage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;;;;;AAK5C,qBAAa,aAAc,SAAQ,kBAGjC;CAAG;AAEL,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,SAAS,EAAE,EAAE,GAAG,MAAM,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0B/F"}
@@ -1,6 +1,7 @@
1
1
  import { Schema } from "effect";
2
2
  import { contract } from "@shivaedev/contract/contract.ts";
3
3
  import { command } from "@shivaedev/contract/operation.ts";
4
+ import { Forbidden } from "@shivaedev/errors/taxonomy.ts";
4
5
  import { adminPage } from "#page.ts";
5
6
  import { JobsPermission } from "#permissions.ts";
6
7
  import { jobsKeys } from "./keys.js";
@@ -25,7 +26,7 @@ export function jobsPageWithRetry(...queues) {
25
26
  jobsKeys.job(queue).item(id),
26
27
  ],
27
28
  payload: { id: Schema.String, queue: Schema.String },
28
- rejections: { ...JobsFailures, JobsNotFailed },
29
+ rejections: { ...JobsFailures, Forbidden, JobsNotFailed },
29
30
  }),
30
31
  ],
31
32
  queries: page.contract.declaration.queries,
@@ -1 +1 @@
1
- {"version":3,"file":"retryPage.js","sourceRoot":"","sources":["../../src/jobs/retryPage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,OAAO,aAAc,SAAQ,MAAM,CAAC,WAAW,EAAiB,CAAC,eAAe,EAAE;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MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;oBACpD,UAAU,EAAE,EAAE,GAAG,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE;iBACzD,CAAC;aACF;YACD,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO;SAC1C,CAAC;QACF,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,UAAU,EAAE,cAAc;QAC1B,KAAK,EAAE,IAAI,CAAC,KAAK;KACjB,CAAC,EACF,EAAE,MAAM,EAAE,CACV,CAAC;AACH,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { Schema } from "effect";
2
+ import { BadRequest } from "@shivaedev/errors/taxonomy.ts";
2
3
  export interface JobsQueue {
3
4
  readonly name: string;
4
5
  readonly schema: Schema.Top & {
@@ -22,6 +23,7 @@ declare const JobsQueueUnregistered_base: Schema.Class<JobsQueueUnregistered, Sc
22
23
  export declare class JobsQueueUnregistered extends JobsQueueUnregistered_base {
23
24
  }
24
25
  export declare const JobsFailures: {
26
+ BadRequest: typeof BadRequest;
25
27
  JobsPayloadInvalid: typeof JobsPayloadInvalid;
26
28
  JobsQueueUnregistered: typeof JobsQueueUnregistered;
27
29
  JobsUnavailable: typeof JobsUnavailable;
@@ -60,7 +62,10 @@ export declare const JobFields: {
60
62
  completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
61
63
  createdOn: Schema.DateTimeUtcFromString;
62
64
  id: Schema.String;
63
- output: Schema.Unknown;
65
+ output: Schema.NullOr<Schema.Struct<{
66
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
67
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
68
+ }>>;
64
69
  retryCount: Schema.Number;
65
70
  retryLimit: Schema.Number;
66
71
  startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -78,7 +83,10 @@ export declare function jobSchema<TPayload extends Schema.Top>(queue: {
78
83
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
79
84
  readonly createdOn: Schema.DateTimeUtcFromString;
80
85
  readonly id: Schema.String;
81
- readonly output: Schema.Unknown;
86
+ readonly output: Schema.NullOr<Schema.Struct<{
87
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
88
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
89
+ }>>;
82
90
  readonly retryCount: Schema.Number;
83
91
  readonly retryLimit: Schema.Number;
84
92
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -94,7 +102,10 @@ export declare function deadLetteredSchema<TPayload extends Schema.Top>(queue: {
94
102
  readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
95
103
  readonly createdOn: Schema.DateTimeUtcFromString;
96
104
  readonly id: Schema.String;
97
- readonly output: Schema.Unknown;
105
+ readonly output: Schema.NullOr<Schema.Struct<{
106
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
107
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
108
+ }>>;
98
109
  readonly retryCount: Schema.Number;
99
110
  readonly retryLimit: Schema.Number;
100
111
  readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
@@ -102,7 +113,10 @@ export declare function deadLetteredSchema<TPayload extends Schema.Top>(queue: {
102
113
  readonly data: TPayload;
103
114
  readonly queue: Schema.Literal<string>;
104
115
  readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
105
- readonly sourceOutput: Schema.Unknown;
116
+ readonly sourceOutput: Schema.NullOr<Schema.Struct<{
117
+ readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
118
+ readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
119
+ }>>;
106
120
  }>;
107
121
  export declare function jobPage<TJob extends Schema.Top>(job: TJob): Schema.Struct<{
108
122
  readonly jobs: Schema.$Array<TJob>;
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","source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AAQ,SAAS,MAAM,CAAC,GAAG,EAAE,KAAK,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;GAS1H;AAED,wBAAgB,OAAO,CAAC,IAAI,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI;;;GAEzD"}
@@ -1,4 +1,6 @@
1
1
  import { Schema } from "effect";
2
+ import { BadRequest } from "@shivaedev/errors/taxonomy.ts";
3
+ import { JobFailure } from "@shivaedev/jobs/JobFailure.ts";
2
4
  export class JobsUnavailable extends Schema.TaggedError()("JobsUnavailable", {
3
5
  operation: Schema.String,
4
6
  }) {
@@ -11,7 +13,7 @@ export class JobsQueueUnregistered extends Schema.TaggedError()("JobsQueueUnregi
11
13
  queue: Schema.String,
12
14
  }) {
13
15
  }
14
- export const JobsFailures = { JobsPayloadInvalid, JobsQueueUnregistered, JobsUnavailable };
16
+ export const JobsFailures = { BadRequest, JobsPayloadInvalid, JobsQueueUnregistered, JobsUnavailable };
15
17
  export const QueueCounts = Schema.Struct({
16
18
  activeCount: Schema.Number,
17
19
  failedCount: Schema.Number,
@@ -39,7 +41,7 @@ export const JobFields = {
39
41
  completedOn: Schema.OptionFromNullOr(Schema.DateTimeUtcFromString),
40
42
  createdOn: Schema.DateTimeUtcFromString,
41
43
  id: Schema.String,
42
- output: Schema.Unknown,
44
+ output: Schema.NullOr(JobFailure),
43
45
  retryCount: Schema.Number,
44
46
  retryLimit: Schema.Number,
45
47
  startedOn: Schema.OptionFromNullOr(Schema.DateTimeUtcFromString),
@@ -56,7 +58,7 @@ export function deadLetteredSchema(queue) {
56
58
  data: queue.schema,
57
59
  queue: Schema.Literal(name),
58
60
  sourceId: Schema.OptionFromNullOr(Schema.String),
59
- sourceOutput: Schema.Unknown,
61
+ sourceOutput: Schema.NullOr(JobFailure),
60
62
  });
61
63
  }
62
64
  export function jobPage(job) {
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@@ export declare const ReadJobs: {
22
22
  readonly name: "jobs.read";
23
23
  readonly strength: "own";
24
24
  };
25
+ export declare const RetryJobs: {
26
+ readonly any: {
27
+ readonly name: "jobs.retry";
28
+ readonly strength: "any";
29
+ };
30
+ readonly name: "jobs.retry";
31
+ readonly strength: "own";
32
+ };
25
33
  declare const UsersPermission_base: import("effect/rpc/RpcMiddleware").ServiceClass<UsersPermission, "@shivaedev/admin/UsersPermission", import("@shivaedev/identity/identity.ts").Identity | import("@shivaedev/identity/identity.ts").SessionUser, import("effect/Schema").Union<readonly [typeof import("@shivaedev/errors/taxonomy.ts").Unauthorized, typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable, typeof import("@shivaedev/errors/taxonomy.ts").Forbidden, typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, never, never, false> & {
26
- permission: import("@shivaedev/access/permission.ts").Permission;
34
+ permission: {
35
+ readonly name: string;
36
+ readonly strength: "any" | "own";
37
+ };
27
38
  };
28
39
  export declare class UsersPermission extends UsersPermission_base {
29
40
  }
30
41
  declare const JobsPermission_base: import("effect/rpc/RpcMiddleware").ServiceClass<JobsPermission, "@shivaedev/admin/JobsPermission", import("@shivaedev/identity/identity.ts").Identity | import("@shivaedev/identity/identity.ts").SessionUser, import("effect/Schema").Union<readonly [typeof import("@shivaedev/errors/taxonomy.ts").Unauthorized, typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable, typeof import("@shivaedev/errors/taxonomy.ts").Forbidden, typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, never, never, false> & {
31
- permission: import("@shivaedev/access/permission.ts").Permission;
42
+ permission: {
43
+ readonly name: string;
44
+ readonly strength: "any" | "own";
45
+ };
32
46
  };
33
47
  export declare class JobsPermission extends JobsPermission_base {
34
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;CAA2B,CAAC;AAClD,eAAO,MAAM,WAAW;;;;;;;CAA6B,CAAC;AACtD,eAAO,MAAM,QAAQ;;;;;;;CAA0B,CAAC;;;;AAChD,qBAAa,eAAgB,SAAQ,oBAAsF;CAAG;;;;AAC9H,qBAAa,cAAe,SAAQ,mBAAmF;CAAG"}
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;CAA2B,CAAC;AAClD,eAAO,MAAM,WAAW;;;;;;;CAA6B,CAAC;AACtD,eAAO,MAAM,QAAQ;;;;;;;CAA0B,CAAC;AAChD,eAAO,MAAM,SAAS;;;;;;;CAA2B,CAAC;;;;;;;AAClD,qBAAa,eAAgB,SAAQ,oBAAsF;CAAG;;;;;;;AAC9H,qBAAa,cAAe,SAAQ,mBAAmF;CAAG"}
@@ -3,6 +3,7 @@ import { permissionMiddleware } from "@shivaedev/identity/permission.ts";
3
3
  export const ReadUsers = permission("users.read");
4
4
  export const AssignRoles = permission("roles.assign");
5
5
  export const ReadJobs = permission("jobs.read");
6
+ export const RetryJobs = permission("jobs.retry");
6
7
  export class UsersPermission extends permissionMiddleware()("@shivaedev/admin/UsersPermission", ReadUsers) {
7
8
  }
8
9
  export class JobsPermission extends permissionMiddleware()("@shivaedev/admin/JobsPermission", ReadJobs) {