@shivaedev/admin 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -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/{SessionsView.d.ts → adapters/SessionsView.d.ts} +1 -1
- 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 +92 -44
- package/dist/jobs/page.d.ts.map +1 -1
- package/dist/jobs/retryPage.d.ts +57 -9
- 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 +3 -3
- package/dist/server/jobsHandlers.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 +24 -8
- 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 -13
- 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/{SessionsView.ts → adapters/SessionsView.ts} +1 -1
- 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 +3 -5
- 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.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/{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 & {
|
|
@@ -147,7 +147,33 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
147
147
|
readonly id: string;
|
|
148
148
|
readonly queue: string;
|
|
149
149
|
}, import("@shivaedev/errors/taxonomy.ts").BadRequest | import("#jobs/schemas.ts").JobsPayloadInvalid | import("#jobs/schemas.ts").JobsQueueUnregistered | import("#jobs/schemas.ts").JobsUnavailable, import("@shivaedev/identity/identity.ts").SessionUser>;
|
|
150
|
-
}], readonly [], import("effect/rpc/Rpc").Rpc<"admin.jobs
|
|
150
|
+
}], readonly [], import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
|
|
151
|
+
id: Schema.String;
|
|
152
|
+
queue: Schema.String;
|
|
153
|
+
}>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
|
|
154
|
+
readonly attempt: Schema.Number;
|
|
155
|
+
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
156
|
+
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
157
|
+
readonly id: Schema.String;
|
|
158
|
+
readonly output: Schema.NullOr<Schema.Struct<{
|
|
159
|
+
readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
160
|
+
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
161
|
+
}>>;
|
|
162
|
+
readonly retryCount: Schema.Number;
|
|
163
|
+
readonly retryLimit: Schema.Number;
|
|
164
|
+
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
165
|
+
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
166
|
+
readonly data: Schema.Unknown;
|
|
167
|
+
readonly queue: Schema.Literal<string>;
|
|
168
|
+
}>[]>>, 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: {
|
|
169
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
170
|
+
readonly payload: unknown;
|
|
171
|
+
}) => 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>> & {
|
|
172
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
173
|
+
"~ClientError": never;
|
|
174
|
+
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]>;
|
|
175
|
+
requiredForClient: false;
|
|
176
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.$changes", Schema.Struct<{
|
|
151
177
|
queries: Schema.$Array<Schema.Union<readonly (Schema.Struct<{
|
|
152
178
|
query: Schema.Literal<"counts">;
|
|
153
179
|
payload: Schema.Struct<{
|
|
@@ -195,14 +221,52 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
195
221
|
readonly queryIndexes: Schema.optional<Schema.$Array<Schema.Number>>;
|
|
196
222
|
}>, Schema.Struct<{
|
|
197
223
|
readonly _tag: Schema.Literal<"Resync">;
|
|
198
|
-
}>]>, ...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
|
|
224
|
+
}>]>, 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: {
|
|
225
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
226
|
+
readonly payload: unknown;
|
|
227
|
+
}) => 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>> & {
|
|
228
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
229
|
+
"~ClientError": never;
|
|
230
|
+
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]>;
|
|
231
|
+
requiredForClient: false;
|
|
232
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.counts", Schema.Struct<{
|
|
199
233
|
queue: Schema.String;
|
|
200
234
|
}>, Schema.Struct<{
|
|
201
235
|
readonly activeCount: Schema.Number;
|
|
202
236
|
readonly failedCount: Schema.Number;
|
|
203
237
|
readonly queuedCount: Schema.Number;
|
|
204
238
|
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
|
|
239
|
+
}>, 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: {
|
|
240
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
241
|
+
readonly payload: unknown;
|
|
242
|
+
}) => 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>> & {
|
|
243
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
244
|
+
"~ClientError": never;
|
|
245
|
+
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]>;
|
|
246
|
+
requiredForClient: false;
|
|
247
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.health", Schema.Void, Schema.Struct<{
|
|
248
|
+
readonly activeTotal: Schema.Number;
|
|
249
|
+
readonly deadLetteredTotal: Schema.Number;
|
|
250
|
+
readonly failedTotal: Schema.Number;
|
|
251
|
+
readonly jobs: Schema.$Array<Schema.Struct<{
|
|
252
|
+
readonly activeCount: Schema.Number;
|
|
253
|
+
readonly deadLetteredCount: Schema.Number;
|
|
254
|
+
readonly failedCount: Schema.Number;
|
|
255
|
+
readonly name: Schema.String;
|
|
256
|
+
readonly queuedCount: Schema.Number;
|
|
257
|
+
readonly readyCount: Schema.Number;
|
|
258
|
+
}>>;
|
|
259
|
+
readonly queuedTotal: Schema.Number;
|
|
260
|
+
readonly readyTotal: Schema.Number;
|
|
261
|
+
}>, 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: {
|
|
262
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
263
|
+
readonly payload: unknown;
|
|
264
|
+
}) => 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>> & {
|
|
265
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
266
|
+
"~ClientError": never;
|
|
267
|
+
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]>;
|
|
268
|
+
requiredForClient: false;
|
|
269
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
|
|
206
270
|
cursor: Schema.optionalKey<Schema.String>;
|
|
207
271
|
limit: Schema.Number;
|
|
208
272
|
queue: Schema.String;
|
|
@@ -222,15 +286,17 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
222
286
|
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
223
287
|
readonly data: Schema.Unknown;
|
|
224
288
|
readonly queue: Schema.Literal<string>;
|
|
225
|
-
readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
|
|
226
|
-
readonly sourceOutput: Schema.NullOr<Schema.Struct<{
|
|
227
|
-
readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
228
|
-
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
229
|
-
}>>;
|
|
230
|
-
readonly sourceQueue: Schema.Literal<string>;
|
|
231
289
|
}>[]>>;
|
|
232
290
|
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
|
|
291
|
+
}>, 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: {
|
|
292
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
293
|
+
readonly payload: unknown;
|
|
294
|
+
}) => 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>> & {
|
|
295
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
296
|
+
"~ClientError": never;
|
|
297
|
+
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]>;
|
|
298
|
+
requiredForClient: false;
|
|
299
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.deadLettered", Schema.Struct<{
|
|
234
300
|
cursor: Schema.optionalKey<Schema.String>;
|
|
235
301
|
limit: Schema.Number;
|
|
236
302
|
queue: Schema.String;
|
|
@@ -250,41 +316,23 @@ export declare function jobsPage<const TQueues extends readonly JobsEntry[]>(...
|
|
|
250
316
|
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
251
317
|
readonly data: Schema.Unknown;
|
|
252
318
|
readonly queue: Schema.Literal<string>;
|
|
319
|
+
readonly sourceId: Schema.OptionFromNullOr<Schema.String>;
|
|
320
|
+
readonly sourceOutput: Schema.NullOr<Schema.Struct<{
|
|
321
|
+
readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
322
|
+
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
323
|
+
}>>;
|
|
324
|
+
readonly sourceQueue: Schema.Literal<string>;
|
|
253
325
|
}>[]>>;
|
|
254
326
|
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
|
|
256
|
-
readonly
|
|
257
|
-
readonly
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
readonly queuedCount: Schema.Number;
|
|
265
|
-
readonly readyCount: Schema.Number;
|
|
266
|
-
}>>;
|
|
267
|
-
readonly queuedTotal: Schema.Number;
|
|
268
|
-
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, never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
|
|
270
|
-
id: Schema.String;
|
|
271
|
-
queue: Schema.String;
|
|
272
|
-
}>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
|
|
273
|
-
readonly attempt: Schema.Number;
|
|
274
|
-
readonly completedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
275
|
-
readonly createdOn: Schema.DateTimeUtcFromString;
|
|
276
|
-
readonly id: Schema.String;
|
|
277
|
-
readonly output: Schema.NullOr<Schema.Struct<{
|
|
278
|
-
readonly _tag: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
279
|
-
readonly message: Schema.decodeTo<Schema.String, Schema.String, never, never>;
|
|
280
|
-
}>>;
|
|
281
|
-
readonly retryCount: Schema.Number;
|
|
282
|
-
readonly retryLimit: Schema.Number;
|
|
283
|
-
readonly startedOn: Schema.OptionFromNullOr<Schema.DateTimeUtcFromString>;
|
|
284
|
-
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
285
|
-
readonly data: Schema.Unknown;
|
|
286
|
-
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, never>, readonly [], undefined>;
|
|
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
|
@@ -235,17 +235,30 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
|
|
|
235
235
|
readonly queryIndexes: Schema.optional<Schema.$Array<Schema.Number>>;
|
|
236
236
|
}>, Schema.Struct<{
|
|
237
237
|
readonly _tag: Schema.Literal<"Resync">;
|
|
238
|
-
}>]>, ...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,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}
|
|
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<{
|
|
242
247
|
queue: Schema.String;
|
|
243
248
|
}>, Schema.Struct<{
|
|
244
249
|
readonly activeCount: Schema.Number;
|
|
245
250
|
readonly failedCount: Schema.Number;
|
|
246
251
|
readonly queuedCount: Schema.Number;
|
|
247
252
|
readonly totalCount: Schema.Number;
|
|
248
|
-
}>, 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,
|
|
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.deadLettered", Schema.Struct<{
|
|
249
262
|
cursor: Schema.optionalKey<Schema.String>;
|
|
250
263
|
limit: Schema.Number;
|
|
251
264
|
queue: Schema.String;
|
|
@@ -273,7 +286,15 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
|
|
|
273
286
|
readonly sourceQueue: Schema.Literal<string>;
|
|
274
287
|
}>[]>>;
|
|
275
288
|
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
276
|
-
}>, 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,
|
|
289
|
+
}>, 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: {
|
|
290
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
291
|
+
readonly payload: unknown;
|
|
292
|
+
}) => 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>> & {
|
|
293
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
294
|
+
"~ClientError": never;
|
|
295
|
+
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]>;
|
|
296
|
+
requiredForClient: false;
|
|
297
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.failed", Schema.Struct<{
|
|
277
298
|
cursor: Schema.optionalKey<Schema.String>;
|
|
278
299
|
limit: Schema.Number;
|
|
279
300
|
queue: Schema.String;
|
|
@@ -295,7 +316,15 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
|
|
|
295
316
|
readonly queue: Schema.Literal<string>;
|
|
296
317
|
}>[]>>;
|
|
297
318
|
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
298
|
-
}>, 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.health", Schema.Void, Schema.Struct<{
|
|
299
328
|
readonly activeTotal: Schema.Number;
|
|
300
329
|
readonly deadLetteredTotal: Schema.Number;
|
|
301
330
|
readonly failedTotal: Schema.Number;
|
|
@@ -309,7 +338,15 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
|
|
|
309
338
|
}>>;
|
|
310
339
|
readonly queuedTotal: Schema.Number;
|
|
311
340
|
readonly readyTotal: Schema.Number;
|
|
312
|
-
}>, 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,
|
|
341
|
+
}>, 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: {
|
|
342
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
343
|
+
readonly payload: unknown;
|
|
344
|
+
}) => 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>> & {
|
|
345
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
346
|
+
"~ClientError": never;
|
|
347
|
+
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]>;
|
|
348
|
+
requiredForClient: false;
|
|
349
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.job", Schema.Struct<{
|
|
313
350
|
id: Schema.String;
|
|
314
351
|
queue: Schema.String;
|
|
315
352
|
}>, Schema.OptionFromNullOr<Schema.Union<Schema.Struct<{
|
|
@@ -327,7 +364,18 @@ export declare function jobsPageWithRetry<const TQueues extends readonly JobsEnt
|
|
|
327
364
|
readonly state: Schema.Literals<readonly ["created", "retry", "active", "completed", "cancelled", "failed"]>;
|
|
328
365
|
readonly data: Schema.Unknown;
|
|
329
366
|
readonly queue: Schema.Literal<string>;
|
|
330
|
-
}>[]>>, 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,
|
|
367
|
+
}>[]>>, 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: {
|
|
368
|
+
readonly rpc: import("effect/rpc/Rpc").Any;
|
|
369
|
+
readonly payload: unknown;
|
|
370
|
+
}) => 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>> & {
|
|
371
|
+
"~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
|
|
372
|
+
"~ClientError": never;
|
|
373
|
+
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]>;
|
|
374
|
+
requiredForClient: false;
|
|
375
|
+
}), never> | import("effect/rpc/Rpc").Rpc<"admin.jobs.retry", Schema.Struct<{
|
|
376
|
+
id: Schema.String;
|
|
377
|
+
queue: Schema.String;
|
|
378
|
+
}>, 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>;
|
|
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,gBAAgB,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE9F,wBAAgB,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,WAAW,GAAG,kBAAkB,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,0EAapH;AAED,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,SAAS,EAAE,EAAE,QAAQ,EACpF,IAAI,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;CAAE,EAClC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC;IAQhD,mBAAmB,cAAc;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE;IAM3D,yBAAyB,0BAA0B;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IAM/H,mBAAmB,0BAA0B;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IAMzH,mBAAmB;IAKnB,gBAAgB,kBAAkB;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBlF;AAED,wBAAgB,YAAY,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,SAAS,EAAE,EAAE,QAAQ,EAChF,IAAI,EAAE,UAAU,CAAC,OAAO,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) {
|
|
@@ -49,7 +49,7 @@ export function jobsReadHandlers(page, service) {
|
|
|
49
49
|
return Option.none();
|
|
50
50
|
}
|
|
51
51
|
const job = result.value;
|
|
52
|
-
const output = yield*
|
|
52
|
+
const output = yield* jobsFailures(readJobFailure(queue, job.output));
|
|
53
53
|
return Option.some({
|
|
54
54
|
attempt: job.startedOn === null ? 0 : job.retryCount + 1,
|
|
55
55
|
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":"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"}
|
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/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
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usersHandlers.js","sourceRoot":"","sources":["../../src/server/usersHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"usersHandlers.js","sourceRoot":"","sources":["../../src/server/usersHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7D,MAAM,UAAU,aAAa,CAA6B,IAAyC;IAClG,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC;QACxC,wBAAwB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC;QAC1D,kBAAkB,EAAE,CAAC,KAAK,EAAE,EAAE,CAC7B,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;YACnB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,WAAW,CAAC;YAChC,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,EAAE,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,CAAC;QAC3F,CAAC,CAAC;KACH,CAAC,CAAC;AACJ,CAAC"}
|