@shivaedev/admin 0.24.2 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +88 -76
  3. package/dist/Jobs.d.ts +71 -0
  4. package/dist/Jobs.d.ts.map +1 -0
  5. package/dist/Jobs.js +13 -0
  6. package/dist/Jobs.js.map +1 -0
  7. package/dist/JobsWithRetry.d.ts +92 -0
  8. package/dist/JobsWithRetry.d.ts.map +1 -0
  9. package/dist/JobsWithRetry.js +40 -0
  10. package/dist/JobsWithRetry.js.map +1 -0
  11. package/dist/Users.d.ts +35 -0
  12. package/dist/Users.d.ts.map +1 -0
  13. package/dist/Users.js +35 -0
  14. package/dist/Users.js.map +1 -0
  15. package/dist/client/adapters/SessionConfirmation.d.ts +1 -1
  16. package/dist/client/adapters/SessionConfirmation.d.ts.map +1 -1
  17. package/dist/client/adapters/SessionListView.d.ts +1 -1
  18. package/dist/client/adapters/SessionListView.d.ts.map +1 -1
  19. package/dist/client/adapters/SessionPagination.d.ts +2 -2
  20. package/dist/client/adapters/SessionPagination.d.ts.map +1 -1
  21. package/dist/client/adapters/SessionsView.d.ts +2 -2
  22. package/dist/client/adapters/SessionsView.d.ts.map +1 -1
  23. package/dist/client/adapters/UsersTable.d.ts +2 -2
  24. package/dist/client/adapters/UsersTable.d.ts.map +1 -1
  25. package/dist/client/adapters/UsersTable.js.map +1 -1
  26. package/dist/client/adapters/UsersView.d.ts +2 -2
  27. package/dist/client/adapters/UsersView.d.ts.map +1 -1
  28. package/dist/client/adapters/jobsTypes.d.ts +8 -8
  29. package/dist/client/adapters/jobsTypes.d.ts.map +1 -1
  30. package/dist/generated/Jobs.d.ts +144 -0
  31. package/dist/generated/Jobs.d.ts.map +1 -0
  32. package/dist/generated/Jobs.js +35 -0
  33. package/dist/generated/Jobs.js.map +1 -0
  34. package/dist/generated/JobsWithRetry.d.ts +182 -0
  35. package/dist/generated/JobsWithRetry.d.ts.map +1 -0
  36. package/dist/generated/JobsWithRetry.js +50 -0
  37. package/dist/generated/JobsWithRetry.js.map +1 -0
  38. package/dist/generated/Users.d.ts +65 -0
  39. package/dist/generated/Users.d.ts.map +1 -0
  40. package/dist/generated/Users.js +27 -0
  41. package/dist/generated/Users.js.map +1 -0
  42. package/dist/jobs/DeadLetter.d.ts +27 -0
  43. package/dist/jobs/DeadLetter.d.ts.map +1 -0
  44. package/dist/jobs/DeadLetter.js +11 -0
  45. package/dist/jobs/DeadLetter.js.map +1 -0
  46. package/dist/jobs/NotFailed.d.ts +9 -0
  47. package/dist/jobs/NotFailed.d.ts.map +1 -0
  48. package/dist/jobs/NotFailed.js +7 -0
  49. package/dist/jobs/NotFailed.js.map +1 -0
  50. package/dist/jobs/Page.d.ts +272 -0
  51. package/dist/jobs/Page.d.ts.map +1 -0
  52. package/dist/jobs/Page.js +10 -0
  53. package/dist/jobs/Page.js.map +1 -0
  54. package/dist/jobs/PageWithRetry.d.ts +296 -0
  55. package/dist/jobs/PageWithRetry.d.ts.map +1 -0
  56. package/dist/jobs/PageWithRetry.js +10 -0
  57. package/dist/jobs/PageWithRetry.js.map +1 -0
  58. package/dist/jobs/Row.d.ts +21 -0
  59. package/dist/jobs/Row.d.ts.map +1 -0
  60. package/dist/jobs/Row.js +5 -0
  61. package/dist/jobs/Row.js.map +1 -0
  62. package/dist/jobs/keys.d.ts +5 -5
  63. package/dist/jobs/schemas.d.ts +2 -55
  64. package/dist/jobs/schemas.d.ts.map +1 -1
  65. package/dist/jobs/schemas.js +2 -19
  66. package/dist/jobs/schemas.js.map +1 -1
  67. package/dist/page.d.ts +4 -3
  68. package/dist/page.d.ts.map +1 -1
  69. package/dist/page.js.map +1 -1
  70. package/dist/server/RegisteredQueues.d.ts +21 -0
  71. package/dist/server/RegisteredQueues.d.ts.map +1 -0
  72. package/dist/server/RegisteredQueues.js +4 -0
  73. package/dist/server/RegisteredQueues.js.map +1 -0
  74. package/dist/server/adapters/pgBossQueues.d.ts +6 -0
  75. package/dist/server/adapters/pgBossQueues.d.ts.map +1 -0
  76. package/dist/server/adapters/pgBossQueues.js +57 -0
  77. package/dist/server/adapters/pgBossQueues.js.map +1 -0
  78. package/dist/server/jobsReads.d.ts +40 -0
  79. package/dist/server/jobsReads.d.ts.map +1 -0
  80. package/dist/server/jobsReads.js +65 -0
  81. package/dist/server/jobsReads.js.map +1 -0
  82. package/dist/sessions/Page.d.ts +31 -27
  83. package/dist/sessions/Page.d.ts.map +1 -1
  84. package/dist/sessions/Page.js +1 -1
  85. package/dist/sessions/Page.js.map +1 -1
  86. package/dist/users/List.d.ts +5 -0
  87. package/dist/users/List.d.ts.map +1 -0
  88. package/dist/users/List.js +2 -0
  89. package/dist/users/List.js.map +1 -0
  90. package/dist/users/Page.d.ts +104 -0
  91. package/dist/users/Page.d.ts.map +1 -0
  92. package/dist/users/Page.js +10 -0
  93. package/dist/users/Page.js.map +1 -0
  94. package/package.json +25 -23
  95. package/src/Jobs.ts +13 -0
  96. package/src/JobsWithRetry.ts +42 -0
  97. package/src/Users.ts +38 -0
  98. package/src/client/adapters/SessionConfirmation.tsx +1 -1
  99. package/src/client/adapters/SessionListView.tsx +1 -1
  100. package/src/client/adapters/SessionPagination.tsx +2 -2
  101. package/src/client/adapters/SessionsView.ts +2 -2
  102. package/src/client/adapters/UsersTable.tsx +3 -3
  103. package/src/client/adapters/UsersView.ts +2 -2
  104. package/src/client/adapters/jobsTypes.ts +8 -8
  105. package/src/generated/Jobs.ts +40 -0
  106. package/src/generated/JobsWithRetry.ts +55 -0
  107. package/src/generated/README.md +1 -0
  108. package/src/generated/Users.ts +32 -0
  109. package/src/jobs/DeadLetter.ts +10 -0
  110. package/src/jobs/NotFailed.ts +6 -0
  111. package/src/jobs/Page.ts +10 -0
  112. package/src/jobs/PageWithRetry.ts +10 -0
  113. package/src/jobs/Row.ts +4 -0
  114. package/src/jobs/schemas.ts +2 -23
  115. package/src/page.ts +8 -9
  116. package/src/server/RegisteredQueues.ts +22 -0
  117. package/src/server/adapters/pgBossQueues.ts +94 -0
  118. package/src/server/jobsReads.ts +72 -0
  119. package/src/sessions/Page.ts +1 -1
  120. package/src/users/List.ts +3 -0
  121. package/src/users/Page.ts +10 -0
  122. package/dist/jobs/page.d.ts +0 -425
  123. package/dist/jobs/page.d.ts.map +0 -1
  124. package/dist/jobs/page.js +0 -58
  125. package/dist/jobs/page.js.map +0 -1
  126. package/dist/jobs/retryPage.d.ts +0 -480
  127. package/dist/jobs/retryPage.d.ts.map +0 -1
  128. package/dist/jobs/retryPage.js +0 -50
  129. package/dist/jobs/retryPage.js.map +0 -1
  130. package/dist/server/jobsHandlers.d.ts +0 -62
  131. package/dist/server/jobsHandlers.d.ts.map +0 -1
  132. package/dist/server/jobsHandlers.js +0 -73
  133. package/dist/server/jobsHandlers.js.map +0 -1
  134. package/dist/server/jobsHandlersWithRetry.d.ts +0 -7
  135. package/dist/server/jobsHandlersWithRetry.d.ts.map +0 -1
  136. package/dist/server/jobsHandlersWithRetry.js +0 -43
  137. package/dist/server/jobsHandlersWithRetry.js.map +0 -1
  138. package/dist/server/usersHandlers.d.ts +0 -3
  139. package/dist/server/usersHandlers.d.ts.map +0 -1
  140. package/dist/server/usersHandlers.js +0 -15
  141. package/dist/server/usersHandlers.js.map +0 -1
  142. package/dist/users/page.d.ts +0 -115
  143. package/dist/users/page.d.ts.map +0 -1
  144. package/dist/users/page.js +0 -35
  145. package/dist/users/page.js.map +0 -1
  146. package/src/jobs/page.ts +0 -58
  147. package/src/jobs/retryPage.ts +0 -54
  148. package/src/server/jobsHandlers.ts +0 -95
  149. package/src/server/jobsHandlersWithRetry.ts +0 -59
  150. package/src/server/usersHandlers.ts +0 -17
  151. package/src/users/page.ts +0 -36
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RegisteredQueues.d.ts","sourceRoot":"","sources":["../../src/server/RegisteredQueues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK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AAC,IAAI,EAAE,IAAI,GAAG,kBAAkB,GAAG,aAAa,CAAC;6BACpF,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC;;AAT3F,qBAAa,gBAAiB,SAAQ,qBAWE;CAAG"}
@@ -0,0 +1,4 @@
1
+ import { Context } from "effect";
2
+ export class RegisteredQueues extends Context.Service()("@shivaedev/admin/RegisteredQueues") {
3
+ }
4
+ //# sourceMappingURL=RegisteredQueues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RegisteredQueues.js","sourceRoot":"","sources":["../../src/server/RegisteredQueues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA4B,MAAM,QAAQ,CAAC;AAU3D,MAAM,OAAO,gBAAiB,SAAQ,OAAO,CAAC,OAAO,EAWlD,CAAC,mCAAmC,CAAC;CAAG"}
@@ -0,0 +1,6 @@
1
+ import { type Context, Layer } from "effect";
2
+ import type { PgBossService } from "@shivaedev/jobs/server/service.ts";
3
+ import { type JobsEntry, type JobsPayload } from "#jobs/entry.ts";
4
+ import { RegisteredQueues } from "#server/RegisteredQueues.ts";
5
+ export declare function pgBossQueues<const TQueues extends readonly JobsEntry[], TService>(service: Context.Service<TService, PgBossService>, ...queues: TQueues): Layer.Layer<RegisteredQueues, never, Exclude<TService, import("effect/Scope").Scope> | Exclude<JobsPayload<TQueues[number]>["DecodingServices"], import("effect/Scope").Scope>>;
6
+ //# sourceMappingURL=pgBossQueues.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pgBossQueues.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/pgBossQueues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAU,KAAK,EAAuB,MAAM,QAAQ,CAAC;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAa,MAAM,gBAAgB,CAAC;AAG7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AA+B/D,wBAAgB,YAAY,CAAC,KAAK,CAAC,OAAO,SAAS,SAAS,SAAS,EAAE,EAAE,QAAQ,EAChF,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC,EACjD,GAAG,MAAM,EAAE,OAAO,mLAqDlB"}
@@ -0,0 +1,57 @@
1
+ import { Effect, Layer, Option } from "effect";
2
+ import { BadRequest } from "@shivaedev/errors/taxonomy.ts";
3
+ import { jobsQueue } from "#jobs/entry.ts";
4
+ import { JobsNotFailed } from "#jobs/NotFailed.ts";
5
+ import { JobsPayloadInvalid, JobsQueueUnregistered, JobsUnavailable } from "#jobs/schemas.ts";
6
+ import { RegisteredQueues } from "#server/RegisteredQueues.ts";
7
+ function jobsFailures(effect) {
8
+ return effect.pipe(Effect.mapError((error) => {
9
+ switch (error._tag) {
10
+ case "SchemaError":
11
+ return new BadRequest({ message: "Invalid job page options" });
12
+ case "PgBossPayloadError":
13
+ return new JobsPayloadInvalid({ queue: error.queue });
14
+ case "PgBossError":
15
+ return new JobsUnavailable({ operation: error.operation });
16
+ }
17
+ }));
18
+ }
19
+ // The Layer keeps the queue schemas' decoding services, so the page's operations require only RegisteredQueues.
20
+ export function pgBossQueues(service, ...queues) {
21
+ return Layer.effect(RegisteredQueues, Effect.gen(function* () {
22
+ const runtime = yield* service;
23
+ const inspection = yield* runtime.inspection();
24
+ const decoding = yield* Effect.context();
25
+ const entries = queues;
26
+ function registered(name) {
27
+ const entry = entries.find((candidate) => candidate.name === name);
28
+ return entry === undefined ? Effect.fail(new JobsQueueUnregistered({ queue: name })) : Effect.succeed(jobsQueue(entry));
29
+ }
30
+ function decoded(effect) {
31
+ return Effect.provideContext(effect, decoding);
32
+ }
33
+ return RegisteredQueues.of({
34
+ counts: (queue) => Effect.flatMap(registered(queue), (definition) => jobsFailures(inspection.counts(definition))),
35
+ deadLetteredJobs: (queue, options) => Effect.flatMap(registered(queue), (definition) => decoded(jobsFailures(inspection.deadLetteredJobs(definition, options)))),
36
+ failedJobs: (queue, options) => Effect.flatMap(registered(queue), (definition) => decoded(jobsFailures(inspection.failedJobs(definition, options)))),
37
+ getJob: (queue, id) => Effect.flatMap(registered(queue), (definition) => decoded(jobsFailures(inspection.getJob(definition, id)))),
38
+ health: () => jobsFailures(inspection.health(queues)),
39
+ retry: (queue, id) => Effect.gen(function* () {
40
+ const definition = yield* registered(queue);
41
+ const job = yield* decoded(jobsFailures(inspection.getJob(definition, id)));
42
+ if (Option.isNone(job) || job.value.state !== "failed") {
43
+ return yield* new JobsNotFailed({ id, queue });
44
+ }
45
+ yield* jobsFailures(runtime.retry(definition, id));
46
+ }),
47
+ runScheduleNow: (name) => {
48
+ const schedule = entries.find((candidate) => candidate.name === name && !("schema" in candidate));
49
+ if (schedule === undefined || "schema" in schedule) {
50
+ return Effect.fail(new JobsQueueUnregistered({ queue: name }));
51
+ }
52
+ return runtime.runScheduleNow({ name: schedule.name, scheduleOptions: schedule.scheduleOptions ?? {} }).pipe(Effect.catchTag("PgBossNotFoundError", () => Effect.fail(new JobsQueueUnregistered({ queue: name }))), Effect.catchTag("PgBossError", (error) => Effect.fail(new JobsUnavailable({ operation: error.operation }))));
53
+ },
54
+ });
55
+ }));
56
+ }
57
+ //# sourceMappingURL=pgBossQueues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pgBossQueues.js","sourceRoot":"","sources":["../../../src/server/adapters/pgBossQueues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,KAAK,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAG3D,OAAO,EAAoC,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;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QAAQ,CAAC,eAAe,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAC3G,MAAM,CAAC,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,qBAAqB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EACrG,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,eAAe,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAC3G,CAAC;YACH,CAAC;SACD,CAAC,CAAC;IACJ,CAAC,CAAC,CACF,CAAC;AACH,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { Effect, Option, Schema } from "effect";
2
+ import type { JobPage } from "@shivaedev/jobs/server/health.ts";
3
+ import { JobsDeadLetter } from "#jobs/DeadLetter.ts";
4
+ import { JobsRow } from "#jobs/Row.ts";
5
+ import { JobsPayloadInvalid } from "#jobs/schemas.ts";
6
+ import { RegisteredQueues } from "#server/RegisteredQueues.ts";
7
+ export declare const Health: NoInfer<import("@shivaedev/contract/servedOperation.ts").ServedQuery<"health", Schema.Void, Schema.Void, {
8
+ readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
9
+ readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
10
+ }, never, never, Effect.Effect<import("@shivaedev/jobs/server/health.ts").JobsHealth, import("#jobs/schemas.ts").JobsUnavailable, RegisteredQueues>>>;
11
+ export declare const Counts: NoInfer<import("@shivaedev/contract/servedOperation.ts").ServedQuery<"counts", Schema.Struct<{
12
+ queue: Schema.String;
13
+ }>, Schema.Void, {
14
+ readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
15
+ readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
16
+ }, never, never, Effect.Effect<import("@shivaedev/jobs/server/health.ts").QueueCounts, import("#jobs/schemas.ts").JobsQueueUnregistered | import("#jobs/schemas.ts").JobsUnavailable, RegisteredQueues>>>;
17
+ export declare const Failed: NoInfer<import("@shivaedev/contract/servedOperation.ts").ServedQuery<"failed", Schema.Struct<{
18
+ cursor: Schema.optionalKey<Schema.String>;
19
+ limit: Schema.Number;
20
+ queue: Schema.String;
21
+ }>, Schema.Void, {
22
+ readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
23
+ readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
24
+ }, never, never, Effect.Effect<JobPage<JobsRow>, import("@shivaedev/errors/taxonomy.ts").BadRequest | JobsPayloadInvalid | (import("#jobs/schemas.ts").JobsQueueUnregistered | import("#jobs/schemas.ts").JobsUnavailable), RegisteredQueues>>>;
25
+ export declare const DeadLettered: NoInfer<import("@shivaedev/contract/servedOperation.ts").ServedQuery<"deadLettered", Schema.Struct<{
26
+ cursor: Schema.optionalKey<Schema.String>;
27
+ limit: Schema.Number;
28
+ queue: Schema.String;
29
+ }>, Schema.Void, {
30
+ readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
31
+ readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
32
+ }, never, never, Effect.Effect<JobPage<JobsDeadLetter>, import("@shivaedev/errors/taxonomy.ts").BadRequest | JobsPayloadInvalid | (import("#jobs/schemas.ts").JobsQueueUnregistered | import("#jobs/schemas.ts").JobsUnavailable), RegisteredQueues>>>;
33
+ export declare const Detail: NoInfer<import("@shivaedev/contract/servedOperation.ts").ServedQuery<"job", Schema.Struct<{
34
+ id: Schema.String;
35
+ queue: Schema.String;
36
+ }>, Schema.Void, {
37
+ readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
38
+ readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
39
+ }, never, never, Effect.Effect<Option.Option<JobsRow>, JobsPayloadInvalid | (import("#jobs/schemas.ts").JobsQueueUnregistered | import("#jobs/schemas.ts").JobsUnavailable), RegisteredQueues>>>;
40
+ //# sourceMappingURL=jobsReads.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jobsReads.d.ts","sourceRoot":"","sources":["../../src/server/jobsReads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAc,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,eAAO,MAAM,MAAM;;;qJAKjB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;yMAMjB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;;+OAQjB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;sPAQvB,CAAC;AAEH,eAAO,MAAM,MAAM;;;;;;gMA0BjB,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { DateTime, Effect, Option, Schema } from "effect";
2
+ import { query } from "@shivaedev/contract/operation.ts";
3
+ import { readJobFailure } from "@shivaedev/jobs/server/readJobFailure.ts";
4
+ import { JobsDeadLetter } from "#jobs/DeadLetter.ts";
5
+ import { jobsKeys } from "#jobs/keys.ts";
6
+ import { JobsRow } from "#jobs/Row.ts";
7
+ import { JobsPayloadInvalid, PageFields } from "#jobs/schemas.ts";
8
+ import { RegisteredQueues } from "#server/RegisteredQueues.ts";
9
+ export const Health = query("health", {
10
+ reads: () => [jobsKeys.health.list],
11
+ *run() {
12
+ return yield* (yield* RegisteredQueues).health();
13
+ },
14
+ });
15
+ export const Counts = query("counts", {
16
+ payload: { queue: Schema.String },
17
+ reads: ({ queue }) => [jobsKeys.counts.item(queue)],
18
+ *run({ queue }) {
19
+ return yield* (yield* RegisteredQueues).counts(queue);
20
+ },
21
+ });
22
+ export const Failed = query("failed", {
23
+ payload: { ...PageFields, queue: Schema.String },
24
+ reads: ({ queue }) => [jobsKeys.failed.item(queue)],
25
+ *run({ queue, ...options }) {
26
+ const page = yield* (yield* RegisteredQueues).failedJobs(queue, options);
27
+ const rows = { jobs: page.jobs.map((job) => new JobsRow(job)), next: page.next };
28
+ return rows;
29
+ },
30
+ });
31
+ export const DeadLettered = query("deadLettered", {
32
+ payload: { ...PageFields, queue: Schema.String },
33
+ reads: ({ queue }) => [jobsKeys.deadLettered.item(queue)],
34
+ *run({ queue, ...options }) {
35
+ const page = yield* (yield* RegisteredQueues).deadLetteredJobs(queue, options);
36
+ const copies = { jobs: page.jobs.map((job) => new JobsDeadLetter(job)), next: page.next };
37
+ return copies;
38
+ },
39
+ });
40
+ export const Detail = query("job", {
41
+ payload: { id: Schema.String, queue: Schema.String },
42
+ reads: ({ queue, id }) => [jobsKeys.job(queue).item(id)],
43
+ *run({ id, queue }) {
44
+ const found = yield* (yield* RegisteredQueues).getJob(queue, id);
45
+ if (Option.isNone(found)) {
46
+ return Option.none();
47
+ }
48
+ const job = found.value;
49
+ const output = yield* readJobFailure(queue, job.output).pipe(Effect.mapError(() => new JobsPayloadInvalid({ queue })));
50
+ return Option.some(new JobsRow({
51
+ attempt: job.startedOn === null ? 0 : job.retryCount + 1,
52
+ completedOn: Option.map(Option.fromNullishOr(job.completedOn), DateTime.makeUnsafe),
53
+ createdOn: DateTime.makeUnsafe(job.createdOn),
54
+ data: job.data,
55
+ id: job.id,
56
+ output,
57
+ queue: job.name,
58
+ retryCount: job.retryCount,
59
+ retryLimit: job.retryLimit,
60
+ startedOn: Option.map(Option.fromNullishOr(job.startedOn), DateTime.makeUnsafe),
61
+ state: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C,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC;YACxD,WAAW,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;YACnF,SAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC;YAC7C,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,MAAM;YACN,KAAK,EAAE,GAAG,CAAC,IAAI;YACf,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,UAAU,EAAE,GAAG,CAAC,UAAU;YAC1B,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;YAC/E,KAAK,EAAE,GAAG,CAAC,KAAK;SAChB,CAAC,CACF,CAAC;IACH,CAAC;CACD,CAAC,CAAC"}
@@ -8,22 +8,22 @@ export declare const SessionsPage: import("#page.ts").AdminPage & {
8
8
  };
9
9
  readonly id: "sessions";
10
10
  readonly permissionKey: string;
11
- readonly contract: import("@shivaedev/contract/contract.ts").Contract<"identity.sessions", readonly [Omit<NoInfer<import("@shivaedev/contract/operation.ts").Query<"list", import("effect/Schema").Struct<{
11
+ readonly contract: import("@shivaedev/contract/contract.ts").Contract<"identity.sessions", readonly (Omit<import("@shivaedev/contract/clientContract.ts").ClientQuery<"list", import("effect/Schema").Struct<{
12
12
  readonly cursor: import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
13
13
  readonly id: import("effect/Schema").String;
14
14
  readonly lastActivityAt: import("effect/Schema").DateTimeUtcFromString;
15
15
  }>>;
16
16
  readonly limit: import("effect/Schema").Number;
17
17
  }>, import("effect/Schema").Struct<{
18
- readonly next: import("effect/Schema").OptionFromNullOr<import("effect/Schema").Struct<{
18
+ readonly next: import("effect/Schema").Option<import("effect/Schema").Struct<{
19
19
  readonly id: import("effect/Schema").String;
20
- readonly lastActivityAt: import("effect/Schema").DateTimeUtcFromString;
20
+ readonly lastActivityAt: import("effect/Schema").DateTimeUtc;
21
21
  }>>;
22
22
  readonly sessions: import("effect/Schema").$Array<import("effect/Schema").Struct<{
23
- readonly expiresAt: import("effect/Schema").DateTimeUtcFromDate;
23
+ readonly expiresAt: import("effect/Schema").DateTimeUtc;
24
24
  readonly id: import("effect/Schema").String;
25
- readonly lastActivityAt: import("effect/Schema").DateTimeUtcFromDate;
26
- readonly startedAt: import("effect/Schema").DateTimeUtcFromDate;
25
+ readonly lastActivityAt: import("effect/Schema").DateTimeUtc;
26
+ readonly startedAt: import("effect/Schema").DateTimeUtc;
27
27
  readonly user: import("effect/Schema").Struct<{
28
28
  readonly email: import("effect/Schema").String;
29
29
  readonly id: import("effect/Schema").String;
@@ -31,23 +31,27 @@ export declare const SessionsPage: import("#page.ts").AdminPage & {
31
31
  }>;
32
32
  }>>;
33
33
  }>, {
34
+ readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
35
+ readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
34
36
  readonly AuthUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable;
35
37
  readonly Forbidden: typeof import("@shivaedev/errors/taxonomy.ts").Forbidden;
36
- }, never>>, "readPolicy"> & {
38
+ }>, "readPolicy"> & {
37
39
  readonly readPolicy: import("@shivaedev/contract/readPolicy.ts").QueryReadPolicy<{
38
40
  readonly cursor?: {
39
41
  readonly id: string;
40
42
  readonly lastActivityAt: import("effect/DateTime").Utc;
41
43
  };
42
44
  readonly limit: number;
43
- }, import("@shivaedev/errors/taxonomy.ts").AuthUnavailable | import("@shivaedev/errors/taxonomy.ts").Forbidden, import("@shivaedev/identity/identity.ts").SessionUser>;
44
- }], readonly [NoInfer<import("@shivaedev/contract/operation.ts").Command<"revoke", import("effect/Schema").Struct<{
45
- id: import("effect/Schema").String;
45
+ }, import("@shivaedev/errors/taxonomy.ts").AuthUnavailable | import("@shivaedev/errors/taxonomy.ts").Forbidden | import("@shivaedev/errors/taxonomy.ts").InternalServerError | import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable, unknown>;
46
+ })[], readonly import("@shivaedev/contract/operation.ts").Command<"revoke", import("effect/Schema").Struct<{
47
+ readonly id: import("effect/Schema").String;
46
48
  }>, import("effect/Schema").Void, {
49
+ readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
50
+ readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
47
51
  readonly AuthUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable;
48
52
  readonly Forbidden: typeof import("@shivaedev/errors/taxonomy.ts").Forbidden;
49
53
  readonly NotFound: typeof import("@shivaedev/errors/taxonomy.ts").NotFound;
50
- }>>], import("effect/rpc/Rpc").Rpc<"identity.sessions.$changes", import("effect/Schema").Struct<{
54
+ }>[], import("effect/rpc/Rpc").Rpc<"identity.sessions.$changes", import("effect/Schema").Struct<{
51
55
  queries: import("effect/Schema").$Array<import("effect/Schema").Union<readonly import("effect/Schema").Struct<{
52
56
  query: import("effect/Schema").Literal<"list">;
53
57
  payload: import("effect/Schema").Struct<{
@@ -66,15 +70,15 @@ export declare const SessionsPage: import("#page.ts").AdminPage & {
66
70
  query: import("effect/Schema").Literal<"list">;
67
71
  queryIndex: import("effect/Schema").Number;
68
72
  value: import("effect/Schema").Struct<{
69
- readonly next: import("effect/Schema").OptionFromNullOr<import("effect/Schema").Struct<{
73
+ readonly next: import("effect/Schema").Option<import("effect/Schema").Struct<{
70
74
  readonly id: import("effect/Schema").String;
71
- readonly lastActivityAt: import("effect/Schema").DateTimeUtcFromString;
75
+ readonly lastActivityAt: import("effect/Schema").DateTimeUtc;
72
76
  }>>;
73
77
  readonly sessions: import("effect/Schema").$Array<import("effect/Schema").Struct<{
74
- readonly expiresAt: import("effect/Schema").DateTimeUtcFromDate;
78
+ readonly expiresAt: import("effect/Schema").DateTimeUtc;
75
79
  readonly id: import("effect/Schema").String;
76
- readonly lastActivityAt: import("effect/Schema").DateTimeUtcFromDate;
77
- readonly startedAt: import("effect/Schema").DateTimeUtcFromDate;
80
+ readonly lastActivityAt: import("effect/Schema").DateTimeUtc;
81
+ readonly startedAt: import("effect/Schema").DateTimeUtc;
78
82
  readonly user: import("effect/Schema").Struct<{
79
83
  readonly email: import("effect/Schema").String;
80
84
  readonly id: import("effect/Schema").String;
@@ -82,7 +86,7 @@ export declare const SessionsPage: import("#page.ts").AdminPage & {
82
86
  }>;
83
87
  }>>;
84
88
  }>;
85
- }>)[]]>, import("effect/Schema").Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired, ...import("effect/Schema").Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable)[]>[]]>>, import("effect/Schema").Never, typeof SessionsPermission | (import("effect/Context").Reference<<A, E, R>(effect: import("effect/Effect").Effect<A, E, R>, request: {
89
+ }>)[]]>, import("effect/Schema").Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired, ...import("effect/Schema").Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable | typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError | typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable)[]>[]]>>, import("effect/Schema").Never, typeof SessionsPermission | (import("effect/Context").Reference<<A, E, R>(effect: import("effect/Effect").Effect<A, E, R>, request: {
86
90
  readonly rpc: import("effect/rpc/Rpc").Any;
87
91
  readonly payload: unknown;
88
92
  }) => 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>> & {
@@ -90,31 +94,29 @@ export declare const SessionsPage: import("#page.ts").AdminPage & {
90
94
  "~ClientError": never;
91
95
  error: import("effect/Schema").Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
92
96
  requiredForClient: false;
93
- }), never> | import("effect/rpc/Rpc").Rpc<"identity.sessions.revoke", import("effect/Schema").Struct<{
94
- id: import("effect/Schema").String;
95
- }>, import("effect/Schema").Void, import("effect/Schema").Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").NotFound | typeof import("@shivaedev/errors/taxonomy.ts").Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable)[]>, typeof SessionsPermission, never> | import("effect/rpc/Rpc").Rpc<"identity.sessions.list", import("effect/Schema").Struct<{
97
+ }), never> | import("effect/rpc/Rpc").Rpc<"identity.sessions.list", import("effect/Schema").Struct<{
96
98
  readonly cursor: import("effect/Schema").optionalKey<import("effect/Schema").Struct<{
97
99
  readonly id: import("effect/Schema").String;
98
100
  readonly lastActivityAt: import("effect/Schema").DateTimeUtcFromString;
99
101
  }>>;
100
102
  readonly limit: import("effect/Schema").Number;
101
103
  }>, import("effect/Schema").Struct<{
102
- readonly next: import("effect/Schema").OptionFromNullOr<import("effect/Schema").Struct<{
104
+ readonly next: import("effect/Schema").Option<import("effect/Schema").Struct<{
103
105
  readonly id: import("effect/Schema").String;
104
- readonly lastActivityAt: import("effect/Schema").DateTimeUtcFromString;
106
+ readonly lastActivityAt: import("effect/Schema").DateTimeUtc;
105
107
  }>>;
106
108
  readonly sessions: import("effect/Schema").$Array<import("effect/Schema").Struct<{
107
- readonly expiresAt: import("effect/Schema").DateTimeUtcFromDate;
109
+ readonly expiresAt: import("effect/Schema").DateTimeUtc;
108
110
  readonly id: import("effect/Schema").String;
109
- readonly lastActivityAt: import("effect/Schema").DateTimeUtcFromDate;
110
- readonly startedAt: import("effect/Schema").DateTimeUtcFromDate;
111
+ readonly lastActivityAt: import("effect/Schema").DateTimeUtc;
112
+ readonly startedAt: import("effect/Schema").DateTimeUtc;
111
113
  readonly user: import("effect/Schema").Struct<{
112
114
  readonly email: import("effect/Schema").String;
113
115
  readonly id: import("effect/Schema").String;
114
116
  readonly name: import("effect/Schema").String;
115
117
  }>;
116
118
  }>>;
117
- }>, import("effect/Schema").Union<readonly [import("effect/Schema").Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof SessionsPermission | (import("effect/Context").Reference<<A, E, R>(effect: import("effect/Effect").Effect<A, E, R>, request: {
119
+ }>, import("effect/Schema").Union<readonly [import("effect/Schema").Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable | typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError | typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof SessionsPermission | (import("effect/Context").Reference<<A, E, R>(effect: import("effect/Effect").Effect<A, E, R>, request: {
118
120
  readonly rpc: import("effect/rpc/Rpc").Any;
119
121
  readonly payload: unknown;
120
122
  }) => 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>> & {
@@ -122,6 +124,8 @@ export declare const SessionsPage: import("#page.ts").AdminPage & {
122
124
  "~ClientError": never;
123
125
  error: import("effect/Schema").Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
124
126
  requiredForClient: false;
125
- }), never>, readonly [], undefined>;
127
+ }), never> | import("effect/rpc/Rpc").Rpc<"identity.sessions.revoke", import("effect/Schema").Struct<{
128
+ readonly id: import("effect/Schema").String;
129
+ }>, import("effect/Schema").Void, import("effect/Schema").Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").NotFound | typeof import("@shivaedev/errors/taxonomy.ts").Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable | typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError | typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable)[]>, typeof SessionsPermission, never>, readonly [], undefined>;
126
130
  };
127
131
  //# sourceMappingURL=Page.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../src/sessions/Page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAI/E,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKvB,CAAC"}
1
+ {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../src/sessions/Page.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAG/E,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKvB,CAAC"}
@@ -1,5 +1,5 @@
1
+ import { Sessions } from "@shivaedev/identity/generated/Sessions.ts";
1
2
  import { SessionsPermission } from "@shivaedev/identity/sessionPermissions.ts";
2
- import { Sessions } from "@shivaedev/identity/sessions.ts";
3
3
  import { adminPage } from "#page.ts";
4
4
  export const SessionsPage = adminPage({
5
5
  contract: Sessions,
@@ -1 +1 @@
1
- {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../src/sessions/Page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,QAAQ;IAClB,EAAE,EAAE,UAAU;IACd,UAAU,EAAE,kBAAkB;IAC9B,KAAK,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,EAAE;CACrD,CAAC,CAAC"}
1
+ {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../src/sessions/Page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,MAAM,CAAC,MAAM,YAAY,GAAG,SAAS,CAAC;IACrC,QAAQ,EAAE,QAAQ;IAClB,EAAE,EAAE,UAAU;IACd,UAAU,EAAE,kBAAkB;IAC9B,KAAK,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,EAAE;CACrD,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { UserList } from "@shivaedev/identity/users.ts";
2
+ export type UsersList = typeof UserList.Type & {
3
+ readonly canChangeRoles: boolean;
4
+ };
5
+ //# sourceMappingURL=List.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/users/List.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,MAAM,SAAS,GAAG,OAAO,QAAQ,CAAC,IAAI,GAAG;IAAE,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAA;CAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=List.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.js","sourceRoot":"","sources":["../../src/users/List.ts"],"names":[],"mappings":""}
@@ -0,0 +1,104 @@
1
+ import { UsersPermission } from "#permissions.ts";
2
+ export declare const UsersPage: import("#page.ts").AdminPage & {
3
+ readonly route: {
4
+ readonly path: "/admin/users";
5
+ readonly title: "Users";
6
+ } & {
7
+ readonly permission: import("@shivaedev/access/permission.ts").Permission;
8
+ };
9
+ readonly id: "users";
10
+ readonly permissionKey: string;
11
+ readonly contract: import("@shivaedev/contract/contract.ts").Contract<"admin.users", readonly (Omit<import("@shivaedev/contract/clientContract.ts").ClientQuery<"list", import("effect/Schema").Struct<{
12
+ readonly cursor: import("effect/Schema").optionalKey<import("effect/Schema").String>;
13
+ readonly limit: import("effect/Schema").Number;
14
+ }>, import("effect/Schema").Struct<{
15
+ readonly next: import("effect/Schema").Option<import("effect/Schema").String>;
16
+ readonly users: import("effect/Schema").$Array<import("effect/Schema").Struct<{
17
+ readonly createdAt: import("effect/Schema").DateTimeUtc;
18
+ readonly email: import("effect/Schema").String;
19
+ readonly id: import("effect/Schema").String;
20
+ readonly name: import("effect/Schema").String;
21
+ readonly role: import("effect/Schema").String;
22
+ }>>;
23
+ readonly canChangeRoles: import("effect/Schema").Boolean;
24
+ }>, {
25
+ readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
26
+ readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
27
+ readonly AuthUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable;
28
+ readonly Forbidden: typeof import("@shivaedev/errors/taxonomy.ts").Forbidden;
29
+ }>, "readPolicy"> & {
30
+ readonly readPolicy: import("@shivaedev/contract/readPolicy.ts").QueryReadPolicy<{
31
+ readonly cursor?: string;
32
+ readonly limit: number;
33
+ }, import("@shivaedev/errors/taxonomy.ts").AuthUnavailable | import("@shivaedev/errors/taxonomy.ts").Forbidden | import("@shivaedev/errors/taxonomy.ts").InternalServerError | import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable, unknown>;
34
+ })[], readonly import("@shivaedev/contract/operation.ts").Command<"changeRole", import("effect/Schema").Struct<{
35
+ readonly role: import("effect/Schema").String;
36
+ readonly userId: import("effect/Schema").String;
37
+ }>, import("effect/Schema").Void, {
38
+ readonly InternalServerError: typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError;
39
+ readonly ServiceUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable;
40
+ readonly AuthUnavailable: typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable;
41
+ readonly Forbidden: typeof import("@shivaedev/errors/taxonomy.ts").Forbidden;
42
+ readonly LastRoleAssigner: typeof import("@shivaedev/identity/roles.ts").LastRoleAssigner;
43
+ readonly NotFound: typeof import("@shivaedev/errors/taxonomy.ts").NotFound;
44
+ }>[], import("effect/rpc/Rpc").Rpc<"admin.users.$changes", import("effect/Schema").Struct<{
45
+ queries: import("effect/Schema").$Array<import("effect/Schema").Union<readonly import("effect/Schema").Struct<{
46
+ query: import("effect/Schema").Literal<"list">;
47
+ payload: import("effect/Schema").Struct<{
48
+ readonly cursor: import("effect/Schema").optionalKey<import("effect/Schema").String>;
49
+ readonly limit: import("effect/Schema").Number;
50
+ }>;
51
+ }>[]>>;
52
+ }>, import("effect/rpc/RpcSchema").Stream<import("effect/Schema").Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, ...(import("effect/Schema").Struct<{
53
+ readonly _tag: import("effect/Schema").Literal<"Unchanged">;
54
+ readonly queryIndex: import("effect/Schema").Number;
55
+ }> | import("effect/Schema").Struct<{
56
+ _tag: import("effect/Schema").Literal<"Result">;
57
+ query: import("effect/Schema").Literal<"list">;
58
+ queryIndex: import("effect/Schema").Number;
59
+ value: import("effect/Schema").Struct<{
60
+ readonly next: import("effect/Schema").Option<import("effect/Schema").String>;
61
+ readonly users: import("effect/Schema").$Array<import("effect/Schema").Struct<{
62
+ readonly createdAt: import("effect/Schema").DateTimeUtc;
63
+ readonly email: import("effect/Schema").String;
64
+ readonly id: import("effect/Schema").String;
65
+ readonly name: import("effect/Schema").String;
66
+ readonly role: import("effect/Schema").String;
67
+ }>>;
68
+ readonly canChangeRoles: import("effect/Schema").Boolean;
69
+ }>;
70
+ }>)[]]>, import("effect/Schema").Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired, ...import("effect/Schema").Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable | typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError | typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable)[]>[]]>>, import("effect/Schema").Never, typeof UsersPermission | (import("effect/Context").Reference<<A, E, R>(effect: import("effect/Effect").Effect<A, E, R>, request: {
71
+ readonly rpc: import("effect/rpc/Rpc").Any;
72
+ readonly payload: unknown;
73
+ }) => 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>> & {
74
+ "~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
75
+ "~ClientError": never;
76
+ error: import("effect/Schema").Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
77
+ requiredForClient: false;
78
+ }), never> | import("effect/rpc/Rpc").Rpc<"admin.users.changeRole", import("effect/Schema").Struct<{
79
+ readonly role: import("effect/Schema").String;
80
+ readonly userId: import("effect/Schema").String;
81
+ }>, import("effect/Schema").Void, import("effect/Schema").Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").NotFound | typeof import("@shivaedev/errors/taxonomy.ts").Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable | typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError | typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable | typeof import("@shivaedev/identity/roles.ts").LastRoleAssigner)[]>, typeof UsersPermission, never> | import("effect/rpc/Rpc").Rpc<"admin.users.list", import("effect/Schema").Struct<{
82
+ readonly cursor: import("effect/Schema").optionalKey<import("effect/Schema").String>;
83
+ readonly limit: import("effect/Schema").Number;
84
+ }>, import("effect/Schema").Struct<{
85
+ readonly next: import("effect/Schema").Option<import("effect/Schema").String>;
86
+ readonly users: import("effect/Schema").$Array<import("effect/Schema").Struct<{
87
+ readonly createdAt: import("effect/Schema").DateTimeUtc;
88
+ readonly email: import("effect/Schema").String;
89
+ readonly id: import("effect/Schema").String;
90
+ readonly name: import("effect/Schema").String;
91
+ readonly role: import("effect/Schema").String;
92
+ }>>;
93
+ readonly canChangeRoles: import("effect/Schema").Boolean;
94
+ }>, import("effect/Schema").Union<readonly [import("effect/Schema").Union<readonly (typeof import("@shivaedev/errors/taxonomy.ts").Forbidden | typeof import("@shivaedev/errors/taxonomy.ts").AuthUnavailable | typeof import("@shivaedev/errors/taxonomy.ts").InternalServerError | typeof import("@shivaedev/errors/taxonomy.ts").ServiceUnavailable)[]>, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied]>, typeof UsersPermission | (import("effect/Context").Reference<<A, E, R>(effect: import("effect/Effect").Effect<A, E, R>, request: {
95
+ readonly rpc: import("effect/rpc/Rpc").Any;
96
+ readonly payload: unknown;
97
+ }) => 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>> & {
98
+ "~effect/rpc/RpcMiddleware": "~effect/rpc/RpcMiddleware";
99
+ "~ClientError": never;
100
+ error: import("effect/Schema").Union<readonly [typeof import("@shivaedev/contract/readPolicyErrors.ts").MissingReadPolicy, typeof import("@shivaedev/contract/readPolicyErrors.ts").QueryReadDenied, typeof import("@shivaedev/contract/WebSocketRequired.ts").WebSocketRequired]>;
101
+ requiredForClient: false;
102
+ }), never>, readonly [], undefined>;
103
+ };
104
+ //# sourceMappingURL=Page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Page.d.ts","sourceRoot":"","sources":["../../src/users/Page.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKpB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { Users } from "#generated/Users.ts";
2
+ import { adminPage } from "#page.ts";
3
+ import { UsersPermission } from "#permissions.ts";
4
+ export const UsersPage = adminPage({
5
+ contract: Users,
6
+ id: "users",
7
+ permission: UsersPermission,
8
+ route: { path: "/admin/users", title: "Users" },
9
+ });
10
+ //# sourceMappingURL=Page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Page.js","sourceRoot":"","sources":["../../src/users/Page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC;IAClC,QAAQ,EAAE,KAAK;IACf,EAAE,EAAE,OAAO;IACX,UAAU,EAAE,eAAe;IAC3B,KAAK,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE;CAC/C,CAAC,CAAC"}