@shivaedev/admin 0.18.1 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/README.md +22 -15
- package/dist/client/adapters/JobButton.d.ts.map +1 -0
- package/dist/client/adapters/JobButton.js.map +1 -0
- package/dist/client/adapters/JobDetail.d.ts.map +1 -0
- package/dist/client/adapters/JobDetail.js.map +1 -0
- package/dist/client/{JobList.d.ts → adapters/JobList.d.ts} +3 -1
- package/dist/client/adapters/JobList.d.ts.map +1 -0
- package/dist/client/{JobList.js → adapters/JobList.js} +2 -2
- package/dist/client/adapters/JobList.js.map +1 -0
- package/dist/client/adapters/JobPagination.d.ts.map +1 -0
- package/dist/client/adapters/JobPagination.js.map +1 -0
- package/dist/client/adapters/JobTable.d.ts +10 -0
- package/dist/client/adapters/JobTable.d.ts.map +1 -0
- package/dist/client/adapters/JobTable.js +22 -0
- package/dist/client/adapters/JobTable.js.map +1 -0
- package/dist/client/adapters/JobsMetrics.d.ts.map +1 -0
- package/dist/client/adapters/JobsMetrics.js.map +1 -0
- package/dist/client/adapters/JobsQueryPanel.d.ts.map +1 -0
- package/dist/client/adapters/JobsQueryPanel.js.map +1 -0
- package/dist/client/{JobsQueueView.d.ts → adapters/JobsQueueView.d.ts} +5 -2
- package/dist/client/adapters/JobsQueueView.d.ts.map +1 -0
- package/dist/client/{JobsQueueView.js → adapters/JobsQueueView.js} +7 -4
- package/dist/client/adapters/JobsQueueView.js.map +1 -0
- package/dist/client/{JobsView.d.ts → adapters/JobsView.d.ts} +2 -1
- package/dist/client/adapters/JobsView.d.ts.map +1 -0
- package/dist/client/{JobsView.js → adapters/JobsView.js} +5 -3
- package/dist/client/adapters/JobsView.js.map +1 -0
- package/dist/client/adapters/SessionConfirmation.d.ts.map +1 -0
- package/dist/client/adapters/SessionConfirmation.js.map +1 -0
- package/dist/client/adapters/SessionListView.d.ts.map +1 -0
- package/dist/client/adapters/SessionListView.js.map +1 -0
- package/dist/client/adapters/SessionPagination.d.ts.map +1 -0
- package/dist/client/adapters/SessionPagination.js.map +1 -0
- package/dist/client/adapters/SessionsView.d.ts.map +1 -0
- package/dist/client/adapters/SessionsView.js.map +1 -0
- package/dist/client/{UsersTable.d.ts → adapters/UsersTable.d.ts} +1 -1
- package/dist/client/adapters/UsersTable.d.ts.map +1 -0
- package/dist/client/adapters/UsersTable.js.map +1 -0
- package/dist/client/{UsersView.d.ts → adapters/UsersView.d.ts} +2 -1
- package/dist/client/adapters/UsersView.d.ts.map +1 -0
- package/dist/client/adapters/UsersView.js.map +1 -0
- package/dist/client/adapters/jobsTypes.d.ts.map +1 -0
- package/dist/client/adapters/jobsTypes.js.map +1 -0
- package/dist/jobs/entry.d.ts +3 -2
- package/dist/jobs/entry.d.ts.map +1 -1
- package/dist/jobs/entry.js.map +1 -1
- package/dist/jobs/page.d.ts +55 -7
- package/dist/jobs/page.d.ts.map +1 -1
- package/dist/jobs/retryPage.d.ts +86 -38
- package/dist/jobs/retryPage.d.ts.map +1 -1
- package/dist/server/jobsHandlers.d.ts +3 -3
- package/dist/server/jobsHandlers.d.ts.map +1 -1
- package/dist/server/jobsHandlers.js +13 -8
- package/dist/server/jobsHandlers.js.map +1 -1
- package/dist/server/jobsHandlersWithRetry.d.ts.map +1 -1
- package/dist/server/jobsHandlersWithRetry.js +3 -2
- package/dist/server/jobsHandlersWithRetry.js.map +1 -1
- package/dist/server/users.d.ts +10 -13
- package/dist/server/users.d.ts.map +1 -1
- package/dist/server/users.js +7 -25
- package/dist/server/users.js.map +1 -1
- package/dist/server/usersHandlers.d.ts +1 -3
- package/dist/server/usersHandlers.d.ts.map +1 -1
- package/dist/server/usersHandlers.js +4 -4
- package/dist/server/usersHandlers.js.map +1 -1
- package/dist/sessions/Page.d.ts +18 -2
- package/dist/sessions/Page.d.ts.map +1 -1
- package/dist/users/ChangeRoleInput.d.ts +5 -0
- package/dist/users/ChangeRoleInput.d.ts.map +1 -0
- package/dist/users/ChangeRoleInput.js +2 -0
- package/dist/users/ChangeRoleInput.js.map +1 -0
- package/dist/users/page.d.ts +20 -4
- package/dist/users/page.d.ts.map +1 -1
- package/dist/users/page.js +4 -6
- package/dist/users/page.js.map +1 -1
- package/package.json +26 -14
- package/src/client/{JobList.tsx → adapters/JobList.tsx} +4 -1
- package/src/client/{JobTable.tsx → adapters/JobTable.tsx} +39 -3
- package/src/client/{JobsQueueView.tsx → adapters/JobsQueueView.tsx} +27 -11
- package/src/client/{JobsView.ts → adapters/JobsView.ts} +8 -5
- package/src/client/{UsersTable.tsx → adapters/UsersTable.tsx} +4 -3
- package/src/client/{UsersView.ts → adapters/UsersView.ts} +2 -1
- package/src/jobs/entry.ts +2 -1
- package/src/server/jobsHandlers.ts +13 -10
- package/src/server/jobsHandlersWithRetry.ts +3 -2
- package/src/server/users.ts +9 -35
- package/src/server/usersHandlers.ts +4 -10
- package/src/users/ChangeRoleInput.ts +4 -0
- package/src/users/page.ts +4 -7
- package/dist/client/JobButton.d.ts.map +0 -1
- package/dist/client/JobButton.js.map +0 -1
- package/dist/client/JobDetail.d.ts.map +0 -1
- package/dist/client/JobDetail.js.map +0 -1
- package/dist/client/JobList.d.ts.map +0 -1
- package/dist/client/JobList.js.map +0 -1
- package/dist/client/JobPagination.d.ts.map +0 -1
- package/dist/client/JobPagination.js.map +0 -1
- package/dist/client/JobTable.d.ts +0 -6
- package/dist/client/JobTable.d.ts.map +0 -1
- package/dist/client/JobTable.js +0 -13
- package/dist/client/JobTable.js.map +0 -1
- package/dist/client/JobsMetrics.d.ts.map +0 -1
- package/dist/client/JobsMetrics.js.map +0 -1
- package/dist/client/JobsQueryPanel.d.ts.map +0 -1
- package/dist/client/JobsQueryPanel.js.map +0 -1
- package/dist/client/JobsQueueView.d.ts.map +0 -1
- package/dist/client/JobsQueueView.js.map +0 -1
- package/dist/client/JobsView.d.ts.map +0 -1
- package/dist/client/JobsView.js.map +0 -1
- package/dist/client/SessionConfirmation.d.ts.map +0 -1
- package/dist/client/SessionConfirmation.js.map +0 -1
- package/dist/client/SessionListView.d.ts.map +0 -1
- package/dist/client/SessionListView.js.map +0 -1
- package/dist/client/SessionPagination.d.ts.map +0 -1
- package/dist/client/SessionPagination.js.map +0 -1
- package/dist/client/SessionsView.d.ts.map +0 -1
- package/dist/client/SessionsView.js.map +0 -1
- package/dist/client/UsersTable.d.ts.map +0 -1
- package/dist/client/UsersTable.js.map +0 -1
- package/dist/client/UsersView.d.ts.map +0 -1
- package/dist/client/UsersView.js.map +0 -1
- package/dist/client/jobsTypes.d.ts.map +0 -1
- package/dist/client/jobsTypes.js.map +0 -1
- package/dist/users/roles.d.ts +0 -27
- package/dist/users/roles.d.ts.map +0 -1
- package/dist/users/roles.js +0 -14
- package/dist/users/roles.js.map +0 -1
- package/src/users/roles.ts +0 -19
- /package/dist/client/{JobButton.d.ts → adapters/JobButton.d.ts} +0 -0
- /package/dist/client/{JobButton.js → adapters/JobButton.js} +0 -0
- /package/dist/client/{JobDetail.d.ts → adapters/JobDetail.d.ts} +0 -0
- /package/dist/client/{JobDetail.js → adapters/JobDetail.js} +0 -0
- /package/dist/client/{JobPagination.d.ts → adapters/JobPagination.d.ts} +0 -0
- /package/dist/client/{JobPagination.js → adapters/JobPagination.js} +0 -0
- /package/dist/client/{JobsMetrics.d.ts → adapters/JobsMetrics.d.ts} +0 -0
- /package/dist/client/{JobsMetrics.js → adapters/JobsMetrics.js} +0 -0
- /package/dist/client/{JobsQueryPanel.d.ts → adapters/JobsQueryPanel.d.ts} +0 -0
- /package/dist/client/{JobsQueryPanel.js → adapters/JobsQueryPanel.js} +0 -0
- /package/dist/client/{SessionConfirmation.d.ts → adapters/SessionConfirmation.d.ts} +0 -0
- /package/dist/client/{SessionConfirmation.js → adapters/SessionConfirmation.js} +0 -0
- /package/dist/client/{SessionListView.d.ts → adapters/SessionListView.d.ts} +0 -0
- /package/dist/client/{SessionListView.js → adapters/SessionListView.js} +0 -0
- /package/dist/client/{SessionPagination.d.ts → adapters/SessionPagination.d.ts} +0 -0
- /package/dist/client/{SessionPagination.js → adapters/SessionPagination.js} +0 -0
- /package/dist/client/{SessionsView.d.ts → adapters/SessionsView.d.ts} +0 -0
- /package/dist/client/{SessionsView.js → adapters/SessionsView.js} +0 -0
- /package/dist/client/{UsersTable.js → adapters/UsersTable.js} +0 -0
- /package/dist/client/{UsersView.js → adapters/UsersView.js} +0 -0
- /package/dist/client/{jobsTypes.d.ts → adapters/jobsTypes.d.ts} +0 -0
- /package/dist/client/{jobsTypes.js → adapters/jobsTypes.js} +0 -0
- /package/src/client/{JobButton.tsx → adapters/JobButton.tsx} +0 -0
- /package/src/client/{JobDetail.tsx → adapters/JobDetail.tsx} +0 -0
- /package/src/client/{JobPagination.tsx → adapters/JobPagination.tsx} +0 -0
- /package/src/client/{JobsMetrics.tsx → adapters/JobsMetrics.tsx} +0 -0
- /package/src/client/{JobsQueryPanel.tsx → adapters/JobsQueryPanel.tsx} +0 -0
- /package/src/client/{SessionConfirmation.tsx → adapters/SessionConfirmation.tsx} +0 -0
- /package/src/client/{SessionListView.tsx → adapters/SessionListView.tsx} +0 -0
- /package/src/client/{SessionPagination.tsx → adapters/SessionPagination.tsx} +0 -0
- /package/src/client/{SessionsView.ts → adapters/SessionsView.ts} +0 -0
- /package/src/client/{jobsTypes.ts → adapters/jobsTypes.ts} +0 -0
package/dist/jobs/page.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
2
|
import { type JobsEntry } from "#jobs/entry.ts";
|
|
3
3
|
import { JobsPermission } from "#permissions.ts";
|
|
4
4
|
export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...queues: TQueues): import("#page.ts").AdminPage & {
|
|
@@ -195,14 +195,30 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
195
195
|
readonly queryIndexes: Schema.optional<Schema.$Array<Schema.Number>>;
|
|
196
196
|
}>, Schema.Struct<{
|
|
197
197
|
readonly _tag: Schema.Literal<"Resync">;
|
|
198
|
-
}>]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, ...never[]]>, Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired, ...Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>[]]>>, Schema.Never, typeof JobsPermission
|
|
198
|
+
}>]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, ...never[]]>, Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired, ...Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>[]]>>, Schema.Never, typeof JobsPermission | (import("effect/Context").Reference<<A, E, R>(effect: Effect.Effect<A, E, R>, request: {
|
|
199
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
200
|
+
readonly payload: unknown;
|
|
201
|
+
}) => Effect.Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
202
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
203
|
+
"~ClientError": never;
|
|
204
|
+
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
205
|
+
requiredForClient: false;
|
|
206
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.counts", Schema.Struct<{
|
|
199
207
|
queue: Schema.String;
|
|
200
208
|
}>, Schema.Struct<{
|
|
201
209
|
readonly activeCount: Schema.Number;
|
|
202
210
|
readonly failedCount: Schema.Number;
|
|
203
211
|
readonly queuedCount: Schema.Number;
|
|
204
212
|
readonly totalCount: Schema.Number;
|
|
205
|
-
}>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission
|
|
213
|
+
}>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission | (import("effect/Context").Reference<<A, E, R>(effect: Effect.Effect<A, E, R>, request: {
|
|
214
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
215
|
+
readonly payload: unknown;
|
|
216
|
+
}) => Effect.Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
217
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
218
|
+
"~ClientError": never;
|
|
219
|
+
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
220
|
+
requiredForClient: false;
|
|
221
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
|
|
206
222
|
cursor: Schema.optionalKey<Schema.String>;
|
|
207
223
|
limit: Schema.Number;
|
|
208
224
|
queue: Schema.String;
|
|
@@ -230,7 +246,15 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
230
246
|
readonly sourceQueue: Schema.Literal<string>;
|
|
231
247
|
}>[]>>;
|
|
232
248
|
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
233
|
-
}>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission
|
|
249
|
+
}>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission | (import("effect/Context").Reference<<A, E, R>(effect: Effect.Effect<A, E, R>, request: {
|
|
250
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
251
|
+
readonly payload: unknown;
|
|
252
|
+
}) => Effect.Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
253
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
254
|
+
"~ClientError": never;
|
|
255
|
+
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
256
|
+
requiredForClient: false;
|
|
257
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
|
|
234
258
|
cursor: Schema.optionalKey<Schema.String>;
|
|
235
259
|
limit: Schema.Number;
|
|
236
260
|
queue: Schema.String;
|
|
@@ -252,7 +276,15 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
252
276
|
readonly queue: Schema.Literal<string>;
|
|
253
277
|
}>[]>>;
|
|
254
278
|
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
255
|
-
}>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission
|
|
279
|
+
}>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission | (import("effect/Context").Reference<<A, E, R>(effect: Effect.Effect<A, E, R>, request: {
|
|
280
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
281
|
+
readonly payload: unknown;
|
|
282
|
+
}) => Effect.Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
283
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
284
|
+
"~ClientError": never;
|
|
285
|
+
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
286
|
+
requiredForClient: false;
|
|
287
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
|
|
256
288
|
readonly activeTotal: Schema.Number;
|
|
257
289
|
readonly deadLetteredTotal: Schema.Number;
|
|
258
290
|
readonly failedTotal: Schema.Number;
|
|
@@ -266,7 +298,15 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
266
298
|
}>>;
|
|
267
299
|
readonly queuedTotal: Schema.Number;
|
|
268
300
|
readonly readyTotal: Schema.Number;
|
|
269
|
-
}>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission
|
|
301
|
+
}>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission | (import("effect/Context").Reference<<A, E, R>(effect: Effect.Effect<A, E, R>, request: {
|
|
302
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
303
|
+
readonly payload: unknown;
|
|
304
|
+
}) => Effect.Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
305
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
306
|
+
"~ClientError": never;
|
|
307
|
+
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
308
|
+
requiredForClient: false;
|
|
309
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
|
|
270
310
|
id: Schema.String;
|
|
271
311
|
queue: Schema.String;
|
|
272
312
|
}>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
|
|
@@ -284,7 +324,15 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
284
324
|
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
285
325
|
readonly data: Schema.Unknown;
|
|
286
326
|
readonly queue: Schema.Literal<string>;
|
|
287
|
-
}>[]>>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission,
|
|
327
|
+
}>[]>>, Schema.Union<readonly [Schema.Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("#jobs/schemas.ts").JobsUnavailable | typeof import("#jobs/schemas.ts").JobsPayloadInvalid | typeof import("#jobs/schemas.ts").JobsQueueUnregistered)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof JobsPermission | (import("effect/Context").Reference<<A, E, R>(effect: Effect.Effect<A, E, R>, request: {
|
|
328
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
329
|
+
readonly payload: unknown;
|
|
330
|
+
}) => Effect.Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
331
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
332
|
+
"~ClientError": never;
|
|
333
|
+
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
334
|
+
requiredForClient: false;
|
|
335
|
+
}), never>, readonly [], undefined>;
|
|
288
336
|
} & {
|
|
289
337
|
queues: TQueues;
|
|
290
338
|
};
|
package/dist/jobs/page.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/jobs/page.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/jobs/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGxC,OAAO,EAAE,KAAK,SAAS,EAA+B,MAAM,gBAAgB,CAAC;AAI7E,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,wBAAgB,QAAQ,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,SAAS,EAAE,EAAE,GAAG,MAAM,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDtF"}
|
package/dist/jobs/retryPage.d.ts
CHANGED
|
@@ -187,25 +187,7 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
|
|
|
187
187
|
readonly JobsUnavailable: typeof import("./schemas.ts").JobsUnavailable;
|
|
188
188
|
readonly Forbidden: typeof Forbidden;
|
|
189
189
|
readonly JobsNotFailed: typeof JobsNotFailed;
|
|
190
|
-
}>>], import("effect/rpc/Rpc").Rpc<"admin.jobs
|
|
191
|
-
id: Schema.String;
|
|
192
|
-
queue: Schema.String;
|
|
193
|
-
}>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
|
|
194
|
-
readonly attempt: Schema.Number;
|
|
195
|
-
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
196
|
-
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
197
|
-
readonly id: Schema.String;
|
|
198
|
-
readonly output: Schema.NullOr<Schema.Struct<{
|
|
199
|
-
readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
200
|
-
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
201
|
-
}>>;
|
|
202
|
-
readonly retryCount: Schema.Number;
|
|
203
|
-
readonly retryLimit: Schema.Number;
|
|
204
|
-
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
205
|
-
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
206
|
-
readonly data: Schema.Unknown;
|
|
207
|
-
readonly queue: Schema.Literal<string>;
|
|
208
|
-
}>[]>>, 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.$changes", Schema.Struct<{
|
|
190
|
+
}>>], import("effect/rpc/Rpc").Rpc<"admin.jobs.$changes", Schema.Struct<{
|
|
209
191
|
queries: Schema.$Array<Schema.Union<readonly (Schema.Struct<{
|
|
210
192
|
query: Schema.Literal<"counts">;
|
|
211
193
|
payload: Schema.Struct<{
|
|
@@ -253,28 +235,30 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
|
|
|
253
235
|
readonly queryIndexes: Schema.optional<Schema.$Array<Schema.Number>>;
|
|
254
236
|
}>, Schema.Struct<{
|
|
255
237
|
readonly _tag: Schema.Literal<"Resync">;
|
|
256
|
-
}>]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, ...never[]]>, Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired, ...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)[]>[]]>>, Schema.Never, typeof JobsPermission,
|
|
238
|
+
}>]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, ...never[]]>, Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired, ...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)[]>[]]>>, Schema.Never, typeof JobsPermission | (import("effect/Context").Reference<<A, E, R>(effect: import("effect/Effect").Effect<A, E, R>, request: {
|
|
239
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
240
|
+
readonly payload: unknown;
|
|
241
|
+
}) => import("effect/Effect").Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
242
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
243
|
+
"~ClientError": never;
|
|
244
|
+
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
245
|
+
requiredForClient: false;
|
|
246
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.counts", Schema.Struct<{
|
|
257
247
|
queue: Schema.String;
|
|
258
248
|
}>, Schema.Struct<{
|
|
259
249
|
readonly activeCount: Schema.Number;
|
|
260
250
|
readonly failedCount: Schema.Number;
|
|
261
251
|
readonly queuedCount: Schema.Number;
|
|
262
252
|
readonly totalCount: Schema.Number;
|
|
263
|
-
}>, 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,
|
|
264
|
-
readonly
|
|
265
|
-
readonly
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
readonly queuedCount: Schema.Number;
|
|
273
|
-
readonly readyCount: Schema.Number;
|
|
274
|
-
}>>;
|
|
275
|
-
readonly queuedTotal: Schema.Number;
|
|
276
|
-
readonly readyTotal: Schema.Number;
|
|
277
|
-
}>, 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<{
|
|
253
|
+
}>, 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 | (import("effect/Context").Reference<<A, E, R>(effect: import("effect/Effect").Effect<A, E, R>, request: {
|
|
254
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
255
|
+
readonly payload: unknown;
|
|
256
|
+
}) => import("effect/Effect").Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
257
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
258
|
+
"~ClientError": never;
|
|
259
|
+
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
260
|
+
requiredForClient: false;
|
|
261
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
|
|
278
262
|
cursor: Schema.optionalKey<Schema.String>;
|
|
279
263
|
limit: Schema.Number;
|
|
280
264
|
queue: Schema.String;
|
|
@@ -296,7 +280,15 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
|
|
|
296
280
|
readonly queue: Schema.Literal<string>;
|
|
297
281
|
}>[]>>;
|
|
298
282
|
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
299
|
-
}>, 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,
|
|
283
|
+
}>, 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 | (import("effect/Context").Reference<<A, E, R>(effect: import("effect/Effect").Effect<A, E, R>, request: {
|
|
284
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
285
|
+
readonly payload: unknown;
|
|
286
|
+
}) => import("effect/Effect").Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
287
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
288
|
+
"~ClientError": never;
|
|
289
|
+
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
290
|
+
requiredForClient: false;
|
|
291
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
|
|
300
292
|
cursor: Schema.optionalKey<Schema.String>;
|
|
301
293
|
limit: Schema.Number;
|
|
302
294
|
queue: Schema.String;
|
|
@@ -324,10 +316,66 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
|
|
|
324
316
|
readonly sourceQueue: Schema.Literal<string>;
|
|
325
317
|
}>[]>>;
|
|
326
318
|
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
327
|
-
}>, 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,
|
|
319
|
+
}>, 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 | (import("effect/Context").Reference<<A, E, R>(effect: import("effect/Effect").Effect<A, E, R>, request: {
|
|
320
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
321
|
+
readonly payload: unknown;
|
|
322
|
+
}) => import("effect/Effect").Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
323
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
324
|
+
"~ClientError": never;
|
|
325
|
+
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
326
|
+
requiredForClient: false;
|
|
327
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
|
|
328
328
|
id: Schema.String;
|
|
329
329
|
queue: Schema.String;
|
|
330
|
-
}>, Schema.
|
|
330
|
+
}>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
|
|
331
|
+
readonly attempt: Schema.Number;
|
|
332
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
333
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
334
|
+
readonly id: Schema.String;
|
|
335
|
+
readonly output: Schema.NullOr<Schema.Struct<{
|
|
336
|
+
readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
337
|
+
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
338
|
+
}>>;
|
|
339
|
+
readonly retryCount: Schema.Number;
|
|
340
|
+
readonly retryLimit: Schema.Number;
|
|
341
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
342
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
343
|
+
readonly data: Schema.Unknown;
|
|
344
|
+
readonly queue: Schema.Literal<string>;
|
|
345
|
+
}>[]>>, 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 | (import("effect/Context").Reference<<A, E, R>(effect: import("effect/Effect").Effect<A, E, R>, request: {
|
|
346
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
347
|
+
readonly payload: unknown;
|
|
348
|
+
}) => import("effect/Effect").Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
349
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
350
|
+
"~ClientError": never;
|
|
351
|
+
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
352
|
+
requiredForClient: false;
|
|
353
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.retry", Schema.Struct<{
|
|
354
|
+
id: Schema.String;
|
|
355
|
+
queue: Schema.String;
|
|
356
|
+
}>, Schema.Void, Schema.Union<readonly (typeof Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").BadRequest | typeof import("./schemas.ts").JobsUnavailable | typeof import("./schemas.ts").JobsPayloadInvalid | typeof import("./schemas.ts").JobsQueueUnregistered | typeof JobsNotFailed)[]>, typeof JobsPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
|
|
357
|
+
readonly activeTotal: Schema.Number;
|
|
358
|
+
readonly deadLetteredTotal: Schema.Number;
|
|
359
|
+
readonly failedTotal: Schema.Number;
|
|
360
|
+
readonly jobs: Schema.$Array<Schema.Struct<{
|
|
361
|
+
readonly activeCount: Schema.Number;
|
|
362
|
+
readonly deadLetteredCount: Schema.Number;
|
|
363
|
+
readonly failedCount: Schema.Number;
|
|
364
|
+
readonly name: Schema.String;
|
|
365
|
+
readonly queuedCount: Schema.Number;
|
|
366
|
+
readonly readyCount: Schema.Number;
|
|
367
|
+
}>>;
|
|
368
|
+
readonly queuedTotal: Schema.Number;
|
|
369
|
+
readonly readyTotal: Schema.Number;
|
|
370
|
+
}>, 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 | (import("effect/Context").Reference<<A, E, R>(effect: import("effect/Effect").Effect<A, E, R>, request: {
|
|
371
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
372
|
+
readonly payload: unknown;
|
|
373
|
+
}) => import("effect/Effect").Effect<A, E | import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy | import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied | import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired | import("effect/Types").unhandled, R>> & {
|
|
374
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
375
|
+
"~ClientError": never;
|
|
376
|
+
error: Schema.Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
|
|
377
|
+
requiredForClient: false;
|
|
378
|
+
}), never>, readonly [], undefined>;
|
|
331
379
|
} & {
|
|
332
380
|
queues: TQueues;
|
|
333
381
|
};
|
|
@@ -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;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
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { type Context, DateTime, Effect, Option, Schema } from "effect";
|
|
1
|
+
import { type Context, DateTime, Effect, Option, type Schema } from "effect";
|
|
2
2
|
import { BadRequest } from "@shivaedev/errors/taxonomy.ts";
|
|
3
3
|
import type { PgBossError, PgBossPayloadError } from "@shivaedev/jobs/server/error.ts";
|
|
4
4
|
import type { PgBossService } from "@shivaedev/jobs/server/service.ts";
|
|
@@ -40,7 +40,7 @@ export declare function jobsReadHandlers<const TQueues extends readonly JobsEntr
|
|
|
40
40
|
retryCount: number;
|
|
41
41
|
retryLimit: number;
|
|
42
42
|
startedOn: Option.Option<DateTime.Utc>;
|
|
43
|
-
state: "
|
|
43
|
+
state: import("@shivaedev/jobs/server/job.ts").JobState;
|
|
44
44
|
}> | Option.Some<{
|
|
45
45
|
attempt: number;
|
|
46
46
|
completedOn: Option.Option<DateTime.Utc>;
|
|
@@ -55,7 +55,7 @@ export declare function jobsReadHandlers<const TQueues extends readonly JobsEntr
|
|
|
55
55
|
retryCount: number;
|
|
56
56
|
retryLimit: number;
|
|
57
57
|
startedOn: Option.Option<DateTime.Utc>;
|
|
58
|
-
state: "
|
|
58
|
+
state: import("@shivaedev/jobs/server/job.ts").JobState;
|
|
59
59
|
}>, BadRequest | JobsPayloadInvalid | JobsQueueUnregistered | JobsUnavailable, TService | JobsPayload<TQueues[number]>["DecodingServices"]>;
|
|
60
60
|
};
|
|
61
61
|
export declare function jobsHandlers<const TQueues extends readonly JobsEntry[], TService>(page: ReturnType<typeof jobsPage<TQueues>>, service: Context.Service<TService, PgBossService>): import("effect/Layer").Layer<import("effect/rpc/Rpc").Handler<"admin.jobs.counts"> | import("effect/rpc/Rpc").Handler<"admin.jobs.deadLettered"> | import("effect/rpc/Rpc").Handler<"admin.jobs.failed"> | import("effect/rpc/Rpc").Handler<"admin.jobs.health"> | import("effect/rpc/Rpc").Handler<"admin.jobs.job">, never, Exclude<Exclude<TService, import("@shivaedev/identity/identity.ts").Identity | import("@shivaedev/identity/identity.ts").SessionUser>, import("effect/Scope").Scope> | Exclude<Exclude<TService, import("@shivaedev/identity/identity.ts").Identity | import("@shivaedev/identity/identity.ts").SessionUser>, import("effect/Scope").Scope> | Exclude<Exclude<JobsPayload<TQueues[number]>["DecodingServices"], import("@shivaedev/identity/identity.ts").Identity | import("@shivaedev/identity/identity.ts").SessionUser>, import("effect/Scope").Scope>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobsHandlers.d.ts","sourceRoot":"","sources":["../../src/server/jobsHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"jobsHandlers.d.ts","sourceRoot":"","sources":["../../src/server/jobsHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAEvF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAa,MAAM,gBA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QAAQ,CAAC,OAAO,CAAC,CAAC,EAC1C,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC,61BAGjD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DateTime, Effect, Option
|
|
1
|
+
import { DateTime, Effect, Option } from "effect";
|
|
2
2
|
import { BadRequest } from "@shivaedev/errors/taxonomy.ts";
|
|
3
|
-
import {
|
|
3
|
+
import { readJobFailure } from "@shivaedev/jobs/server/readJobFailure.ts";
|
|
4
4
|
import { jobsQueue } from "#jobs/entry.ts";
|
|
5
5
|
import { JobsPayloadInvalid, JobsQueueUnregistered, JobsUnavailable } from "#jobs/schemas.ts";
|
|
6
6
|
export function jobsFailures(effect) {
|
|
@@ -24,32 +24,37 @@ export function jobsReadHandlers(page, service) {
|
|
|
24
24
|
return {
|
|
25
25
|
"admin.jobs.counts": ({ queue }) => Effect.gen(function* () {
|
|
26
26
|
const definition = yield* registered(queue);
|
|
27
|
-
const
|
|
27
|
+
const runtime = yield* service;
|
|
28
|
+
const jobs = yield* runtime.inspection();
|
|
28
29
|
return yield* jobsFailures(jobs.counts(definition));
|
|
29
30
|
}),
|
|
30
31
|
"admin.jobs.deadLettered": ({ queue, ...options }) => Effect.gen(function* () {
|
|
31
32
|
const definition = yield* registered(queue);
|
|
32
|
-
const
|
|
33
|
+
const runtime = yield* service;
|
|
34
|
+
const jobs = yield* runtime.inspection();
|
|
33
35
|
return yield* jobsFailures(jobs.deadLetteredJobs(definition, options));
|
|
34
36
|
}),
|
|
35
37
|
"admin.jobs.failed": ({ queue, ...options }) => Effect.gen(function* () {
|
|
36
38
|
const definition = yield* registered(queue);
|
|
37
|
-
const
|
|
39
|
+
const runtime = yield* service;
|
|
40
|
+
const jobs = yield* runtime.inspection();
|
|
38
41
|
return yield* jobsFailures(jobs.failedJobs(definition, options));
|
|
39
42
|
}),
|
|
40
43
|
"admin.jobs.health": () => Effect.gen(function* () {
|
|
41
|
-
const
|
|
44
|
+
const runtime = yield* service;
|
|
45
|
+
const jobs = yield* runtime.inspection();
|
|
42
46
|
return yield* jobsFailures(jobs.health(page.queues));
|
|
43
47
|
}),
|
|
44
48
|
"admin.jobs.job": ({ id, queue }) => Effect.gen(function* () {
|
|
45
49
|
const definition = yield* registered(queue);
|
|
46
|
-
const
|
|
50
|
+
const runtime = yield* service;
|
|
51
|
+
const jobs = yield* runtime.inspection();
|
|
47
52
|
const result = yield* jobsFailures(jobs.getJob(definition, id));
|
|
48
53
|
if (Option.isNone(result)) {
|
|
49
54
|
return Option.none();
|
|
50
55
|
}
|
|
51
56
|
const job = result.value;
|
|
52
|
-
const output = yield*
|
|
57
|
+
const output = yield* jobsFailures(readJobFailure(queue, job.output));
|
|
53
58
|
return Option.some({
|
|
54
59
|
attempt: job.startedOn === null ? 0 : job.retryCount + 1,
|
|
55
60
|
completedOn: Option.map(Option.fromNullishOr(job.completedOn), DateTime.makeUnsafe),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobsHandlers.js","sourceRoot":"","sources":["../../src/server/jobsHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,QAAQ,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"jobsHandlers.js","sourceRoot":"","sources":["../../src/server/jobsHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AAC7E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE1E,OAAO,EAAoC,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE7E,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE9F,MAAM,UAAU,YAAY,CAAO,MAAkF;IACpH,OAAO,MAAM,CAAC,IAAI,CACjB,MAAM,CAAC,QAA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,EAAE,GAAG,CAAC,IAAI;gBACf,UAAU,EAAE,GAAG,CAAC,UAAU;gBAC1B,UAAU,EAAE,GAAG,CAAC,UAAU;gBAC1B,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;gBAC/E,KAAK,EAAE,GAAG,CAAC,KAAK;aAChB,CAAC,CAAC;QACJ,CAAC,CAAC;KACH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAC3B,IAA0C,EAC1C,OAAiD;IAEjD,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobsHandlersWithRetry.d.ts","sourceRoot":"","sources":["../../src/server/jobsHandlersWithRetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAkB,MAAM,QAAQ,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAa,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAK3E,wBAAgB,qBAAqB,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,SAAS,EAAE,EAAE,QAAQ,EACzF,IAAI,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC,EACnD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"jobsHandlersWithRetry.d.ts","sourceRoot":"","sources":["../../src/server/jobsHandlersWithRetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAkB,MAAM,QAAQ,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAa,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAK3E,wBAAgB,qBAAqB,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,SAAS,EAAE,EAAE,QAAQ,EACzF,IAAI,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC,EACnD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC,wjCAsBjD"}
|
|
@@ -17,12 +17,13 @@ export function jobsHandlersWithRetry(page, service) {
|
|
|
17
17
|
return yield* Effect.fail(new JobsQueueUnregistered({ queue }));
|
|
18
18
|
}
|
|
19
19
|
const definition = jobsQueue(entry);
|
|
20
|
-
const
|
|
20
|
+
const runtime = yield* service;
|
|
21
|
+
const jobs = yield* runtime.inspection();
|
|
21
22
|
const job = yield* jobsFailures(jobs.getJob(definition, id));
|
|
22
23
|
if (Option.isNone(job) || job.value.state !== "failed") {
|
|
23
24
|
return yield* Effect.fail(new JobsNotFailed({ id, queue }));
|
|
24
25
|
}
|
|
25
|
-
yield* jobsFailures(
|
|
26
|
+
yield* jobsFailures(runtime.retry(definition, id));
|
|
26
27
|
}),
|
|
27
28
|
});
|
|
28
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobsHandlersWithRetry.js","sourceRoot":"","sources":["../../src/server/jobsHandlersWithRetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACtD,OAAO,EAAE,i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AAC;YACpC,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC;YAC/B,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACzC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAuC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;YACnG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACxD,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;YAC7D,CAAC;YACD,KAAK,CAAC,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC;KACH,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/server/users.d.ts
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import { DateTime, Effect
|
|
2
|
-
import { SqlClient } from "effect/sql";
|
|
3
|
-
import type { AccessPolicy } from "@shivaedev/access/roleSet.ts";
|
|
4
|
-
import { AuthUnavailable } from "@shivaedev/errors/taxonomy.ts";
|
|
1
|
+
import { DateTime, Effect } from "effect";
|
|
5
2
|
import { SessionUser } from "@shivaedev/identity/identity.ts";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
export declare const listUsers:
|
|
3
|
+
import { UserDirectory } from "@shivaedev/identity/server/UserDirectory.ts";
|
|
4
|
+
import type { ChangeRoleInput } from "#users/ChangeRoleInput.ts";
|
|
5
|
+
export declare const listUsers: (input: {
|
|
9
6
|
readonly cursor?: string;
|
|
10
7
|
readonly limit: number;
|
|
11
|
-
}
|
|
12
|
-
next: Option.Option<string>;
|
|
13
|
-
users: {
|
|
8
|
+
}) => Effect.Effect<{
|
|
9
|
+
readonly next: import("effect/Option").Option<string>;
|
|
10
|
+
readonly users: readonly {
|
|
14
11
|
readonly createdAt: DateTime.Utc;
|
|
15
12
|
readonly email: string;
|
|
16
13
|
readonly id: string;
|
|
17
14
|
readonly name: string;
|
|
18
|
-
readonly role:
|
|
15
|
+
readonly role: string;
|
|
19
16
|
}[];
|
|
20
|
-
}, AuthUnavailable | import("@shivaedev/errors/taxonomy.ts").Forbidden, SessionUser |
|
|
21
|
-
export declare const changeUserRole:
|
|
17
|
+
}, import("@shivaedev/errors/taxonomy.ts").AuthUnavailable | import("@shivaedev/errors/taxonomy.ts").Forbidden, SessionUser | UserDirectory>;
|
|
18
|
+
export declare const changeUserRole: (input: ChangeRoleInput<string>) => Effect.Effect<void, import("@shivaedev/errors/taxonomy.ts").AuthUnavailable | import("@shivaedev/errors/taxonomy.ts").Forbidden | import("@shivaedev/identity/roles.ts").LastRoleAssigner | import("@shivaedev/errors/taxonomy.ts").NotFound, SessionUser | UserDirectory>;
|
|
22
19
|
//# sourceMappingURL=users.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/server/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/server/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAG5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,eAAO,MAAM,SAAS;;;;;;;;;;;;4IAGpB,CAAC;AAEH,eAAO,MAAM,cAAc,gTAQzB,CAAC"}
|
package/dist/server/users.js
CHANGED
|
@@ -1,35 +1,17 @@
|
|
|
1
|
-
import { DateTime, Effect
|
|
2
|
-
import { SqlClient, SqlSchema } from "effect/sql";
|
|
1
|
+
import { DateTime, Effect } from "effect";
|
|
3
2
|
import { requirePermission } from "@shivaedev/access/requirePermission.ts";
|
|
4
|
-
import { AssignRoles } from "@shivaedev/access/roles.ts";
|
|
5
|
-
import { AuthUnavailable } from "@shivaedev/errors/taxonomy.ts";
|
|
6
3
|
import { SessionUser } from "@shivaedev/identity/identity.ts";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { AssignRoles } from "@shivaedev/identity/roles.ts";
|
|
5
|
+
import { UserDirectory } from "@shivaedev/identity/server/UserDirectory.ts";
|
|
9
6
|
import { ReadUsers } from "#permissions.ts";
|
|
10
|
-
|
|
11
|
-
function unavailable() {
|
|
12
|
-
return new AuthUnavailable({ message: "Could not access app users" });
|
|
13
|
-
}
|
|
14
|
-
export const listUsers = Effect.fn("Admin.listUsers")(function* (access, input, options) {
|
|
7
|
+
export const listUsers = Effect.fn("Admin.listUsers")(function* (input) {
|
|
15
8
|
yield* requirePermission(yield* SessionUser, ReadUsers);
|
|
16
|
-
|
|
17
|
-
const { user } = tables(options);
|
|
18
|
-
const read = SqlSchema.findAll({
|
|
19
|
-
execute: () => sql `select id, ${sql(user.name)} as name, ${sql(user.email)} as email,
|
|
20
|
-
${sql(user.role)} as role, ${sql(user.createdAt)} as "createdAt" from ${sql(user.table)}
|
|
21
|
-
where id > ${input.cursor ?? ""} order by id limit ${input.limit + 1}`,
|
|
22
|
-
Request: Schema.Void,
|
|
23
|
-
Result: Schema.Struct({ ...AppUser.fields, role: access.Role }),
|
|
24
|
-
});
|
|
25
|
-
const rows = yield* read(undefined).pipe(Effect.mapError(unavailable));
|
|
26
|
-
const users = rows.slice(0, input.limit);
|
|
27
|
-
return { next: rows.length > input.limit ? Option.fromUndefinedOr(users.at(-1)?.id) : Option.none(), users };
|
|
9
|
+
return yield* (yield* UserDirectory).list(input);
|
|
28
10
|
});
|
|
29
|
-
export const changeUserRole = Effect.fn("Admin.changeUserRole")(function* (
|
|
11
|
+
export const changeUserRole = Effect.fn("Admin.changeUserRole")(function* (input) {
|
|
30
12
|
const actor = yield* SessionUser;
|
|
31
13
|
yield* requirePermission(actor, AssignRoles);
|
|
32
|
-
const changed = yield* assignRole(
|
|
14
|
+
const changed = yield* (yield* UserDirectory).assignRole(input.userId, input.role);
|
|
33
15
|
if (changed) {
|
|
34
16
|
const changedAt = DateTime.formatIso(yield* DateTime.now);
|
|
35
17
|
yield* Effect.logInfo("User role changed").pipe(Effect.annotateLogs({ actorId: actor.id, changedAt, ...input }));
|
package/dist/server/users.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/server/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/server/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAE5E,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAgC;IAChG,KAAK,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACxD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAClD,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC,sBAAsB,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAsB;IAChG,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,WAAW,CAAC;IACjC,KAAK,CAAC,CAAC,iBAAiB,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnF,IAAI,OAAO,EAAE,CAAC;QACb,MAAM,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC1D,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC;IAClH,CAAC;AACF,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { AccessPolicy } from "@shivaedev/access/roleSet.ts";
|
|
2
|
-
import type { AuthTableOptions } from "@shivaedev/identity/server/better-auth/adapters/tables.ts";
|
|
3
1
|
import type { usersPage } from "#users/page.ts";
|
|
4
|
-
export declare function usersHandlers<const TRole extends string>(page: ReturnType<typeof usersPage<TRole
|
|
2
|
+
export declare function usersHandlers<const TRole extends string>(page: ReturnType<typeof usersPage<TRole>>): import("effect/Layer").Layer<import("effect/rpc/Rpc").Handler<"admin.users.changeRole"> | import("effect/rpc/Rpc").Handler<"admin.users.list">, never, import("@shivaedev/identity/server/UserDirectory.ts").UserDirectory>;
|
|
5
3
|
//# sourceMappingURL=usersHandlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usersHandlers.d.ts","sourceRoot":"","sources":["../../src/server/usersHandlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usersHandlers.d.ts","sourceRoot":"","sources":["../../src/server/usersHandlers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,wBAAgB,aAAa,CAAC,KAAK,CAAC,KAAK,SAAS,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,+NASlG"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import { AssignRoles } from "@shivaedev/access/roles.ts";
|
|
3
2
|
import { SessionUser } from "@shivaedev/identity/identity.ts";
|
|
4
3
|
import { hasPermission } from "@shivaedev/identity/permission.ts";
|
|
4
|
+
import { AssignRoles } from "@shivaedev/identity/roles.ts";
|
|
5
5
|
import { changeUserRole, listUsers } from "#server/users.ts";
|
|
6
|
-
export function usersHandlers(page
|
|
6
|
+
export function usersHandlers(page) {
|
|
7
7
|
return page.contract.application.toLayer({
|
|
8
|
-
"admin.users.changeRole": (input) => changeUserRole(
|
|
8
|
+
"admin.users.changeRole": (input) => changeUserRole(input),
|
|
9
9
|
"admin.users.list": (input) => Effect.gen(function* () {
|
|
10
10
|
const user = yield* SessionUser;
|
|
11
|
-
return { ...(yield* listUsers(
|
|
11
|
+
return { ...(yield* listUsers(input)), canChangeRoles: hasPermission(user, AssignRoles) };
|
|
12
12
|
}),
|
|
13
13
|
});
|
|
14
14
|
}
|