@shivaedev/platform 0.32.0 → 0.33.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 +22 -0
- package/README.md +20 -42
- package/dist/rpc/identity.d.ts +1 -1
- package/dist/rpc/identity.d.ts.map +1 -1
- package/dist/rpc/middleware.d.ts +1 -1
- package/dist/rpc/middleware.d.ts.map +1 -1
- package/dist/rpc/middleware.js +1 -1
- package/dist/rpc/middleware.js.map +1 -1
- package/dist/rpc/requireAdmin.d.ts +1 -1
- package/dist/rpc/requireAdmin.d.ts.map +1 -1
- package/dist/rpc/requireAdmin.js +1 -1
- package/dist/rpc/requireAdmin.js.map +1 -1
- package/dist/rpc/userRoles.d.ts +36 -0
- package/dist/rpc/userRoles.d.ts.map +1 -0
- package/dist/rpc/userRoles.js +18 -0
- package/dist/rpc/userRoles.js.map +1 -0
- package/dist/server/appHostHttp.d.ts.map +1 -1
- package/dist/server/appHostHttp.js +1 -0
- package/dist/server/appHostHttp.js.map +1 -1
- package/dist/server/better-auth/revokeUnadmitted.d.ts +1 -1
- package/dist/server/better-auth/revokeUnadmitted.d.ts.map +1 -1
- package/dist/server/better-auth/signInGate.d.ts +1 -1
- package/dist/server/better-auth/signInGate.d.ts.map +1 -1
- package/dist/server/better-auth/signInGate.js +1 -1
- package/dist/server/better-auth/signInGate.js.map +1 -1
- package/dist/server/better-auth/testing.d.ts +2 -45
- package/dist/server/better-auth/testing.d.ts.map +1 -1
- package/dist/server/better-auth/testing.js +0 -12
- package/dist/server/better-auth/testing.js.map +1 -1
- package/dist/server/better-auth/userProfiles.d.ts +1 -1
- package/dist/server/better-auth/userProfiles.d.ts.map +1 -1
- package/dist/server/better-auth/userProfiles.js +1 -1
- package/dist/server/better-auth/userProfiles.js.map +1 -1
- package/dist/server/better-auth/users.d.ts +24 -0
- package/dist/server/better-auth/users.d.ts.map +1 -0
- package/dist/server/better-auth/users.js +67 -0
- package/dist/server/better-auth/users.js.map +1 -0
- package/dist/server/hostOptions.d.ts +2 -1
- package/dist/server/hostOptions.d.ts.map +1 -1
- package/dist/server/rpc-server/adapters/betterAuthSessions.d.ts +1 -1
- package/dist/server/rpc-server/adapters/betterAuthSessions.d.ts.map +1 -1
- package/dist/server/rpc-server/adapters/betterAuthSessions.js +1 -1
- package/dist/server/rpc-server/adapters/betterAuthSessions.js.map +1 -1
- package/dist/server/rpc-server/revalidateStream.d.ts +1 -1
- package/dist/server/rpc-server/revalidateStream.d.ts.map +1 -1
- package/dist/server/rpc-server/revalidateStream.js +1 -1
- package/dist/server/rpc-server/revalidateStream.js.map +1 -1
- package/dist/server/rpc-server/roles.js +1 -1
- package/dist/server/rpc-server/roles.js.map +1 -1
- package/dist/server/rpc-server/session.d.ts +1 -1
- package/dist/server/rpc-server/session.d.ts.map +1 -1
- package/dist/server/rpc-server/session.js +1 -1
- package/dist/server/rpc-server/session.js.map +1 -1
- package/package.json +6 -6
- package/src/rpc/identity.ts +1 -1
- package/src/rpc/middleware.ts +1 -1
- package/src/rpc/requireAdmin.ts +1 -1
- package/src/rpc/userRoles.ts +20 -0
- package/src/server/appHostHttp.ts +1 -0
- package/src/server/better-auth/revokeUnadmitted.ts +1 -1
- package/src/server/better-auth/signInGate.ts +1 -1
- package/src/server/better-auth/testing.ts +2 -14
- package/src/server/better-auth/userProfiles.ts +1 -1
- package/src/server/better-auth/users.ts +69 -0
- package/src/server/hostOptions.ts +2 -1
- package/src/server/rpc-server/adapters/betterAuthSessions.ts +1 -1
- package/src/server/rpc-server/revalidateStream.ts +1 -1
- package/src/server/rpc-server/roles.ts +1 -1
- package/src/server/rpc-server/session.ts +1 -1
- package/dist/errors/rejectedField.d.ts +0 -7
- package/dist/errors/rejectedField.d.ts.map +0 -1
- package/dist/errors/rejectedField.js +0 -7
- package/dist/errors/rejectedField.js.map +0 -1
- package/dist/errors/taxonomy.d.ts +0 -55
- package/dist/errors/taxonomy.d.ts.map +0 -1
- package/dist/errors/taxonomy.js +0 -24
- package/dist/errors/taxonomy.js.map +0 -1
- package/src/errors/rejectedField.ts +0 -10
- package/src/errors/taxonomy.ts +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.33.0 - 2026-10-26
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Add the admin Users page, native RPC handlers and React view for paginated app users and owner-managed roles. Register `UsersPage` with `usersHandlers` beside Jobs and mount `UsersView` using its bound query and role action.
|
|
8
|
+
- Add Platform auth user listing and transactional role changes on the existing Better Auth PostgreSQL schema, with typed owner-only and last-owner failures, change invalidation and actor/timestamp logs.
|
|
9
|
+
- Mount Users in the starter and generated apps. Existing apps receive the wiring with `pnpm dlx @shivaedev/create-app@latest update` after these packages are released; review template conflicts and install dependencies. Newly bootstrapped administrators also hold the owner role.
|
|
10
|
+
- Provide the shared expected failure schemas and `rejectedField` in `@shivaedev/effect-contract/errors/`, so browser-safe contract consumers can use them without depending on Platform. Tags, schema fields and RPC encoding remain the same.
|
|
11
|
+
- Run Fleet and Work Board together with `work-fleet up <board-dir>`, with exclusive board ownership, process and code-change restarts, combined logs, `up --status` and clean shutdown through `down`.
|
|
12
|
+
- Work Board coordinates command-line process ownership with Fleet supervision and refuses a hand-started server while `up` holds its directory.
|
|
13
|
+
- The HTTP host accepts Effect’s native `gracefulShutdownTimeout` so supervised processes can finish active requests before restarting.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Require Better Auth 1.7.11, whose plugin types support `testUtils()` with `exactOptionalPropertyTypes` without a wrapper.
|
|
18
|
+
|
|
19
|
+
### Breaking
|
|
20
|
+
|
|
21
|
+
- Remove `authTestUtils` from `@shivaedev/platform/server/better-auth/testing.ts`. Import `testUtils` from `better-auth/plugins` and call it with the same options instead. Keep importing `signedInUser` and `storedProviderAccounts` from Platform.
|
|
22
|
+
- Move all imports from `@shivaedev/platform/errors/taxonomy.ts` to `@shivaedev/effect-contract/errors/taxonomy.ts`, and from `@shivaedev/platform/errors/rejectedField.ts` to `@shivaedev/effect-contract/errors/rejectedField.ts`. The old modules are removed. Add a direct `@shivaedev/effect-contract` dependency if the consuming package does not already declare one. Admin, GitHub, Work Board and Work Fleet public failure types now refer to these shared classes.
|
|
23
|
+
- Generated apps use the new imports. The create-app updater applies the starter changes through its usual three-way patch; it does not rewrite imports in app-owned files. Replace both old import paths above in those files when upgrading existing apps.
|
|
24
|
+
|
|
3
25
|
## 0.32.0 - 2026-10-25
|
|
4
26
|
|
|
5
27
|
### Added
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @shivaedev/platform
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Request identity and server boundaries for Effect applications. A feature can say who called it and why it refused, while the application supplies its session policy once. The package also connects Effect services to Promise callers, Node subscriptions and optional Better Auth, Prisma and tRPC integrations.
|
|
4
4
|
|
|
5
5
|
## Why you want this
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@ const Handlers = Account.toLayer({
|
|
|
19
19
|
});
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
`Account` is a native RPC group with authenticated middleware. Its handler reads the identity for this invocation and decides whether that user may read the account.
|
|
22
|
+
`Account` is a native RPC group with authenticated middleware. Its handler reads the identity for this invocation and decides whether that user may read the account. Effect Contract supplies the common error classes, and Platform supplies request services; feature code keeps the resource-ownership check. Concurrent requests receive their own identities, and a provider outage reaches the caller as `AuthUnavailable` instead of pretending the caller signed out.
|
|
23
23
|
|
|
24
24
|
## Using it
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ const Handlers = Account.toLayer({
|
|
|
27
27
|
|
|
28
28
|
There are three parts to a native RPC boundary:
|
|
29
29
|
|
|
30
|
-
1. **The shared contract** names Schema errors and middleware tags. The browser imports these declarations too, so `errors/` and `rpc/` contain browser-safe data and services.
|
|
30
|
+
1. **The shared contract** names Schema errors and middleware tags. The browser imports these declarations too, so `effect-contract/errors/` and Platform's `rpc/` contain browser-safe data and services.
|
|
31
31
|
2. **The server composition** implements the tags with Layers from `rpc-server/`. A session provider resolves a session; an Origin policy decides whether its request may reach that provider; tracing supplies a request id and diagnostic context.
|
|
32
32
|
3. **The feature handler** reads `Identity`, `OptionalIdentity` or `RequestId` and runs application code. Authentication supplies a user id. Authorization still decides whether that user may perform this operation.
|
|
33
33
|
|
|
@@ -63,7 +63,7 @@ const Server = appHost({
|
|
|
63
63
|
NodeRuntime.runMain(Layer.launch(Server));
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
`app.ts` exports the application's contracts, native Layers, numbered `Migrator.Loader` and `SessionPolicy`. The host needs the optional peers `@effect/platform-node` and `@effect/sql-pg` at the workspace's Effect version; install both for this entry point. The `
|
|
66
|
+
`app.ts` exports the application's contracts, native Layers, numbered `Migrator.Loader` and `SessionPolicy`. The host needs the optional peers `@effect/platform-node` and `@effect/sql-pg` at the workspace's Effect version; install both for this entry point. The `node-http/`, `rpc/`, `rpc-server/` and `runtime/` entries still work without them.
|
|
67
67
|
|
|
68
68
|
Omit `services` when the app has no service Layer of its own. The host uses `Layer.empty`; handler requirements remain explicit, and a migrated host still provides its database services to handlers. Annotated options that declare service outputs, errors or requirements must supply a `services` Layer.
|
|
69
69
|
|
|
@@ -269,7 +269,7 @@ Declare the RPC group in a shared module:
|
|
|
269
269
|
```ts
|
|
270
270
|
import { Effect, Schema } from "effect";
|
|
271
271
|
import { Rpc, RpcGroup } from "effect/rpc";
|
|
272
|
-
import { Forbidden } from "@shivaedev/
|
|
272
|
+
import { Forbidden } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
273
273
|
import { Identity } from "@shivaedev/platform/rpc/identity.ts";
|
|
274
274
|
import { Authenticated } from "@shivaedev/platform/rpc/middleware.ts";
|
|
275
275
|
|
|
@@ -357,7 +357,7 @@ Pass Better Auth's account lookup as the second argument to `betterAuthSessions`
|
|
|
357
357
|
```ts
|
|
358
358
|
import { SessionUserWithProviderAccounts } from "@shivaedev/platform/rpc/identity.ts";
|
|
359
359
|
import { AuthenticatedUserWithProviderAccounts } from "@shivaedev/platform/rpc/middleware.ts";
|
|
360
|
-
import { AuthUnavailable, Unauthorized } from "@shivaedev/
|
|
360
|
+
import { AuthUnavailable, Unauthorized } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
361
361
|
import { authenticatedUserWithProviderAccountsLayer } from "@shivaedev/platform/server/rpc-server/session.ts";
|
|
362
362
|
|
|
363
363
|
const sessions = {
|
|
@@ -509,34 +509,7 @@ The same module exports `loopbackOnly(handler)` for local page routes and `sameO
|
|
|
509
509
|
|
|
510
510
|
`trustedProxyRanges(trustedProxy?)` returns the equivalent IP addresses and CIDR ranges used by that matcher. Mapped IPv6 addresses and CIDRs become IPv4 entries: `::ffff:127.0.0.0/104` becomes `127.0.0.0/8`, including hexadecimal mapped forms. Broader IPv6 ranges retain both native IPv6 and mapped IPv4 coverage. Missing or malformed configuration returns an empty list. Pass these ranges to a forwarded-header integration after checking the transport with `trustedProxyPeer`.
|
|
511
511
|
|
|
512
|
-
Declare expected refusals
|
|
513
|
-
|
|
514
|
-
```ts
|
|
515
|
-
import { Schema } from "effect";
|
|
516
|
-
import { Rpc } from "effect/rpc";
|
|
517
|
-
import { BadRequest, Conflict } from "@shivaedev/platform/errors/taxonomy.ts";
|
|
518
|
-
|
|
519
|
-
export const Rename = Rpc.make("Rename", {
|
|
520
|
-
error: Schema.Union([BadRequest, Conflict]),
|
|
521
|
-
payload: { name: Schema.String },
|
|
522
|
-
success: Schema.String,
|
|
523
|
-
});
|
|
524
|
-
```
|
|
525
|
-
|
|
526
|
-
A handler fails with `new Conflict({ field: "name", message: "Name is taken" })`. Native RPC JSON decodes the rejection back to the error instance with its field. Taxonomy errors can be declared on an RPC with no authentication middleware. `rejectedField` reads either that instance or tagged JSON:
|
|
527
|
-
|
|
528
|
-
```ts
|
|
529
|
-
import { rejectedField } from "@shivaedev/platform/errors/rejectedField.ts";
|
|
530
|
-
import { Conflict } from "@shivaedev/platform/errors/taxonomy.ts";
|
|
531
|
-
|
|
532
|
-
const field = rejectedField(
|
|
533
|
-
new Conflict({ field: "name", message: "Name is taken" }),
|
|
534
|
-
);
|
|
535
|
-
```
|
|
536
|
-
|
|
537
|
-
`field` is `Option.some({ field: "name", message: "Name is taken" })`. Any value with string `_tag`, `field` and `message` qualifies, including an application's own tagged error. An untagged object, a missing field or a non-string field yields `Option.none()`.
|
|
538
|
-
|
|
539
|
-
For tRPC, use these classes with the rejection schema and formatter from [effect-trpc](https://github.com/ShivaeDev/platform/tree/main/packages/effect-trpc). The composed HTTP boundary carries rejection data and maps statuses, including `TooManyRequests` as 429 and `AuthUnavailable` as 503.
|
|
512
|
+
Declare expected refusals with the shared tagged error schemas from [effect-contract](https://github.com/ShivaeDev/platform/tree/main/packages/effect-contract#expected-failures). They work with native RPC without authentication middleware. For tRPC, use the rejection schema and formatter from [effect-trpc](https://github.com/ShivaeDev/platform/tree/main/packages/effect-trpc); that HTTP boundary owns status mapping.
|
|
540
513
|
|
|
541
514
|
### Handling unexpected failures
|
|
542
515
|
|
|
@@ -544,7 +517,7 @@ At the handler edge, `rpcBoundary(schema, options)` keeps declared rejections an
|
|
|
544
517
|
|
|
545
518
|
```ts
|
|
546
519
|
import { Schema } from "effect";
|
|
547
|
-
import { Conflict, InternalServerError } from "@shivaedev/
|
|
520
|
+
import { Conflict, InternalServerError } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
548
521
|
import { rpcBoundary } from "@shivaedev/platform/server/rpc-server/boundary.ts";
|
|
549
522
|
|
|
550
523
|
const Rejection = Schema.Union([Conflict, InternalServerError]);
|
|
@@ -779,17 +752,18 @@ Without `signIn`, the mount installs no sign-in policy hooks and `revokeUnadmitt
|
|
|
779
752
|
|
|
780
753
|
### Signed-in story preconditions
|
|
781
754
|
|
|
782
|
-
Use `
|
|
755
|
+
Use `testUtils()` from `better-auth/plugins` in a test-only Better Auth instance with the host's database, secret and cookie policy. Keep the plugin out of production auth options.
|
|
783
756
|
|
|
784
757
|
Use `authTestDatabase(pool)` from `@shivaedev/platform/server/better-auth/testDatabase.ts` when a story needs observations or faults in the default Better Auth PostgreSQL schema. It returns Effect readouts `users` (IDs and emails) and `sessions` (IDs, user IDs and emails), plus the test-only faults `expireSessions` and `omitImageColumn`. It never returns tokens, password hashes or provider credentials. These fixtures assume the default table and column mappings and operate on the supplied pool; use only an isolated test database. Application stories keep their auth SQL in this provider-owned boundary.
|
|
785
758
|
|
|
786
759
|
```ts
|
|
787
760
|
import { betterAuth } from "better-auth";
|
|
788
|
-
import {
|
|
761
|
+
import { testUtils } from "better-auth/plugins";
|
|
762
|
+
import { signedInUser } from "@shivaedev/platform/server/better-auth/testing.ts";
|
|
789
763
|
|
|
790
764
|
const testAuth = betterAuth({
|
|
791
765
|
...options,
|
|
792
|
-
plugins: [...(options.plugins ?? []),
|
|
766
|
+
plugins: [...(options.plugins ?? []), testUtils()],
|
|
793
767
|
});
|
|
794
768
|
const { user, headers, cookies } = await signedInUser(testAuth, {
|
|
795
769
|
email: "member@example.test",
|
|
@@ -905,8 +879,6 @@ Import the module that defines the name; there is no package-root entry. Paths b
|
|
|
905
879
|
|
|
906
880
|
| Module | Names and purpose |
|
|
907
881
|
| --- | --- |
|
|
908
|
-
| `errors/taxonomy.ts` | `NotFound`, `Unauthorized`, `Forbidden`, `BadRequest`, `Conflict`, `PreconditionFailed`, `TooManyRequests`, `AuthUnavailable`, `InternalServerError`, `ServiceUnavailable`: Schema tagged error classes with a `message`; `BadRequest` and `Conflict` also accept an optional `field`. |
|
|
909
|
-
| `errors/rejectedField.ts` | `rejectedField(unknown)`: the field and message of a field rejection. |
|
|
910
882
|
| `rpc/identity.ts` | `RequestId`, `Identity`, `OptionalIdentity`, `SessionUser`, `SessionUserWithProviderAccounts`: request-local services. |
|
|
911
883
|
| `rpc/middleware.ts` | `RequestTracing`, `Authenticated`, `AuthenticatedUser`, `AuthenticatedUserWithProviderAccounts`, `AuthenticatedAdmin`, `AuthenticatedOwner`, `MaybeAuthenticated`: native RPC middleware declarations. |
|
|
912
884
|
| `rpc/hasRole.ts` | `hasRole(user, role)`: whether a user's comma-separated role list includes a role; browser-safe. |
|
|
@@ -932,17 +904,23 @@ Import the module that defines the name; there is no package-root entry. Paths b
|
|
|
932
904
|
| `server/better-auth/signInGate.ts` | `SignInPolicy`: the `accounts`, `rule` and `recheckInterval` of a sign-in policy. |
|
|
933
905
|
| `server/better-auth/revokeUnadmitted.ts` | `RevokedSessions`: the `{ users, sessions }` counts of a revocation. |
|
|
934
906
|
| `server/better-auth/testDatabase.ts` | `authTestDatabase(pool)`: test-only identity/session readouts and faults for the default PostgreSQL auth schema. |
|
|
935
|
-
| `server/better-auth/testing.ts` | `
|
|
907
|
+
| `server/better-auth/testing.ts` | `signedInUser(auth, fields)`, `storedProviderAccounts(auth, userId)`: test-only minted user sessions and credential storage observations. |
|
|
936
908
|
| `server/better-auth/adapter.ts` | `effectPrismaAdapter(Database, runtime, options?)`: a Better Auth adapter over Effect Prisma; `modelName` maps model names. |
|
|
937
909
|
| `server/testing/makePlatformIt.ts` | `makePlatformIt(Database)({ adapter, createCaller, layer, extend? })`. |
|
|
938
910
|
|
|
911
|
+
### Manage app users
|
|
912
|
+
|
|
913
|
+
`server/better-auth/users.ts` provides `listUsers({ limit, cursor? })` and `changeUserRole({ userId, role, grant })` using the existing Effect SQL client and Better Auth's default PostgreSQL user table with its admin plugin. Browser-safe schemas, Platform roles (`user`, `admin`, `owner`) and the typed `LastOwner` failure live in `rpc/userRoles.ts`. The admin package supplies the protected contract and React view.
|
|
914
|
+
|
|
915
|
+
Role writes require an owner `SessionUser`, serialize role changes in a transaction, and reject removal of the final owner. They preserve unrelated roles and publish the `admin.users` invalidation after commit. Successful changes emit structured Effect logs with actor, target, role, action and UTC timestamp. Platform has no durable audit-history store. The host must use the same database as authentication; custom Better Auth table names and columns need their own integration.
|
|
916
|
+
|
|
939
917
|
### Install, setup and limits
|
|
940
918
|
|
|
941
919
|
```sh
|
|
942
920
|
pnpm add @shivaedev/platform effect@4.0.5
|
|
943
921
|
```
|
|
944
922
|
|
|
945
|
-
Effect is the only required peer. The peer-free implementation lives in the shared `
|
|
923
|
+
Effect is the only required peer. The peer-free implementation lives in the shared `rpc/` folder and the `server/node-http/`, `server/rpc-server/` and `server/runtime/` folders; a module's import path is its path under `src/`. The core RPC declarations, server middleware, runtime and Node HTTP modules can be imported without the optional peers, including the Promise-based `betterAuthSessions` function. The runtime uses Node's `AsyncLocalStorage`; browser consumers import the shared `rpc/` modules and the error schemas from `@shivaedev/effect-contract/errors/taxonomy.ts`.
|
|
946
924
|
|
|
947
925
|
Install the optional peers for the selected integration:
|
|
948
926
|
|
package/dist/rpc/identity.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Context, type Effect, type Option } from "effect";
|
|
2
|
-
import type { AuthUnavailable, Unauthorized } from "
|
|
2
|
+
import type { AuthUnavailable, Unauthorized } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
3
3
|
declare const RequestId_base: Context.ServiceClass<RequestId, "@shivaedev/platform/rpc/RequestId", string>;
|
|
4
4
|
export declare class RequestId extends RequestId_base {
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/rpc/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/rpc/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;;AACnG,qBAAa,SAAU,SAAQ,cAAyE;CAAG;AAC3G,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACpB;;AACD,qBAAa,QAAS,SAAQ,aAA8E;CAAG;;AAC/G,qBAAa,gBAAiB,SAAQ,qBAA6G;CAAG;AACtJ,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC5B;AACD,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACtD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC1C;;AACD,qBAAa,WAAY,SAAQ,gBAAuF;CAAG;AAC3H,MAAM,WAAW,oCAAqC,SAAQ,gBAAgB;IAC7E,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,oBAAoB,EAAE,EAAE,eAAe,GAAG,YAAY,CAAC,CAAC;CAC1G;;AACD,qBAAa,+BAAgC,SAAQ,oCAEpD;CAAG"}
|
package/dist/rpc/middleware.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { RpcMiddleware } from "effect/rpc";
|
|
3
|
-
import { AuthUnavailable, Forbidden, Unauthorized } from "
|
|
3
|
+
import { AuthUnavailable, Forbidden, Unauthorized } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
4
4
|
import type { Identity, OptionalIdentity, RequestId, SessionUser, SessionUserWithProviderAccounts } from "./identity.ts";
|
|
5
5
|
declare const RequestTracing_base: RpcMiddleware.ServiceClass<RequestTracing, "@shivaedev/platform/rpc/RequestTracing", RequestId, Schema.Never, never, never, false>;
|
|
6
6
|
export declare class RequestTracing extends RequestTracing_base {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/rpc/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/rpc/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AACzG,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;;AACzH,qBAAa,cAAe,SAAQ,mBAKS;CAAG;;AAChD,qBAAa,aAAc,SAAQ,kBAOjC;CAAG;;AACL,qBAAa,kBAAmB,SAAQ,uBAK8E;CAAG;;AACzH,qBAAa,iBAAkB,SAAQ,sBAOrC;CAAG;;AACL,qBAAa,qCAAsC,SAAQ,0CAKzD;CAAG;;AACL,qBAAa,kBAAmB,SAAQ,uBAOtC;CAAG;;AACL,qBAAa,kBAAmB,SAAQ,uBAOtC;CAAG"}
|
package/dist/rpc/middleware.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import { RpcMiddleware } from "effect/rpc";
|
|
3
|
-
import { AuthUnavailable, Forbidden, Unauthorized } from "
|
|
3
|
+
import { AuthUnavailable, Forbidden, Unauthorized } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
4
4
|
export class RequestTracing extends RpcMiddleware.Service()("@shivaedev/platform/rpc/RequestTracing") {
|
|
5
5
|
}
|
|
6
6
|
export class Authenticated extends RpcMiddleware.Service()("@shivaedev/platform/rpc/Authenticated", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/rpc/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../src/rpc/middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAC;AAEzG,MAAM,OAAO,cAAe,SAAQ,aAAa,CAAC,OAAO,EAKtD,CAAC,wCAAwC,CAAC;CAAG;AAChD,MAAM,OAAO,aAAc,SAAQ,aAAa,CAAC,OAAO,EAKrD,CAAC,uCAAuC,EAAE;IAC5C,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;CAC/D,CAAC;CAAG;AACL,MAAM,OAAO,kBAAmB,SAAQ,aAAa,CAAC,OAAO,EAK1D,CAAC,4CAA4C,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;CAAG;AACzH,MAAM,OAAO,iBAAkB,SAAQ,aAAa,CAAC,OAAO,EAKzD,CAAC,2CAA2C,EAAE;IAChD,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;CAC/D,CAAC;CAAG;AACL,MAAM,OAAO,qCAAsC,SAAQ,aAAa,CAAC,OAAO,EAG7E,CAAC,+DAA+D,EAAE;IACpE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;CAC/D,CAAC;CAAG;AACL,MAAM,OAAO,kBAAmB,SAAQ,aAAa,CAAC,OAAO,EAK1D,CAAC,4CAA4C,EAAE;IACjD,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;CAC/D,CAAC;CAAG;AACL,MAAM,OAAO,kBAAmB,SAAQ,aAAa,CAAC,OAAO,EAK1D,CAAC,4CAA4C,EAAE;IACjD,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC;CAC/D,CAAC;CAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import { Forbidden } from "
|
|
2
|
+
import { Forbidden } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
3
3
|
import { SessionUser, type SessionUserValue } from "./identity.ts";
|
|
4
4
|
export declare const requireAdmin: Effect.Effect<SessionUserValue, Forbidden, SessionUser>;
|
|
5
5
|
//# sourceMappingURL=requireAdmin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireAdmin.d.ts","sourceRoot":"","sources":["../../src/rpc/requireAdmin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"requireAdmin.d.ts","sourceRoot":"","sources":["../../src/rpc/requireAdmin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEnE,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,SAAS,EAAE,WAAW,CAM/E,CAAC"}
|
package/dist/rpc/requireAdmin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import { Forbidden } from "
|
|
2
|
+
import { Forbidden } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
3
3
|
import { hasRole } from "./hasRole.js";
|
|
4
4
|
import { SessionUser } from "./identity.js";
|
|
5
5
|
export const requireAdmin = Effect.gen(function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requireAdmin.js","sourceRoot":"","sources":["../../src/rpc/requireAdmin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"requireAdmin.js","sourceRoot":"","sources":["../../src/rpc/requireAdmin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAC;AAEnE,MAAM,CAAC,MAAM,YAAY,GAA4D,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IACxG,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,WAAW,CAAC;IAChC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;QAC7B,OAAO,KAAK,CAAC,CAAC,IAAI,SAAS,CAAC,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const UserRole: Schema.Literals<readonly ["user", "admin", "owner"]>;
|
|
3
|
+
export type UserRole = typeof UserRole.Type;
|
|
4
|
+
export declare const AppUser: Schema.Struct<{
|
|
5
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
6
|
+
readonly email: Schema.String;
|
|
7
|
+
readonly id: Schema.String;
|
|
8
|
+
readonly name: Schema.String;
|
|
9
|
+
readonly roles: Schema.$Array<Schema.String>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const UserListInput: Schema.Struct<{
|
|
12
|
+
readonly cursor: Schema.optionalKey<Schema.String>;
|
|
13
|
+
readonly limit: Schema.Number;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const UserList: Schema.Struct<{
|
|
16
|
+
readonly next: Schema.OptionFromNullOr<Schema.String>;
|
|
17
|
+
readonly users: Schema.$Array<Schema.Struct<{
|
|
18
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
19
|
+
readonly email: Schema.String;
|
|
20
|
+
readonly id: Schema.String;
|
|
21
|
+
readonly name: Schema.String;
|
|
22
|
+
readonly roles: Schema.$Array<Schema.String>;
|
|
23
|
+
}>>;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const ChangeRoleInput: Schema.Struct<{
|
|
26
|
+
readonly grant: Schema.Boolean;
|
|
27
|
+
readonly role: Schema.Literals<readonly ["user", "admin", "owner"]>;
|
|
28
|
+
readonly userId: Schema.String;
|
|
29
|
+
}>;
|
|
30
|
+
declare const LastOwner_base: Schema.Class<LastOwner, Schema.TaggedStruct<"LastOwner", {
|
|
31
|
+
readonly userId: Schema.String;
|
|
32
|
+
}>, import("effect/Cause").YieldableError>;
|
|
33
|
+
export declare class LastOwner extends LastOwner_base {
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=userRoles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userRoles.d.ts","sourceRoot":"","sources":["../../src/rpc/userRoles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,QAAQ,sDAA8C,CAAC;AACpE,MAAM,MAAM,QAAQ,GAAG,OAAO,QAAQ,CAAC,IAAI,CAAC;AAE5C,eAAO,MAAM,OAAO;;;;;;EAMlB,CAAC;AAEH,eAAO,MAAM,aAAa;;;EAGxB,CAAC;AACH,eAAO,MAAM,QAAQ;;;;;;;;;EAAgG,CAAC;AACtH,eAAO,MAAM,eAAe;;;;EAAkF,CAAC;;;;AAC/G,qBAAa,SAAU,SAAQ,cAAuE;CAAG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export const UserRole = Schema.Literals(["user", "admin", "owner"]);
|
|
3
|
+
export const AppUser = Schema.Struct({
|
|
4
|
+
createdAt: Schema.DateTimeUtcFromString,
|
|
5
|
+
email: Schema.String,
|
|
6
|
+
id: Schema.String,
|
|
7
|
+
name: Schema.String,
|
|
8
|
+
roles: Schema.Array(Schema.String),
|
|
9
|
+
});
|
|
10
|
+
export const UserListInput = Schema.Struct({
|
|
11
|
+
cursor: Schema.optionalKey(Schema.String),
|
|
12
|
+
limit: Schema.Number.check(Schema.isInt(), Schema.isBetween({ maximum: 100, minimum: 1 })),
|
|
13
|
+
});
|
|
14
|
+
export const UserList = Schema.Struct({ next: Schema.OptionFromNullOr(Schema.String), users: Schema.Array(AppUser) });
|
|
15
|
+
export const ChangeRoleInput = Schema.Struct({ grant: Schema.Boolean, role: UserRole, userId: Schema.String });
|
|
16
|
+
export class LastOwner extends Schema.TaggedError()("LastOwner", { userId: Schema.String }) {
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=userRoles.js.map
|
|
@@ -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,EACpB,WAAW,EACX,QAAQ,SAAS,YAAY,EAE7B,OAAO,EAAE,WAAW,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,oBAAoB,EAAE,SAAS,EAAE,aAAa,EAAE,oBAAoB,CAAC,GAC1H,UAAU,CAAC,QAAQ,CAAC,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAA;CAAE,EAC9E,QAAQ,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,CAAC,EACvD,cAAc,EAAE,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;ucAIjC;AAED,wBAAgB,YAAY,CAC3B,KAAK,SAAS,GAAG,CAAC,GAAG,EACrB,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,QAAQ,SAAS,YAAY,EAC7B,iBAAiB,EACjB,wBAAwB,EAExB,WAAW,EAAE,MAAM,CAAC,MAAM,CACzB,kBAAkB,CAAC,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,oBAAoB,EAAE,SAAS,EAAE,aAAa,EAAE,oBAAoB,EAAE,QAAQ,CAAC,EACnI,iBAAiB,EACjB,wBAAwB,CACxB,EACD,QAAQ,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,WAAW,CAAC,CAAC,EACvD,cAAc,EAAE,OAAO,UAAU;;;;;;;;;;;;;;;;;;;;;;;;ucAGjC"}
|
|
@@ -45,6 +45,7 @@ export function appHostHttp(options, changesService) {
|
|
|
45
45
|
const port = options.config?.port ?? (yield* Config.Int("PORT").pipe(Config.withDefault(3000)));
|
|
46
46
|
const host = options.config?.host ?? (yield* Config.String("HOST").pipe(Config.withDefault("127.0.0.1")));
|
|
47
47
|
return NodeHttpServer.layer(createServer, {
|
|
48
|
+
gracefulShutdownTimeout: options.config?.gracefulShutdownTimeout,
|
|
48
49
|
host,
|
|
49
50
|
port,
|
|
50
51
|
...(options.config?.disablePreemptiveShutdown === undefined
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appHostHttp.js","sourceRoot":"","sources":["../../src/server/appHostHttp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,UAAU,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACnI,OAAO,EAAY,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAqB,MAAM,+BAA+B,CAAC;AAC/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,WAAW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AE,GAAG,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;AAC3G,CAAC;AAED,MAAM,UAAU,YAAY,CAa3B,WAIC,EACD,QAAuD,EACvD,cAAiC;IAEjC,OAAO,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;AACpI,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Config, Effect } from "effect";
|
|
2
|
-
import type { AuthUnavailable } from "
|
|
2
|
+
import type { AuthUnavailable } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
3
3
|
import { type PolicyStorage, type SignInGate } from "#server/better-auth/signInGate.ts";
|
|
4
4
|
export interface RevokedSessions {
|
|
5
5
|
readonly sessions: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revokeUnadmitted.d.ts","sourceRoot":"","sources":["../../../src/server/better-auth/revokeUnadmitted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"revokeUnadmitted.d.ts","sourceRoot":"","sources":["../../../src/server/better-auth/revokeUnadmitted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAe,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAErG,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,GAAG,MAAM,CAAC,WAAW,GAAG,eAAe,CAAC,CAAC;AAI3G,eAAO,MAAM,gBAAgB,GAAgC,CAAC,sCAE9C,OAAO,CAAC,aAAa,CAAC,oFAyBpC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Config, Duration, Effect } from "effect";
|
|
2
|
-
import { AuthUnavailable } from "
|
|
2
|
+
import { AuthUnavailable } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
3
3
|
import type { ProviderAccountValue } from "#rpc/identity.ts";
|
|
4
4
|
export interface SignInPolicy<E = never, R = never> {
|
|
5
5
|
readonly accounts?: Config.Config<readonly ProviderAccountValue[]> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signInGate.d.ts","sourceRoot":"","sources":["../../../src/server/better-auth/signInGate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAQ,MAAM,QAAQ,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"signInGate.d.ts","sourceRoot":"","sources":["../../../src/server/better-auth/signInGate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAQ,MAAM,QAAQ,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAG7D,MAAM,WAAW,YAAY,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK;IACjD,QAAQ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AED,MAAM,WAAW,UAAU,CAAC,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,SAAS,oBAAoB,EAAE,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;IACjH,QAAQ,CAAC,UAAU,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,WAAW,GAAG,eAAe,CAAC,CAAC;CAClI;AAID,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,4CASpD;AAMD,eAAO,MAAM,UAAU,GAAgC,CAAC,EAAE,CAAC,uEA2BzD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cache, Duration, Effect, Exit } from "effect";
|
|
2
|
-
import { AuthUnavailable } from "
|
|
2
|
+
import { AuthUnavailable } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
3
3
|
import { redact } from "#server/rpc-server/redact.ts";
|
|
4
4
|
const RULE_CACHE_CAPACITY = 10_000;
|
|
5
5
|
export function fromStorage(read) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signInGate.js","sourceRoot":"","sources":["../../../src/server/better-auth/signInGate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAe,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"signInGate.js","sourceRoot":"","sources":["../../../src/server/better-auth/signInGate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAe,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAA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E,UAAU,EAAE,CAAC;AACrF,CAAC,CAAC,CAAC"}
|
|
@@ -1,49 +1,6 @@
|
|
|
1
1
|
import type { AuthContext } from "better-auth";
|
|
2
|
-
import { testUtils } from "better-auth/plugins";
|
|
3
|
-
|
|
4
|
-
id: "test-utils";
|
|
5
|
-
version: string;
|
|
6
|
-
options: import("better-auth/plugins").TestUtilsOptions;
|
|
7
|
-
init(context: Parameters<(ctx: AuthContext) => {
|
|
8
|
-
context: {
|
|
9
|
-
test: import("better-auth/plugins").TestHelpers;
|
|
10
|
-
};
|
|
11
|
-
options: {
|
|
12
|
-
databaseHooks: {
|
|
13
|
-
verification: {
|
|
14
|
-
create: {
|
|
15
|
-
after(verification: {
|
|
16
|
-
identifier: string;
|
|
17
|
-
value: string;
|
|
18
|
-
} | null): Promise<void>;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
} | undefined;
|
|
23
|
-
}>[0]): {
|
|
24
|
-
context: {
|
|
25
|
-
test: import("better-auth/plugins").TestHelpers;
|
|
26
|
-
};
|
|
27
|
-
options?: never;
|
|
28
|
-
} | {
|
|
29
|
-
context: {
|
|
30
|
-
test: import("better-auth/plugins").TestHelpers;
|
|
31
|
-
};
|
|
32
|
-
options: {
|
|
33
|
-
databaseHooks: {
|
|
34
|
-
verification: {
|
|
35
|
-
create: {
|
|
36
|
-
after(verification: {
|
|
37
|
-
identifier: string;
|
|
38
|
-
value: string;
|
|
39
|
-
} | null): Promise<void>;
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
type TestContext = ReturnType<ReturnType<typeof authTestUtils>["init"]>["context"];
|
|
2
|
+
import type { testUtils } from "better-auth/plugins";
|
|
3
|
+
type TestContext = ReturnType<ReturnType<typeof testUtils>["init"]>["context"];
|
|
47
4
|
type AccountContext = Pick<AuthContext, "internalAdapter">;
|
|
48
5
|
export declare function signedInUser(auth: {
|
|
49
6
|
readonly $context: Promise<TestContext & AccountContext>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/server/better-auth/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/server/better-auth/testing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,KAAK,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AAC/E,KAAK,cAAc,GAAG,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;AAE3D,wBAAsB,YAAY,CACjC,IAAI,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,WAAW,GAAG,cAAc,CAAC,CAAA;CAAE,EAClE,EACC,gBAAqB,EACrB,GAAG,MAAM,EACT,EAAE,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;IACrD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS;QAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnG,sDAQD;AAED,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;CAAE,EAAE,MAAM,EAAE,MAAM;;;;;;;KAWhH"}
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
import { testUtils } from "better-auth/plugins";
|
|
2
|
-
export function authTestUtils(options) {
|
|
3
|
-
const plugin = testUtils(options);
|
|
4
|
-
return {
|
|
5
|
-
...plugin,
|
|
6
|
-
init(context) {
|
|
7
|
-
const result = plugin.init(context);
|
|
8
|
-
// Remove this wrapper once Better Auth's testUtils omits undefined options.
|
|
9
|
-
return result.options === undefined ? { context: result.context } : { context: result.context, options: result.options };
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
1
|
export async function signedInUser(auth, { providerAccounts = [], ...fields }) {
|
|
14
2
|
const { test, internalAdapter } = await auth.$context;
|
|
15
3
|
const user = await test.saveUser(test.createUser(fields));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../src/server/better-auth/testing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../src/server/better-auth/testing.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,KAAK,UAAU,YAAY,CACjC,IAAkE,EAClE,EACC,gBAAgB,GAAG,EAAE,EACrB,GAAG,MAAM,EAGT;IAED,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC;IACtD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1D,KAAK,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,gBAAgB,EAAE,CAAC;QAC1D,MAAM,eAAe,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IACjF,CAAC;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,IAAoD,EAAE,MAAc;IAChH,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC;IAChD,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5D,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;QACjG,SAAS;QACT,cAAc,EAAE,OAAO,CAAC,WAAW,CAAC;QACpC,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC;QAC5B,WAAW,EAAE,OAAO,CAAC,QAAQ,CAAC;QAC9B,eAAe,EAAE,OAAO,CAAC,YAAY,CAAC;QACtC,UAAU;KACV,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Auth } from "better-auth";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
-
import { AuthUnavailable } from "
|
|
3
|
+
import { AuthUnavailable } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
4
4
|
export interface UserProfile {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly image: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userProfiles.d.ts","sourceRoot":"","sources":["../../../src/server/better-auth/userProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"userProfiles.d.ts","sourceRoot":"","sources":["../../../src/server/better-auth/userProfiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAGhF,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,YAAY;uBACG,OAAO,CAAC;QAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAA;KAAE,CAAC;+FAwB/G,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import { AuthUnavailable } from "
|
|
2
|
+
import { AuthUnavailable } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
3
3
|
import { redact } from "#server/rpc-server/redact.ts";
|
|
4
4
|
export const userProfiles = Effect.fn("Platform.userProfiles")(function* (auth, userIds) {
|
|
5
5
|
const ids = [...new Set(userIds)];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userProfiles.js","sourceRoot":"","sources":["../../../src/server/better-auth/userProfiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"userProfiles.js","sourceRoot":"","sources":["../../../src/server/better-auth/userProfiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAQtD,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,QAAQ,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
|
+
import { SqlClient } from "effect/sql";
|
|
3
|
+
import { AuthUnavailable, Forbidden, NotFound } from "@shivaedev/effect-contract/errors/taxonomy.ts";
|
|
4
|
+
import { SessionUser } from "#rpc/identity.ts";
|
|
5
|
+
import { LastOwner } from "#rpc/userRoles.ts";
|
|
6
|
+
export declare const listUsers: (input: {
|
|
7
|
+
readonly cursor?: string;
|
|
8
|
+
readonly limit: number;
|
|
9
|
+
}) => Effect.Effect<{
|
|
10
|
+
next: Option.Option<string>;
|
|
11
|
+
users: {
|
|
12
|
+
email: string;
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
createdAt: DateTime.Utc;
|
|
16
|
+
roles: string[];
|
|
17
|
+
}[];
|
|
18
|
+
}, AuthUnavailable, SqlClient.SqlClient>;
|
|
19
|
+
export declare const changeUserRole: (input: {
|
|
20
|
+
readonly grant: boolean;
|
|
21
|
+
readonly role: "admin" | "owner" | "user";
|
|
22
|
+
readonly userId: string;
|
|
23
|
+
}) => Effect.Effect<undefined, AuthUnavailable | Forbidden | LastOwner | NotFound, import("effect/reactivity/Reactivity").Reactivity | SessionUser | SqlClient.SqlClient>;
|
|
24
|
+
//# sourceMappingURL=users.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/server/better-auth/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAGrG,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAwB,SAAS,EAAsB,MAAM,mBAAmB,CAAC;AAaxF,eAAO,MAAM,SAAS;;;;;;;;;;;;wCAepB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;yKAgCzB,CAAC"}
|