@krak-stack/auth 0.1.71 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +4 -3
  2. package/dist/access.d.ts +5 -7
  3. package/dist/access.js +11 -7
  4. package/dist/admin/api.group.d.ts +53 -53
  5. package/dist/admin/api.group.js +15 -15
  6. package/dist/admin/schema.d.ts +18 -18
  7. package/dist/admin/schema.js +3 -3
  8. package/dist/api.d.ts +1995 -533
  9. package/dist/api.js +7 -7
  10. package/dist/auth/api.group.d.ts +793 -0
  11. package/dist/auth/api.group.js +241 -0
  12. package/dist/auth/schema.d.ts +808 -0
  13. package/dist/auth/schema.js +628 -0
  14. package/dist/components/admin-organization-form.d.ts +1 -1
  15. package/dist/components/admin-organization-form.js +17 -18
  16. package/dist/components/admin-organizations.d.ts +4 -5
  17. package/dist/components/admin-organizations.js +83 -73
  18. package/dist/components/admin-users.d.ts +5 -6
  19. package/dist/components/admin-users.js +160 -181
  20. package/dist/components/api-key-edit-form.d.ts +4 -3
  21. package/dist/components/api-key-edit-form.js +33 -27
  22. package/dist/components/api-key-permissions.d.ts +1 -1
  23. package/dist/components/api-key-rate-limit.d.ts +1 -1
  24. package/dist/components/api-key-referrers.d.ts +3 -2
  25. package/dist/components/api-key-referrers.js +2 -3
  26. package/dist/components/api-key.d.ts +0 -9
  27. package/dist/components/api-key.js +0 -39
  28. package/dist/components/auth-atoms.d.ts +178 -0
  29. package/dist/components/auth-atoms.js +46 -0
  30. package/dist/components/auth-client-api.d.ts +1371 -556
  31. package/dist/components/auth-client-api.js +22 -14
  32. package/dist/components/auth-forms.d.ts +1 -3
  33. package/dist/components/auth-forms.js +173 -195
  34. package/dist/components/auth-provider.d.ts +16 -20
  35. package/dist/components/auth-provider.js +56 -30
  36. package/dist/components/has-permission.js +1 -1
  37. package/dist/components/index.d.ts +19 -20
  38. package/dist/components/index.js +13 -13
  39. package/dist/components/member-required.d.ts +1 -3
  40. package/dist/components/member-required.js +102 -78
  41. package/dist/components/organization-switcher.d.ts +4 -6
  42. package/dist/components/organization-switcher.js +539 -390
  43. package/dist/components/project-access-matrix.d.ts +1 -1
  44. package/dist/components/project-access-matrix.js +9 -13
  45. package/dist/components/user-button.d.ts +5 -3
  46. package/dist/components/user-button.js +291 -336
  47. package/dist/components/utils.d.ts +3 -1
  48. package/dist/components/utils.js +4 -11
  49. package/dist/extra/api.group.d.ts +22 -22
  50. package/dist/extra/api.group.js +9 -9
  51. package/dist/extra/schema.d.ts +1 -2
  52. package/dist/extra/schema.js +2 -3
  53. package/dist/index.d.ts +11 -12
  54. package/dist/index.js +11 -12
  55. package/dist/query.d.ts +2 -2
  56. package/dist/query.js +5 -5
  57. package/dist/roles.d.ts +5 -4
  58. package/dist/roles.js +11 -7
  59. package/dist/schema.d.ts +1 -1
  60. package/dist/schema.js +26 -19
  61. package/dist/server/actor.d.ts +20 -22
  62. package/dist/server/actor.js +14 -17
  63. package/dist/server/api.group.d.ts +29 -29
  64. package/dist/server/api.group.js +14 -14
  65. package/dist/server/index.d.ts +14 -14
  66. package/dist/server/index.js +8 -8
  67. package/dist/server/middleware.d.ts +1 -1
  68. package/dist/server/middleware.js +1 -1
  69. package/dist/server/schema.js +1 -1
  70. package/dist/service.d.ts +1997 -583
  71. package/dist/service.js +23 -16
  72. package/package.json +10 -9
  73. package/dist/better-auth/api.group.d.ts +0 -62
  74. package/dist/better-auth/api.group.js +0 -39
  75. package/dist/better-auth/schema.d.ts +0 -72
  76. package/dist/better-auth/schema.js +0 -110
  77. package/dist/components/auth-client.d.ts +0 -50
  78. package/dist/components/auth-client.js +0 -46
package/README.md CHANGED
@@ -17,6 +17,7 @@ Choose a narrow package subpath for the runtime boundary:
17
17
  | `@krak-stack/auth/access` | Typed project access definitions |
18
18
  | `@krak-stack/auth/access/matrix` | Generated permission matrix |
19
19
  | `@krak-stack/auth/api` | Combined Effect HttpApi contracts |
20
+ | `@krak-stack/auth/auth` | Browser authentication HttpApi group and schemas |
20
21
  | `@krak-stack/auth/schema` | Shared schemas |
21
22
  | `@krak-stack/auth/admin` | Administrative API contract |
22
23
  | `@krak-stack/auth/extra` | Browser-facing extra API contract |
@@ -48,7 +49,7 @@ Use `AuthMiddleware.layer()` to provide request headers and configuration in an
48
49
 
49
50
  ## React Components
50
51
 
51
- The current emitted component bundle expects Krakstack/shadcn UI aliases and additional consumer runtime packages. Validate the packed package in the target application before adopting the UI surface. The server-only entry points have a smaller integration boundary.
52
+ The component bundle uses the peer dependencies declared in `package.json` and Krakstack/shadcn UI primitives from `@krak-stack/registry`. The server-only entry points have a smaller integration boundary.
52
53
 
53
54
  When components are configured, register their Tailwind source:
54
55
 
@@ -57,12 +58,12 @@ When components are configured, register their Tailwind source:
57
58
  @import "@krak-stack/auth/tailwind.css";
58
59
  ```
59
60
 
60
- `createAuthUiClient` sends credentials by default so hosted KrakStack Auth UI can resolve sessions when embedded in consumer apps on a different origin. Pass `{ credentials: "omit" }` only for intentionally anonymous or custom clients.
61
+ The React components use the exported Effect query atoms and the owned authentication HTTP group. Browser requests include credentials so hosted components can resolve sessions across configured origins.
61
62
 
62
63
  `UserButton` accepts `menuActions` for app-owned menu items such as dashboard or workspace links:
63
64
 
64
65
  ```tsx
65
- import { UserButton } from "@krak-stack/auth";
66
+ import { UserButton } from "@krak-stack/auth/components";
66
67
  import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
67
68
 
68
69
  <UserButton
package/dist/access.d.ts CHANGED
@@ -28,9 +28,7 @@ export type CurrentActor = {
28
28
  readonly permissions: ReadonlySet<string>;
29
29
  };
30
30
  export declare const CurrentActor: Context.Service<CurrentActor, CurrentActor>;
31
- declare const Forbidden_base: Schema.Class<Forbidden, Schema.Struct<{
32
- readonly _tag: Schema.tag<"Forbidden">;
33
- }>, import("effect/Cause").YieldableError>;
31
+ declare const Forbidden_base: Schema.Class<Forbidden, Schema.TaggedStruct<"Forbidden", {}>, import("effect/Cause").YieldableError>;
34
32
  export declare class Forbidden extends Forbidden_base {
35
33
  }
36
34
  export type Policy<E = never, R = never> = Effect.Effect<void, Forbidden | E, CurrentActor | R>;
@@ -51,13 +49,13 @@ export type ProjectAccessDefinition<Project extends string = string, Action exte
51
49
  };
52
50
  readonly qualify: (action: Action) => ProjectPermission<Project, Action>;
53
51
  readonly permission: (action: Action) => Policy;
54
- readonly permissionsForRoles: (roles: unknown) => ReadonlySet<ProjectPermission<Project, Action>>;
52
+ readonly permissionsForRoles: (roles: typeof Schema.Unknown.Type) => ReadonlySet<ProjectPermission<Project, Action>>;
55
53
  readonly permissionsForGrant: (grant: ApiKeyPermissionGrant | null | undefined) => ReadonlySet<ProjectPermission<Project, Action>>;
56
54
  readonly permissionsForUserKey: (input: {
57
55
  readonly grant: ApiKeyPermissionGrant | null | undefined;
58
- readonly roles: unknown;
56
+ readonly roles: typeof Schema.Unknown.Type;
59
57
  }) => ReadonlySet<ProjectPermission<Project, Action>>;
60
- readonly decodeGrant: (input: unknown) => Effect.Effect<ReadonlySet<ProjectPermission<Project, Action>>, Schema.SchemaError>;
58
+ readonly decodeGrant: (input: typeof Schema.Unknown.Type) => Effect.Effect<ReadonlySet<ProjectPermission<Project, Action>>, Schema.SchemaError>;
61
59
  readonly encodeGrant: (actions: ReadonlyArray<Action>) => ApiKeyPermissionGrant;
62
60
  readonly apiKeyPermissions: {
63
61
  readonly user: ApiKeyPermissionGrant;
@@ -66,7 +64,7 @@ export type ProjectAccessDefinition<Project extends string = string, Action exte
66
64
  readonly actorForUser: (input: {
67
65
  readonly userId: string;
68
66
  readonly organizationId: string | null;
69
- readonly roles: unknown;
67
+ readonly roles: typeof Schema.Unknown.Type;
70
68
  }) => CurrentActor;
71
69
  readonly actorForApiKey: (input: {
72
70
  readonly apiKeyId: string;
package/dist/access.js CHANGED
@@ -1,14 +1,12 @@
1
1
  import { Context, Effect, Schema } from "effect";
2
- import { parseRoleList } from "./roles";
2
+ import { parseRoleList } from "./roles.js";
3
3
  export const ApiKeyPermissionGrant = Schema.Record(Schema.String, Schema.Array(Schema.String)).annotate({
4
4
  identifier: "ApiKeyPermissionGrant",
5
5
  title: "API key permission grant",
6
- description: "Better Auth resource and action permissions assigned to a key.",
6
+ description: "Resource and action permissions assigned to an API key.",
7
7
  });
8
8
  export const CurrentActor = Context.Service("@krak-stack/auth/CurrentActor");
9
- export class Forbidden extends Schema.ErrorClass("Forbidden")({
10
- _tag: Schema.tag("Forbidden"),
11
- }, {
9
+ export class Forbidden extends Schema.TaggedError()("Forbidden", {}, {
12
10
  identifier: "Forbidden",
13
11
  title: "Forbidden",
14
12
  description: "The authenticated actor lacks a required permission.",
@@ -33,7 +31,13 @@ const roleList = (input) => Array.isArray(input)
33
31
  : parseRoleList(input);
34
32
  export const defineProjectAccess = (config) => {
35
33
  const allowedActions = new Set(config.permissions);
36
- const qualify = (action) => `${config.project}:${action}`;
34
+ const isAction = (action) => config.permissions.some((allowed) => allowed === action);
35
+ const QualifiedPermissionSchema = Schema.TemplateLiteral([
36
+ Schema.Literal(config.project),
37
+ Schema.Literal(":"),
38
+ Schema.Literals(config.permissions),
39
+ ]);
40
+ const qualify = (action) => Schema.decodeUnknownSync(QualifiedPermissionSchema)(`${config.project}:${action}`);
37
41
  const permissionsForActions = (actions) => new Set(Array.from(actions, (action) => qualify(action)));
38
42
  const permissionsForRoles = (input) => {
39
43
  const actions = new Set();
@@ -46,7 +50,7 @@ export const defineProjectAccess = (config) => {
46
50
  return permissionsForActions(actions);
47
51
  };
48
52
  const permissionsForGrant = (grant) => {
49
- const actions = (grant?.[config.project] ?? []).filter((action) => allowedActions.has(action));
53
+ const actions = (grant?.[config.project] ?? []).filter(isAction);
50
54
  return permissionsForActions(actions);
51
55
  };
52
56
  const encodeGrant = (actions) => ({
@@ -1,13 +1,13 @@
1
1
  import { HttpApiEndpoint, HttpApiError, HttpApiGroup } from "effect/unstable/httpapi";
2
2
  import { Schema } from "effect";
3
- export * from "./schema";
4
- export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEndpoint.HttpApiEndpoint<"createDomain", "POST", "/admin/domains", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
3
+ export * from "./schema.js";
4
+ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEndpoint.HttpApiEndpoint<"createDomain", "POST", "/admin/domains", never, never, Schema.toCodecJson<Schema.Struct<{
5
5
  readonly hostname: Schema.NonEmptyString;
6
6
  readonly rootHostname: Schema.NonEmptyString;
7
7
  readonly projectId: Schema.optional<Schema.NullOr<Schema.String>>;
8
8
  readonly organizationId: Schema.optional<Schema.NullOr<Schema.String>>;
9
9
  readonly managed: Schema.Boolean;
10
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
10
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
11
11
  readonly id: Schema.String;
12
12
  readonly hostname: Schema.String;
13
13
  readonly rootHostname: Schema.String;
@@ -22,12 +22,12 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
22
22
  readonly active: Schema.Boolean;
23
23
  readonly createdAt: Schema.Date;
24
24
  readonly updatedAt: Schema.Date;
25
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"createOrganization", "POST", "/admin/organizations", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
25
+ }>>, Schema.toCodecJson<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"createOrganization", "POST", "/admin/organizations", never, never, Schema.toCodecJson<Schema.Struct<{
26
26
  readonly name: Schema.NonEmptyString;
27
27
  readonly slug: Schema.NonEmptyString;
28
28
  readonly logo: Schema.optional<Schema.String>;
29
29
  readonly parentId: Schema.optional<Schema.String>;
30
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
30
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
31
31
  readonly id: Schema.String;
32
32
  readonly name: Schema.String;
33
33
  readonly slug: Schema.String;
@@ -47,9 +47,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
47
47
  readonly logo: Schema.NullOr<Schema.String>;
48
48
  }>>>;
49
49
  readonly createdAt: Schema.Date;
50
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"dashboardStats", "GET", "/admin/dashboard-stats", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
50
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"dashboardStats", "GET", "/admin/dashboard-stats", never, Schema.toCodecStringTree<Schema.Struct<{
51
51
  readonly days: Schema.optional<Schema.Union<readonly [Schema.Literal<"7">, Schema.Literal<"14">, Schema.Literal<"30">, Schema.Literal<"90">]>>;
52
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
52
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
53
53
  readonly totalUsers: Schema.Number;
54
54
  readonly totalOrganizations: Schema.Number;
55
55
  readonly totalProjects: Schema.Number;
@@ -71,9 +71,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
71
71
  readonly users: Schema.Number;
72
72
  readonly organizations: Schema.Number;
73
73
  }>>;
74
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteApiKey", "DELETE", "/admin/api-keys/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
74
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteApiKey", "DELETE", "/admin/api-keys/:id", Schema.toCodecStringTree<Schema.Struct<{
75
75
  readonly id: Schema.String;
76
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
76
+ }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
77
77
  readonly id: Schema.String;
78
78
  readonly configId: Schema.String;
79
79
  readonly name: Schema.NullOr<Schema.String>;
@@ -91,9 +91,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
91
91
  readonly referrers: Schema.$Array<Schema.String>;
92
92
  readonly createdAt: Schema.Date;
93
93
  readonly updatedAt: Schema.Date;
94
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteDomain", "DELETE", "/admin/domains/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
94
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteDomain", "DELETE", "/admin/domains/:id", Schema.toCodecStringTree<Schema.Struct<{
95
95
  readonly id: Schema.NonEmptyString;
96
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
96
+ }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
97
97
  readonly id: Schema.String;
98
98
  readonly hostname: Schema.String;
99
99
  readonly rootHostname: Schema.String;
@@ -108,9 +108,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
108
108
  readonly active: Schema.Boolean;
109
109
  readonly createdAt: Schema.Date;
110
110
  readonly updatedAt: Schema.Date;
111
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteOrganization", "DELETE", "/admin/organizations/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
111
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"deleteOrganization", "DELETE", "/admin/organizations/:id", Schema.toCodecStringTree<Schema.Struct<{
112
112
  readonly id: Schema.String;
113
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
113
+ }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
114
114
  readonly id: Schema.String;
115
115
  readonly name: Schema.String;
116
116
  readonly slug: Schema.String;
@@ -130,9 +130,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
130
130
  readonly logo: Schema.NullOr<Schema.String>;
131
131
  }>>>;
132
132
  readonly createdAt: Schema.Date;
133
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"disableApiKeyRateLimit", "POST", "/admin/api-keys/:id/disable-rate-limit", HttpApiEndpoint.StringTree<Schema.Struct<{
133
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"disableApiKeyRateLimit", "POST", "/admin/api-keys/:id/disable-rate-limit", Schema.toCodecStringTree<Schema.Struct<{
134
134
  readonly id: Schema.String;
135
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
135
+ }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
136
136
  readonly id: Schema.String;
137
137
  readonly configId: Schema.String;
138
138
  readonly name: Schema.NullOr<Schema.String>;
@@ -150,9 +150,9 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
150
150
  readonly referrers: Schema.$Array<Schema.String>;
151
151
  readonly createdAt: Schema.Date;
152
152
  readonly updatedAt: Schema.Date;
153
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"enableApiKeyRateLimit", "POST", "/admin/api-keys/:id/enable-rate-limit", HttpApiEndpoint.StringTree<Schema.Struct<{
153
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"enableApiKeyRateLimit", "POST", "/admin/api-keys/:id/enable-rate-limit", Schema.toCodecStringTree<Schema.Struct<{
154
154
  readonly id: Schema.String;
155
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
155
+ }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
156
156
  readonly id: Schema.String;
157
157
  readonly configId: Schema.String;
158
158
  readonly name: Schema.NullOr<Schema.String>;
@@ -170,15 +170,15 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
170
170
  readonly referrers: Schema.$Array<Schema.String>;
171
171
  readonly createdAt: Schema.Date;
172
172
  readonly updatedAt: Schema.Date;
173
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomainRecords", "GET", "/admin/domains/:id/records", HttpApiEndpoint.StringTree<Schema.Struct<{
173
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getDomainRecords", "GET", "/admin/domains/:id/records", Schema.toCodecStringTree<Schema.Struct<{
174
174
  readonly id: Schema.NonEmptyString;
175
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.$Array<Schema.Struct<{
175
+ }>>, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
176
176
  readonly required: Schema.Boolean;
177
177
  readonly status: Schema.String;
178
178
  readonly type: Schema.String;
179
179
  readonly name: Schema.String;
180
180
  readonly value: Schema.String;
181
- }>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listApiKeys", "GET", "/admin/api-keys", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.$Array<Schema.Struct<{
181
+ }>>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listApiKeys", "GET", "/admin/api-keys", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
182
182
  readonly id: Schema.String;
183
183
  readonly configId: Schema.String;
184
184
  readonly name: Schema.NullOr<Schema.String>;
@@ -196,7 +196,7 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
196
196
  readonly referrers: Schema.$Array<Schema.String>;
197
197
  readonly createdAt: Schema.Date;
198
198
  readonly updatedAt: Schema.Date;
199
- }>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listDomains", "GET", "/admin/domains", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.$Array<Schema.Struct<{
199
+ }>>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listDomains", "GET", "/admin/domains", never, never, never, never, Schema.toCodecJson<Schema.$Array<Schema.Struct<{
200
200
  readonly id: Schema.String;
201
201
  readonly hostname: Schema.String;
202
202
  readonly rootHostname: Schema.String;
@@ -211,7 +211,7 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
211
211
  readonly active: Schema.Boolean;
212
212
  readonly createdAt: Schema.Date;
213
213
  readonly updatedAt: Schema.Date;
214
- }>>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizations", "GET", "/admin/organizations", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
214
+ }>>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizations", "GET", "/admin/organizations", never, Schema.toCodecStringTree<Schema.Struct<{
215
215
  readonly page: Schema.Int;
216
216
  readonly pageSize: Schema.Int;
217
217
  readonly globalFilter: Schema.optional<Schema.String>;
@@ -220,27 +220,27 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
220
220
  readonly direction: Schema.Union<readonly [Schema.Literal<"asc">, Schema.Literal<"desc">]>;
221
221
  }>>, Schema.String, never, never>, never, never>>;
222
222
  readonly projectId: Schema.optional<Schema.String>;
223
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
224
- readonly data: Schema.$Array<Schema.Schema<{
225
- readonly id: string;
226
- readonly name: string;
227
- readonly slug: string;
228
- readonly logo?: string | null | undefined;
229
- readonly metadata?: string | null | undefined;
230
- readonly userId?: string | null | undefined;
231
- readonly parentId?: string | null | undefined;
232
- readonly memberCount?: number | undefined;
233
- readonly memberPreviews?: readonly Schema.Struct.ReadonlySide<{
223
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
224
+ readonly data: Schema.$Array<Schema.Struct<{
225
+ readonly id: Schema.String;
226
+ readonly name: Schema.String;
227
+ readonly slug: Schema.String;
228
+ readonly logo: Schema.optional<Schema.NullOr<Schema.String>>;
229
+ readonly metadata: Schema.optional<Schema.NullOr<Schema.String>>;
230
+ readonly userId: Schema.optional<Schema.NullOr<Schema.String>>;
231
+ readonly parentId: Schema.optional<Schema.NullOr<Schema.String>>;
232
+ readonly memberCount: Schema.optional<Schema.Number>;
233
+ readonly memberPreviews: Schema.optional<Schema.$Array<Schema.Struct<{
234
234
  readonly id: Schema.String;
235
235
  readonly name: Schema.String;
236
236
  readonly image: Schema.NullOr<Schema.String>;
237
- }, "Type">[] | undefined;
238
- readonly projects?: readonly Schema.Struct.ReadonlySide<{
237
+ }>>>;
238
+ readonly projects: Schema.optional<Schema.$Array<Schema.Struct<{
239
239
  readonly id: Schema.String;
240
240
  readonly name: Schema.String;
241
241
  readonly logo: Schema.NullOr<Schema.String>;
242
- }, "Type">[] | undefined;
243
- readonly createdAt: Date;
242
+ }>>>;
243
+ readonly createdAt: Schema.Date;
244
244
  }>>;
245
245
  readonly meta: Schema.Struct<{
246
246
  readonly page: Schema.Int;
@@ -248,7 +248,7 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
248
248
  readonly total: Schema.Int;
249
249
  readonly pageCount: Schema.Int;
250
250
  }>;
251
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listUsers", "GET", "/admin/users", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
251
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listUsers", "GET", "/admin/users", never, Schema.toCodecStringTree<Schema.Struct<{
252
252
  readonly page: Schema.Int;
253
253
  readonly pageSize: Schema.Int;
254
254
  readonly globalFilter: Schema.optional<Schema.String>;
@@ -257,8 +257,8 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
257
257
  readonly direction: Schema.Union<readonly [Schema.Literal<"asc">, Schema.Literal<"desc">]>;
258
258
  }>>, Schema.String, never, never>, never, never>>;
259
259
  readonly projectId: Schema.optional<Schema.String>;
260
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
261
- readonly data: Schema.$Array<Schema.Schema<Schema.Struct.ReadonlySide<{
260
+ }>>, never, never, Schema.toCodecJson<Schema.Struct<{
261
+ readonly data: Schema.$Array<Schema.Struct<{
262
262
  readonly id: Schema.String;
263
263
  readonly name: Schema.String;
264
264
  readonly email: Schema.String;
@@ -280,16 +280,16 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
280
280
  readonly name: Schema.String;
281
281
  readonly logo: Schema.NullOr<Schema.String>;
282
282
  }>>;
283
- }, "Type">>>;
283
+ }>>;
284
284
  readonly meta: Schema.Struct<{
285
285
  readonly page: Schema.Int;
286
286
  readonly pageSize: Schema.Int;
287
287
  readonly total: Schema.Int;
288
288
  readonly pageCount: Schema.Int;
289
289
  }>;
290
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"resetApiKeyRateLimit", "POST", "/admin/api-keys/:id/reset-rate-limit", HttpApiEndpoint.StringTree<Schema.Struct<{
290
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"resetApiKeyRateLimit", "POST", "/admin/api-keys/:id/reset-rate-limit", Schema.toCodecStringTree<Schema.Struct<{
291
291
  readonly id: Schema.String;
292
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
292
+ }>>, never, never, never, Schema.toCodecJson<Schema.Struct<{
293
293
  readonly id: Schema.String;
294
294
  readonly configId: Schema.String;
295
295
  readonly name: Schema.NullOr<Schema.String>;
@@ -307,16 +307,16 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
307
307
  readonly referrers: Schema.$Array<Schema.String>;
308
308
  readonly createdAt: Schema.Date;
309
309
  readonly updatedAt: Schema.Date;
310
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateApiKey", "PATCH", "/admin/api-keys/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
310
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateApiKey", "PATCH", "/admin/api-keys/:id", Schema.toCodecStringTree<Schema.Struct<{
311
311
  readonly id: Schema.String;
312
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
312
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
313
313
  readonly name: Schema.optional<Schema.NullOr<Schema.String>>;
314
314
  readonly enabled: Schema.optional<Schema.Boolean>;
315
315
  readonly rateLimitEnabled: Schema.optional<Schema.Boolean>;
316
316
  readonly rateLimitMax: Schema.optional<Schema.NullOr<Schema.Number>>;
317
317
  readonly rateLimitTimeWindow: Schema.optional<Schema.NullOr<Schema.Number>>;
318
318
  readonly referrers: Schema.optional<Schema.$Array<Schema.String>>;
319
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
319
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
320
320
  readonly id: Schema.String;
321
321
  readonly configId: Schema.String;
322
322
  readonly name: Schema.NullOr<Schema.String>;
@@ -334,15 +334,15 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
334
334
  readonly referrers: Schema.$Array<Schema.String>;
335
335
  readonly createdAt: Schema.Date;
336
336
  readonly updatedAt: Schema.Date;
337
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateDomain", "PATCH", "/admin/domains/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
337
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateDomain", "PATCH", "/admin/domains/:id", Schema.toCodecStringTree<Schema.Struct<{
338
338
  readonly id: Schema.NonEmptyString;
339
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
339
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
340
340
  readonly hostname: Schema.NonEmptyString;
341
341
  readonly rootHostname: Schema.NonEmptyString;
342
342
  readonly projectId: Schema.optional<Schema.NullOr<Schema.String>>;
343
343
  readonly organizationId: Schema.optional<Schema.NullOr<Schema.String>>;
344
344
  readonly managed: Schema.Boolean;
345
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
345
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
346
346
  readonly id: Schema.String;
347
347
  readonly hostname: Schema.String;
348
348
  readonly rootHostname: Schema.String;
@@ -357,14 +357,14 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
357
357
  readonly active: Schema.Boolean;
358
358
  readonly createdAt: Schema.Date;
359
359
  readonly updatedAt: Schema.Date;
360
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateOrganization", "PATCH", "/admin/organizations/:id", HttpApiEndpoint.StringTree<Schema.Struct<{
360
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"updateOrganization", "PATCH", "/admin/organizations/:id", Schema.toCodecStringTree<Schema.Struct<{
361
361
  readonly id: Schema.String;
362
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
362
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
363
363
  readonly name: Schema.optional<Schema.NonEmptyString>;
364
364
  readonly slug: Schema.optional<Schema.NonEmptyString>;
365
365
  readonly logo: Schema.optional<Schema.String>;
366
366
  readonly parentId: Schema.optional<Schema.NullOr<Schema.String>>;
367
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
367
+ }>>, never, Schema.toCodecJson<Schema.Struct<{
368
368
  readonly id: Schema.String;
369
369
  readonly name: Schema.String;
370
370
  readonly slug: Schema.String;
@@ -384,4 +384,4 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
384
384
  readonly logo: Schema.NullOr<Schema.String>;
385
385
  }>>>;
386
386
  readonly createdAt: Schema.Date;
387
- }>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never>, false>;
387
+ }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never>, false>;
@@ -1,10 +1,10 @@
1
1
  import { HttpApiEndpoint, HttpApiError, HttpApiGroup, OpenApi, } from "effect/unstable/httpapi";
2
2
  import { Schema } from "effect";
3
- import { AdminCreateOrganizationPayload, AdminApiKey, AdminApiKeyIdParams, AdminListQuery, AdminOrganization, AdminOrganizationIdParams, AdminUpdateApiKeyPayload, AdminUpdateOrganizationPayload, DashboardStatsQuery, DashboardStatsResponse, PaginatedAdminOrganizations, PaginatedAdminUsers, ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, } from "./schema";
4
- export * from "./schema";
3
+ import { AdminCreateOrganizationPayload, AdminApiKey, AdminApiKeyIdParams, AdminListQuery, AdminOrganization, AdminOrganizationIdParams, AdminUpdateApiKeyPayload, AdminUpdateOrganizationPayload, DashboardStatsQuery, DashboardStatsResponse, PaginatedAdminOrganizations, PaginatedAdminUsers, ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, } from "./schema.js";
4
+ export * from "./schema.js";
5
5
  export const AdminApiGroup = HttpApiGroup.make("admin")
6
6
  .add(HttpApiEndpoint.get("dashboardStats", "/admin/dashboard-stats", {
7
- query: DashboardStatsQuery,
7
+ query: DashboardStatsQuery.fields,
8
8
  success: DashboardStatsResponse,
9
9
  error: [
10
10
  HttpApiError.Unauthorized,
@@ -29,7 +29,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
29
29
  description: "Returns all API key metadata for authenticated administrators.",
30
30
  })))
31
31
  .add(HttpApiEndpoint.delete("deleteApiKey", "/admin/api-keys/:id", {
32
- params: AdminApiKeyIdParams,
32
+ params: AdminApiKeyIdParams.fields,
33
33
  success: AdminApiKey,
34
34
  error: [
35
35
  HttpApiError.Unauthorized,
@@ -43,7 +43,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
43
43
  description: "Deletes an API key for authenticated administrators.",
44
44
  })))
45
45
  .add(HttpApiEndpoint.patch("updateApiKey", "/admin/api-keys/:id", {
46
- params: AdminApiKeyIdParams,
46
+ params: AdminApiKeyIdParams.fields,
47
47
  payload: AdminUpdateApiKeyPayload,
48
48
  success: AdminApiKey,
49
49
  error: [
@@ -58,7 +58,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
58
58
  description: "Updates API key metadata, referrer restrictions, and rate-limit settings for authenticated administrators.",
59
59
  })))
60
60
  .add(HttpApiEndpoint.post("resetApiKeyRateLimit", "/admin/api-keys/:id/reset-rate-limit", {
61
- params: AdminApiKeyIdParams,
61
+ params: AdminApiKeyIdParams.fields,
62
62
  success: AdminApiKey,
63
63
  error: [
64
64
  HttpApiError.Unauthorized,
@@ -72,7 +72,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
72
72
  description: "Resets request count and last-used window state for an API key.",
73
73
  })))
74
74
  .add(HttpApiEndpoint.post("enableApiKeyRateLimit", "/admin/api-keys/:id/enable-rate-limit", {
75
- params: AdminApiKeyIdParams,
75
+ params: AdminApiKeyIdParams.fields,
76
76
  success: AdminApiKey,
77
77
  error: [
78
78
  HttpApiError.Unauthorized,
@@ -86,7 +86,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
86
86
  description: "Enables rate-limit enforcement for an API key.",
87
87
  })))
88
88
  .add(HttpApiEndpoint.post("disableApiKeyRateLimit", "/admin/api-keys/:id/disable-rate-limit", {
89
- params: AdminApiKeyIdParams,
89
+ params: AdminApiKeyIdParams.fields,
90
90
  success: AdminApiKey,
91
91
  error: [
92
92
  HttpApiError.Unauthorized,
@@ -100,7 +100,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
100
100
  description: "Disables rate-limit enforcement for an API key.",
101
101
  })))
102
102
  .add(HttpApiEndpoint.get("listUsers", "/admin/users", {
103
- query: AdminListQuery,
103
+ query: AdminListQuery.fields,
104
104
  success: PaginatedAdminUsers,
105
105
  error: [
106
106
  HttpApiError.Unauthorized,
@@ -113,7 +113,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
113
113
  description: "Returns paginated auth user records with optional filtering and sorting.",
114
114
  })))
115
115
  .add(HttpApiEndpoint.get("listOrganizations", "/admin/organizations", {
116
- query: AdminListQuery,
116
+ query: AdminListQuery.fields,
117
117
  success: PaginatedAdminOrganizations,
118
118
  error: [
119
119
  HttpApiError.Unauthorized,
@@ -139,7 +139,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
139
139
  description: "Creates an app-managed organization record.",
140
140
  })))
141
141
  .add(HttpApiEndpoint.patch("updateOrganization", "/admin/organizations/:id", {
142
- params: AdminOrganizationIdParams,
142
+ params: AdminOrganizationIdParams.fields,
143
143
  payload: AdminUpdateOrganizationPayload,
144
144
  success: AdminOrganization,
145
145
  error: [
@@ -154,7 +154,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
154
154
  description: "Updates an app-managed organization record.",
155
155
  })))
156
156
  .add(HttpApiEndpoint.delete("deleteOrganization", "/admin/organizations/:id", {
157
- params: AdminOrganizationIdParams,
157
+ params: AdminOrganizationIdParams.fields,
158
158
  success: AdminOrganization,
159
159
  error: [
160
160
  HttpApiError.Unauthorized,
@@ -194,7 +194,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
194
194
  description: "Registers an auth-owned custom hostname.",
195
195
  })))
196
196
  .add(HttpApiEndpoint.patch("updateDomain", "/admin/domains/:id", {
197
- params: ServerDomainIdParams,
197
+ params: ServerDomainIdParams.fields,
198
198
  payload: ServerUpdateDomainPayload,
199
199
  success: ServerDomain,
200
200
  error: [
@@ -209,7 +209,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
209
209
  description: "Updates trust target, ownership links, and Cloudflare management mode for an auth hostname.",
210
210
  })))
211
211
  .add(HttpApiEndpoint.get("getDomainRecords", "/admin/domains/:id/records", {
212
- params: ServerDomainIdParams,
212
+ params: ServerDomainIdParams.fields,
213
213
  success: ServerDomainRecordsResponse,
214
214
  error: [
215
215
  HttpApiError.Unauthorized,
@@ -223,7 +223,7 @@ export const AdminApiGroup = HttpApiGroup.make("admin")
223
223
  description: "Returns DNS records and refreshed status for an auth-owned custom hostname.",
224
224
  })))
225
225
  .add(HttpApiEndpoint.delete("deleteDomain", "/admin/domains/:id", {
226
- params: ServerDomainIdParams,
226
+ params: ServerDomainIdParams.fields,
227
227
  success: ServerDomain,
228
228
  error: [
229
229
  HttpApiError.Unauthorized,
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload } from "../server/schema";
2
+ import { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload } from "../server/schema.js";
3
3
  export declare const AdminListQuery: Schema.Struct<{
4
4
  readonly page: Schema.Int;
5
5
  readonly pageSize: Schema.Int;
@@ -155,7 +155,7 @@ export declare const DashboardStatsResponse: Schema.Struct<{
155
155
  }>>;
156
156
  }>;
157
157
  export declare const PaginatedAdminUsers: Schema.Struct<{
158
- readonly data: Schema.$Array<Schema.Schema<Schema.Struct.ReadonlySide<{
158
+ readonly data: Schema.$Array<Schema.Struct<{
159
159
  readonly id: Schema.String;
160
160
  readonly name: Schema.String;
161
161
  readonly email: Schema.String;
@@ -177,7 +177,7 @@ export declare const PaginatedAdminUsers: Schema.Struct<{
177
177
  readonly name: Schema.String;
178
178
  readonly logo: Schema.NullOr<Schema.String>;
179
179
  }>>;
180
- }, "Type">>>;
180
+ }>>;
181
181
  readonly meta: Schema.Struct<{
182
182
  readonly page: Schema.Int;
183
183
  readonly pageSize: Schema.Int;
@@ -186,26 +186,26 @@ export declare const PaginatedAdminUsers: Schema.Struct<{
186
186
  }>;
187
187
  }>;
188
188
  export declare const PaginatedAdminOrganizations: Schema.Struct<{
189
- readonly data: Schema.$Array<Schema.Schema<{
190
- readonly id: string;
191
- readonly name: string;
192
- readonly slug: string;
193
- readonly logo?: string | null | undefined;
194
- readonly metadata?: string | null | undefined;
195
- readonly userId?: string | null | undefined;
196
- readonly parentId?: string | null | undefined;
197
- readonly memberCount?: number | undefined;
198
- readonly memberPreviews?: readonly Schema.Struct.ReadonlySide<{
189
+ readonly data: Schema.$Array<Schema.Struct<{
190
+ readonly id: Schema.String;
191
+ readonly name: Schema.String;
192
+ readonly slug: Schema.String;
193
+ readonly logo: Schema.optional<Schema.NullOr<Schema.String>>;
194
+ readonly metadata: Schema.optional<Schema.NullOr<Schema.String>>;
195
+ readonly userId: Schema.optional<Schema.NullOr<Schema.String>>;
196
+ readonly parentId: Schema.optional<Schema.NullOr<Schema.String>>;
197
+ readonly memberCount: Schema.optional<Schema.Number>;
198
+ readonly memberPreviews: Schema.optional<Schema.$Array<Schema.Struct<{
199
199
  readonly id: Schema.String;
200
200
  readonly name: Schema.String;
201
201
  readonly image: Schema.NullOr<Schema.String>;
202
- }, "Type">[] | undefined;
203
- readonly projects?: readonly Schema.Struct.ReadonlySide<{
202
+ }>>>;
203
+ readonly projects: Schema.optional<Schema.$Array<Schema.Struct<{
204
204
  readonly id: Schema.String;
205
205
  readonly name: Schema.String;
206
206
  readonly logo: Schema.NullOr<Schema.String>;
207
- }, "Type">[] | undefined;
208
- readonly createdAt: Date;
207
+ }>>>;
208
+ readonly createdAt: Schema.Date;
209
209
  }>>;
210
210
  readonly meta: Schema.Struct<{
211
211
  readonly page: Schema.Int;
@@ -225,4 +225,4 @@ export type AdminUpdateApiKeyPayload = typeof AdminUpdateApiKeyPayload.Type;
225
225
  export type AdminCreateOrganizationPayload = typeof AdminCreateOrganizationPayload.Type;
226
226
  export type AdminUpdateOrganizationPayload = typeof AdminUpdateOrganizationPayload.Type;
227
227
  export { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, };
228
- export { SortParamsFromString } from "../query";
228
+ export { SortParamsFromString } from "../query.js";
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
- import { PaginatedResponse, Query } from "../query";
3
- import { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, } from "../server/schema";
2
+ import { PaginatedResponse, Query } from "../query.js";
3
+ import { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, } from "../server/schema.js";
4
4
  export const AdminListQuery = Schema.Struct({
5
5
  ...Query.fields,
6
6
  projectId: Schema.optional(Schema.String),
@@ -306,4 +306,4 @@ export const PaginatedAdminOrganizations = PaginatedResponse(AdminOrganization).
306
306
  description: "Paginated administrative organization list response.",
307
307
  });
308
308
  export { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload, };
309
- export { SortParamsFromString } from "../query";
309
+ export { SortParamsFromString } from "../query.js";