@krak-stack/auth 0.1.40 → 0.1.42

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 (40) hide show
  1. package/dist/admin/api.group.d.ts +197 -0
  2. package/dist/admin/api.group.js +159 -0
  3. package/dist/admin/schema.d.ts +128 -0
  4. package/dist/admin/schema.js +190 -0
  5. package/dist/api.d.ts +264 -11
  6. package/dist/api.js +14 -5
  7. package/dist/better-auth/{index.d.ts → api.group.d.ts} +6 -8
  8. package/dist/better-auth/{api.js → api.group.js} +2 -4
  9. package/dist/components/admin-organization-form.d.ts +3 -3
  10. package/dist/components/admin-organization-form.js +9 -19
  11. package/dist/components/admin-organizations.js +16 -12
  12. package/dist/components/admin-users.d.ts +1 -1
  13. package/dist/components/admin-users.js +35 -18
  14. package/dist/components/{auth-api-client.d.ts → auth-client-api.d.ts} +179 -209
  15. package/dist/components/auth-client-api.js +29 -0
  16. package/dist/components/auth-forms.js +3 -3
  17. package/dist/components/auth-provider.js +2 -2
  18. package/dist/components/organization-switcher.js +15 -16
  19. package/dist/components/user-button.js +3 -3
  20. package/dist/components/utils.d.ts +11 -0
  21. package/dist/components/utils.js +24 -0
  22. package/dist/extra/api.group.d.ts +68 -0
  23. package/dist/extra/{api.js → api.group.js} +5 -17
  24. package/dist/index.d.ts +5 -3
  25. package/dist/index.js +5 -3
  26. package/dist/query.d.ts +49 -0
  27. package/dist/query.js +114 -0
  28. package/dist/server/{api.d.ts → api.group.d.ts} +0 -196
  29. package/dist/server/{api.js → api.group.js} +1 -6
  30. package/dist/server/index.d.ts +2 -2
  31. package/dist/server/index.js +2 -1
  32. package/dist/service.d.ts +12 -24
  33. package/dist/service.js +2 -2
  34. package/package.json +13 -5
  35. package/dist/better-auth/api.d.ts +0 -55
  36. package/dist/better-auth/index.js +0 -12
  37. package/dist/components/auth-api-client.js +0 -29
  38. package/dist/extra/api.d.ts +0 -139
  39. package/dist/extra/index.d.ts +0 -76
  40. package/dist/extra/index.js +0 -14
package/dist/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { HttpApi } from "effect/unstable/httpapi";
2
- export declare const AuthApi: HttpApi.HttpApi<"AuthApi", import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"auth", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getSession", "GET", "/api/auth/get-session", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").NullOr<import("effect/Schema").Struct<{
2
+ export declare const AuthServiceApi: HttpApi.HttpApi<"AuthServiceApi", import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"auth", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getSession", "GET", "/api/auth/get-session", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").NullOr<import("effect/Schema").Struct<{
3
3
  readonly session: import("effect/Schema").Struct<{
4
4
  readonly id: import("effect/Schema").String;
5
5
  readonly expiresAt: import("effect/Schema").Date;
@@ -24,7 +24,7 @@ export declare const AuthApi: HttpApi.HttpApi<"AuthApi", import("effect/unstable
24
24
  readonly createdAt: import("effect/Schema").Date;
25
25
  readonly updatedAt: import("effect/Schema").Date;
26
26
  }>;
27
- }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("./better-auth").TooManyRequests>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"authExtra", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"createApiKey", "POST", "/api/auth/create-api-key", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
27
+ }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("./better-auth/schema").TooManyRequests>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"authExtra", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"createApiKey", "POST", "/api/auth/create-api-key", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
28
28
  readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
29
29
  readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
30
30
  readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
@@ -32,7 +32,7 @@ export declare const AuthApi: HttpApi.HttpApi<"AuthApi", import("effect/unstable
32
32
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
33
33
  readonly id: import("effect/Schema").String;
34
34
  readonly key: import("effect/Schema").String;
35
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getProjectPublicConfig", "GET", "/api/auth/project-config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
35
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getProjectPublicConfig", "GET", "/api/auth/project-config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
36
36
  readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
37
37
  readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
38
38
  readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
@@ -55,15 +55,11 @@ export declare const AuthApi: HttpApi.HttpApi<"AuthApi", import("effect/unstable
55
55
  readonly newPassword: import("effect/Schema").NonEmptyString;
56
56
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
57
57
  readonly ok: import("effect/Schema").Boolean;
58
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"uploadOrganizationLogo", "POST", "/api/organizations/logo/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
58
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"uploadUserImage", "POST", "/api/auth/image/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
59
59
  readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
60
60
  }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
61
61
  readonly url: import("effect/Schema").String;
62
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"uploadUserImage", "POST", "/api/auth/image/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
63
- readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
64
- }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
65
- readonly url: import("effect/Schema").String;
66
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("./extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"verifyApiKey", "POST", "/api/auth/verify-api-key", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
62
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("./extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"verifyApiKey", "POST", "/api/auth/verify-api-key", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
67
63
  readonly key: import("effect/Schema").NonEmptyString;
68
64
  readonly configId: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>>;
69
65
  readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
@@ -87,11 +83,11 @@ export declare const AuthApi: HttpApi.HttpApi<"AuthApi", import("effect/unstable
87
83
  readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
88
84
  readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
89
85
  }>>;
90
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"verifyPassword", "POST", "/api/auth/verify-password", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
86
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"verifyPassword", "POST", "/api/auth/verify-password", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
91
87
  readonly password: import("effect/Schema").NonEmptyString;
92
88
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
93
89
  readonly ok: import("effect/Schema").Boolean;
94
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"domains", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"createDomain", "POST", "/api/domains", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
90
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"domains", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"createDomain", "POST", "/api/domains", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
95
91
  readonly hostname: import("effect/Schema").NonEmptyString;
96
92
  readonly rootHostname: import("effect/Schema").NonEmptyString;
97
93
  readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
@@ -286,3 +282,260 @@ export declare const AuthApi: HttpApi.HttpApi<"AuthApi", import("effect/unstable
286
282
  }>>;
287
283
  readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
288
284
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never>, false>>;
285
+ export declare const AuthClientApi: HttpApi.HttpApi<"AuthClientApi", import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"admin", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"createDomain", "POST", "/api/auth/admin/domains", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
286
+ readonly hostname: import("effect/Schema").NonEmptyString;
287
+ readonly rootHostname: import("effect/Schema").NonEmptyString;
288
+ readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
289
+ readonly organizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
290
+ readonly managed: import("effect/Schema").Boolean;
291
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
292
+ readonly id: import("effect/Schema").String;
293
+ readonly hostname: import("effect/Schema").String;
294
+ readonly rootHostname: import("effect/Schema").String;
295
+ readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
296
+ readonly projectName: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
297
+ readonly projectLogo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
298
+ readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
299
+ readonly organizationName: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
300
+ readonly organizationLogo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
301
+ readonly hostnameId: import("effect/Schema").String;
302
+ readonly managed: import("effect/Schema").Boolean;
303
+ readonly active: import("effect/Schema").Boolean;
304
+ readonly createdAt: import("effect/Schema").Date;
305
+ readonly updatedAt: import("effect/Schema").Date;
306
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"createOrganization", "POST", "/api/auth/admin/organizations", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
307
+ readonly name: import("effect/Schema").NonEmptyString;
308
+ readonly slug: import("effect/Schema").NonEmptyString;
309
+ readonly logo: import("effect/Schema").optional<import("effect/Schema").String>;
310
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
311
+ readonly id: import("effect/Schema").String;
312
+ readonly name: import("effect/Schema").String;
313
+ readonly slug: import("effect/Schema").String;
314
+ readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
315
+ readonly metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
316
+ readonly createdAt: import("effect/Schema").Date;
317
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"dashboardStats", "GET", "/api/auth/admin/dashboard-stats", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
318
+ readonly days: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"7">, import("effect/Schema").Literal<"14">, import("effect/Schema").Literal<"30">, import("effect/Schema").Literal<"90">]>>;
319
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
320
+ readonly totalUsers: import("effect/Schema").Number;
321
+ readonly totalOrganizations: import("effect/Schema").Number;
322
+ readonly totalProjects: import("effect/Schema").Number;
323
+ readonly totalDomains: import("effect/Schema").Number;
324
+ readonly totalApiKeys: import("effect/Schema").Number;
325
+ readonly totalOauthClients: import("effect/Schema").Number;
326
+ readonly dailyActiveUsers: import("effect/Schema").Number;
327
+ readonly dailyActiveUsersByDay: import("effect/Schema").$Array<import("effect/Schema").Struct<{
328
+ readonly date: import("effect/Schema").String;
329
+ readonly count: import("effect/Schema").Number;
330
+ }>>;
331
+ readonly signupsByDay: import("effect/Schema").$Array<import("effect/Schema").Struct<{
332
+ readonly date: import("effect/Schema").String;
333
+ readonly count: import("effect/Schema").Number;
334
+ }>>;
335
+ readonly projectConnections: import("effect/Schema").$Array<import("effect/Schema").Struct<{
336
+ readonly projectId: import("effect/Schema").String;
337
+ readonly projectName: import("effect/Schema").String;
338
+ readonly users: import("effect/Schema").Number;
339
+ readonly organizations: import("effect/Schema").Number;
340
+ }>>;
341
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"deleteDomain", "DELETE", "/api/auth/admin/domains/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
342
+ readonly id: import("effect/Schema").NonEmptyString;
343
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
344
+ readonly id: import("effect/Schema").String;
345
+ readonly hostname: import("effect/Schema").String;
346
+ readonly rootHostname: import("effect/Schema").String;
347
+ readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
348
+ readonly projectName: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
349
+ readonly projectLogo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
350
+ readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
351
+ readonly organizationName: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
352
+ readonly organizationLogo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
353
+ readonly hostnameId: import("effect/Schema").String;
354
+ readonly managed: import("effect/Schema").Boolean;
355
+ readonly active: import("effect/Schema").Boolean;
356
+ readonly createdAt: import("effect/Schema").Date;
357
+ readonly updatedAt: import("effect/Schema").Date;
358
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"deleteOrganization", "DELETE", "/api/auth/admin/organizations/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
359
+ readonly id: import("effect/Schema").String;
360
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
361
+ readonly id: import("effect/Schema").String;
362
+ readonly name: import("effect/Schema").String;
363
+ readonly slug: import("effect/Schema").String;
364
+ readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
365
+ readonly metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
366
+ readonly createdAt: import("effect/Schema").Date;
367
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getDomainRecords", "GET", "/api/auth/admin/domains/:id/records", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
368
+ readonly id: import("effect/Schema").NonEmptyString;
369
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
370
+ readonly required: import("effect/Schema").Boolean;
371
+ readonly status: import("effect/Schema").String;
372
+ readonly type: import("effect/Schema").String;
373
+ readonly name: import("effect/Schema").String;
374
+ readonly value: import("effect/Schema").String;
375
+ }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listDomains", "GET", "/api/auth/admin/domains", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").$Array<import("effect/Schema").Struct<{
376
+ readonly id: import("effect/Schema").String;
377
+ readonly hostname: import("effect/Schema").String;
378
+ readonly rootHostname: import("effect/Schema").String;
379
+ readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
380
+ readonly projectName: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
381
+ readonly projectLogo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
382
+ readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
383
+ readonly organizationName: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
384
+ readonly organizationLogo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
385
+ readonly hostnameId: import("effect/Schema").String;
386
+ readonly managed: import("effect/Schema").Boolean;
387
+ readonly active: import("effect/Schema").Boolean;
388
+ readonly createdAt: import("effect/Schema").Date;
389
+ readonly updatedAt: import("effect/Schema").Date;
390
+ }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listOrganizations", "GET", "/api/auth/admin/organizations", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
391
+ readonly page: import("effect/Schema").Int;
392
+ readonly pageSize: import("effect/Schema").Int;
393
+ readonly globalFilter: import("effect/Schema").optional<import("effect/Schema").String>;
394
+ readonly sort: import("effect/Schema").optional<import("effect/Schema").decodeTo<import("effect/Schema").String, import("effect/Schema").decodeTo<import("effect/Schema").$Array<import("effect/Schema").Struct<{
395
+ readonly id: import("effect/Schema").NonEmptyString;
396
+ readonly direction: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"asc">, import("effect/Schema").Literal<"desc">]>;
397
+ }>>, import("effect/Schema").String, never, never>, never, never>>;
398
+ readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
399
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
400
+ readonly data: import("effect/Schema").$Array<import("effect/Schema").Schema<{
401
+ readonly id: string;
402
+ readonly name: string;
403
+ readonly slug: string;
404
+ readonly logo?: string | null | undefined;
405
+ readonly metadata?: string | null | undefined;
406
+ readonly createdAt: Date;
407
+ }>>;
408
+ readonly meta: import("effect/Schema").Struct<{
409
+ readonly page: import("effect/Schema").Int;
410
+ readonly pageSize: import("effect/Schema").Int;
411
+ readonly total: import("effect/Schema").Int;
412
+ readonly pageCount: import("effect/Schema").Int;
413
+ }>;
414
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listUsers", "GET", "/api/auth/admin/users", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
415
+ readonly page: import("effect/Schema").Int;
416
+ readonly pageSize: import("effect/Schema").Int;
417
+ readonly globalFilter: import("effect/Schema").optional<import("effect/Schema").String>;
418
+ readonly sort: import("effect/Schema").optional<import("effect/Schema").decodeTo<import("effect/Schema").String, import("effect/Schema").decodeTo<import("effect/Schema").$Array<import("effect/Schema").Struct<{
419
+ readonly id: import("effect/Schema").NonEmptyString;
420
+ readonly direction: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"asc">, import("effect/Schema").Literal<"desc">]>;
421
+ }>>, import("effect/Schema").String, never, never>, never, never>>;
422
+ readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
423
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
424
+ readonly data: import("effect/Schema").$Array<import("effect/Schema").Schema<import("effect/Schema").Struct.ReadonlySide<{
425
+ readonly id: import("effect/Schema").String;
426
+ readonly name: import("effect/Schema").String;
427
+ readonly email: import("effect/Schema").String;
428
+ readonly emailVerified: import("effect/Schema").Boolean;
429
+ readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
430
+ readonly createdAt: import("effect/Schema").Date;
431
+ readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
432
+ readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
433
+ readonly banReason: import("effect/Schema").NullOr<import("effect/Schema").String>;
434
+ readonly banExpires: import("effect/Schema").NullOr<import("effect/Schema").Date>;
435
+ }, "Type">>>;
436
+ readonly meta: import("effect/Schema").Struct<{
437
+ readonly page: import("effect/Schema").Int;
438
+ readonly pageSize: import("effect/Schema").Int;
439
+ readonly total: import("effect/Schema").Int;
440
+ readonly pageCount: import("effect/Schema").Int;
441
+ }>;
442
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateDomain", "PATCH", "/api/auth/admin/domains/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
443
+ readonly id: import("effect/Schema").NonEmptyString;
444
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
445
+ readonly hostname: import("effect/Schema").NonEmptyString;
446
+ readonly rootHostname: import("effect/Schema").NonEmptyString;
447
+ readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
448
+ readonly organizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
449
+ readonly managed: import("effect/Schema").Boolean;
450
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
451
+ readonly id: import("effect/Schema").String;
452
+ readonly hostname: import("effect/Schema").String;
453
+ readonly rootHostname: import("effect/Schema").String;
454
+ readonly projectId: import("effect/Schema").NullOr<import("effect/Schema").String>;
455
+ readonly projectName: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
456
+ readonly projectLogo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
457
+ readonly organizationId: import("effect/Schema").NullOr<import("effect/Schema").String>;
458
+ readonly organizationName: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
459
+ readonly organizationLogo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
460
+ readonly hostnameId: import("effect/Schema").String;
461
+ readonly managed: import("effect/Schema").Boolean;
462
+ readonly active: import("effect/Schema").Boolean;
463
+ readonly createdAt: import("effect/Schema").Date;
464
+ readonly updatedAt: import("effect/Schema").Date;
465
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateOrganization", "PATCH", "/api/auth/admin/organizations/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
466
+ readonly id: import("effect/Schema").String;
467
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
468
+ readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
469
+ readonly slug: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
470
+ readonly logo: import("effect/Schema").optional<import("effect/Schema").String>;
471
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
472
+ readonly id: import("effect/Schema").String;
473
+ readonly name: import("effect/Schema").String;
474
+ readonly slug: import("effect/Schema").String;
475
+ readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
476
+ readonly metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
477
+ readonly createdAt: import("effect/Schema").Date;
478
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"authExtra", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"createApiKey", "POST", "/api/auth/create-api-key", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
479
+ readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
480
+ readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
481
+ readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
482
+ readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
483
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
484
+ readonly id: import("effect/Schema").String;
485
+ readonly key: import("effect/Schema").String;
486
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getProjectPublicConfig", "GET", "/api/auth/project-config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
487
+ readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
488
+ readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
489
+ readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
490
+ readonly rootHost: import("effect/Schema").optional<import("effect/Schema").String>;
491
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
492
+ readonly projectKey: import("effect/Schema").String;
493
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
494
+ readonly logoUrl: import("effect/Schema").NullOr<import("effect/Schema").String>;
495
+ readonly authDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
496
+ readonly rootDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
497
+ readonly themeCss: import("effect/Schema").NullOr<import("effect/Schema").String>;
498
+ readonly authOptions: import("effect/Schema").Struct<{
499
+ readonly emailPassword: import("effect/Schema").Boolean;
500
+ readonly emailOtp: import("effect/Schema").Boolean;
501
+ readonly google: import("effect/Schema").Boolean;
502
+ readonly signUp: import("effect/Schema").Boolean;
503
+ readonly signUpName: import("effect/Schema").Boolean;
504
+ }>;
505
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"setPassword", "POST", "/api/auth/set-password", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
506
+ readonly newPassword: import("effect/Schema").NonEmptyString;
507
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
508
+ readonly ok: import("effect/Schema").Boolean;
509
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"uploadUserImage", "POST", "/api/auth/image/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
510
+ readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
511
+ }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
512
+ readonly url: import("effect/Schema").String;
513
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("./extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"verifyApiKey", "POST", "/api/auth/verify-api-key", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
514
+ readonly key: import("effect/Schema").NonEmptyString;
515
+ readonly configId: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>>;
516
+ readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
517
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
518
+ readonly valid: import("effect/Schema").Boolean;
519
+ readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
520
+ readonly message: import("effect/Schema").String;
521
+ readonly code: import("effect/Schema").String;
522
+ }>>;
523
+ readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
524
+ readonly id: import("effect/Schema").String;
525
+ readonly configId: import("effect/Schema").String;
526
+ readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
527
+ readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
528
+ readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
529
+ readonly referenceId: import("effect/Schema").String;
530
+ readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
531
+ readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
532
+ readonly createdAt: import("effect/Schema").Date;
533
+ readonly updatedAt: import("effect/Schema").Date;
534
+ readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
535
+ readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
536
+ }>>;
537
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"verifyPassword", "POST", "/api/auth/verify-password", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
538
+ readonly password: import("effect/Schema").NonEmptyString;
539
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
540
+ readonly ok: import("effect/Schema").Boolean;
541
+ }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never>, false>>;
package/dist/api.js CHANGED
@@ -1,12 +1,21 @@
1
1
  import { HttpApi, OpenApi } from "effect/unstable/httpapi";
2
- import { BetterAuthApiGroup } from "./better-auth/api";
3
- import { ExtraApiGroup } from "./extra/api";
4
- import { ServerDomainsApiGroup, ServerOrganizationsApiGroup, ServerUsersApiGroup, } from "./server/api";
5
- export const AuthApi = HttpApi.make("AuthApi")
2
+ import { AdminApiGroup } from "./admin/api.group";
3
+ import { BetterAuthApiGroup } from "./better-auth/api.group";
4
+ import { ExtraApiGroup } from "./extra/api.group";
5
+ import { ServerDomainsApiGroup, ServerOrganizationsApiGroup, ServerUsersApiGroup, } from "./server/api.group";
6
+ export const AuthServiceApi = HttpApi.make("AuthServiceApi")
6
7
  .annotateMerge(OpenApi.annotations({
7
- title: "KrakStack Auth API",
8
+ title: "KrakStack Auth Service API",
8
9
  version: "1.0.0",
9
10
  description: "Auth API for Better Auth extensions, KrakStack extra endpoints, and trusted server endpoints.",
10
11
  }))
11
12
  .add(BetterAuthApiGroup.prefix("/auth"), ExtraApiGroup, ServerUsersApiGroup, ServerOrganizationsApiGroup, ServerDomainsApiGroup)
12
13
  .prefix("/api");
14
+ export const AuthClientApi = HttpApi.make("AuthClientApi")
15
+ .annotateMerge(OpenApi.annotations({
16
+ title: "KrakStack Auth Client API",
17
+ version: "1.0.0",
18
+ description: "Browser-facing API used by KrakStack Auth React components.",
19
+ }))
20
+ .add(ExtraApiGroup, AdminApiGroup.prefix("/auth"))
21
+ .prefix("/api");
@@ -1,5 +1,8 @@
1
- import { AtomHttpApi } from "effect/unstable/reactivity";
2
- declare const BetterAuthApiClient_base: AtomHttpApi.AtomHttpApiClient<BetterAuthApiClient, "BetterAuthApiClient", import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"auth", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getSession", "GET", "/api/auth/get-session", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").NullOr<import("effect/Schema").Struct<{
1
+ import { HttpApiEndpoint, HttpApiError, HttpApiGroup } from "effect/unstable/httpapi";
2
+ import { TooManyRequests } from "./schema";
3
+ export * from "./schema";
4
+ export type { Session, User } from "../schema";
5
+ export declare const BetterAuthApiGroup: HttpApiGroup.HttpApiGroup<"auth", HttpApiEndpoint.HttpApiEndpoint<"getSession", "GET", "/get-session", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").NullOr<import("effect/Schema").Struct<{
3
6
  readonly session: import("effect/Schema").Struct<{
4
7
  readonly id: import("effect/Schema").String;
5
8
  readonly expiresAt: import("effect/Schema").Date;
@@ -24,9 +27,4 @@ declare const BetterAuthApiClient_base: AtomHttpApi.AtomHttpApiClient<BetterAuth
24
27
  readonly createdAt: import("effect/Schema").Date;
25
28
  readonly updatedAt: import("effect/Schema").Date;
26
29
  }>;
27
- }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("./schema").TooManyRequests>, never, never>, false>>;
28
- export declare class BetterAuthApiClient extends BetterAuthApiClient_base {
29
- }
30
- export { BetterAuthApi, BetterAuthApiGroup } from "./api";
31
- export * from "./schema";
32
- export type { Session, User } from "../schema";
30
+ }>>>, HttpApiEndpoint.Json<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError | typeof TooManyRequests>, never, never>, false>;
@@ -1,6 +1,7 @@
1
- import { HttpApi, OpenApi } from "effect/unstable/httpapi";
1
+ import { OpenApi } from "effect/unstable/httpapi";
2
2
  import { HttpApiEndpoint, HttpApiError, HttpApiGroup, } from "effect/unstable/httpapi";
3
3
  import { GetSessionResponse, TooManyRequests } from "./schema";
4
+ export * from "./schema";
4
5
  export const BetterAuthApiGroup = HttpApiGroup.make("auth")
5
6
  .add(HttpApiEndpoint.get("getSession", "/get-session", {
6
7
  success: GetSessionResponse,
@@ -21,6 +22,3 @@ export const BetterAuthApiGroup = HttpApiGroup.make("auth")
21
22
  title: "Better Auth",
22
23
  description: "Better Auth-owned browser session endpoints.",
23
24
  }));
24
- export const BetterAuthApi = HttpApi.make("BetterAuthApi")
25
- .add(BetterAuthApiGroup)
26
- .prefix("/api/auth");
@@ -1,6 +1,6 @@
1
- import { type Organization } from "@/services/organizations/schema";
1
+ import { type AdminOrganization } from "../admin/schema";
2
2
  export declare function AdminOrganizationForm({ organization, onClose, onSaved, }: {
3
- organization?: Organization;
3
+ organization?: AdminOrganization;
4
4
  onClose: () => void;
5
- onSaved: (organization: Organization) => void;
5
+ onSaved: (organization: AdminOrganization) => void;
6
6
  }): import("react").JSX.Element;
@@ -8,12 +8,10 @@ import { toast } from "sonner";
8
8
  import { ErrorMessage, useAppForm } from "@/components/ui/form";
9
9
  import { Button } from "@/components/ui/button";
10
10
  import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "@/components/ui/dialog";
11
- import { AdminApiClient } from "@/lib/admin-api-client";
12
- import { ApiClient } from "@/lib/api-client";
13
- import { assetPath, assetUrl } from "@/lib/assets";
14
- import { authBaseUrl } from "@/services/auth/client";
15
- import { CreateOrganizationPayload, } from "@/services/organizations/schema";
11
+ import { AdminCreateOrganizationPayload, } from "../admin/schema";
12
+ import { authClientApi } from "./auth-client-api";
16
13
  import { useKrakstackAuth } from "./auth-provider";
14
+ import { assetPath, assetUrl } from "./utils";
17
15
  const defaultMessages = {
18
16
  en: {
19
17
  admin_organization_edit_description: "Update {name}'s canonical organization details.",
@@ -56,10 +54,7 @@ const slugify = (value) => value
56
54
  .replace(/[^a-z0-9]+/g, "-")
57
55
  .replace(/^-+|-+$/g, "");
58
56
  const isFile = (value) => value instanceof File;
59
- const createOrganizationAtom = AdminApiClient.mutation("admin", "createOrganization");
60
- const updateOrganizationAtom = AdminApiClient.mutation("admin", "updateOrganization");
61
- const uploadLogoAtom = ApiClient.mutation("organizations", "uploadOrganizationLogo");
62
- const valuesToPayload = (value, logo) => Schema.decodeUnknownSync(CreateOrganizationPayload)({
57
+ const valuesToPayload = (value, logo) => Schema.decodeUnknownSync(AdminCreateOrganizationPayload)({
63
58
  name: value.name.trim(),
64
59
  slug: slugify(value.slug || value.name),
65
60
  logo: logo ?? undefined,
@@ -67,22 +62,17 @@ const valuesToPayload = (value, logo) => Schema.decodeUnknownSync(CreateOrganiza
67
62
  export function AdminOrganizationForm({ organization, onClose, onSaved, }) {
68
63
  const auth = useKrakstackAuth();
69
64
  const m = labels(auth?.locale ?? "en");
70
- const createOrganization = useAtomSet(createOrganizationAtom, {
71
- mode: "promise",
72
- });
73
- const updateOrganization = useAtomSet(updateOrganizationAtom, {
74
- mode: "promise",
75
- });
76
- const uploadLogo = useAtomSet(uploadLogoAtom, {
77
- mode: "promise",
78
- });
65
+ const baseUrl = auth?.baseUrl;
66
+ const createOrganization = useAtomSet(authClientApi(baseUrl).mutation("admin", "createOrganization"), { mode: "promise" });
67
+ const updateOrganization = useAtomSet(authClientApi(baseUrl).mutation("admin", "updateOrganization"), { mode: "promise" });
68
+ const uploadLogo = useAtomSet(authClientApi(baseUrl).mutation("authExtra", "uploadUserImage"), { mode: "promise" });
79
69
  const [error, setError] = useState("");
80
70
  const isEditing = Boolean(organization);
81
71
  const form = useAppForm({
82
72
  defaultValues: {
83
73
  name: organization?.name ?? "",
84
74
  slug: organization?.slug ?? "",
85
- logo: assetUrl(organization?.logo, authBaseUrl),
75
+ logo: assetUrl(organization?.logo, baseUrl),
86
76
  },
87
77
  onSubmit: async ({ value }) => {
88
78
  setError("");
@@ -9,11 +9,9 @@ import { DataTable } from "@/components/ui/data-table";
9
9
  import { ErrorMessage } from "@/components/ui/form";
10
10
  import { AppBrand } from "@/components/ui/app-brand";
11
11
  import { Badge } from "@/components/ui/badge";
12
- import { assetUrl } from "@/lib/assets";
13
- import { authBaseUrl } from "@/services/auth/client";
14
- import { organizationBranding } from "@/services/organizations/branding";
15
- import { AdminApiClient } from "@/lib/admin-api-client";
12
+ import { authClientApi } from "./auth-client-api";
16
13
  import { useKrakstackAuth } from "./auth-provider";
14
+ import { assetUrl, organizationBranding } from "./utils";
17
15
  const defaultMessages = {
18
16
  en: {
19
17
  admin_column_created: "Created",
@@ -35,11 +33,11 @@ const defaultMessages = {
35
33
  const labels = (locale) => ({
36
34
  ...defaultMessages[locale],
37
35
  });
38
- const organizationDisplay = (organization, locale) => {
36
+ const organizationDisplay = (organization, locale, baseUrl) => {
39
37
  const branding = organizationBranding(organization, locale);
40
38
  return {
41
39
  name: branding?.name ?? organization.name,
42
- image: assetUrl(branding?.logo, authBaseUrl),
40
+ image: assetUrl(branding?.logo, baseUrl),
43
41
  };
44
42
  };
45
43
  const organizationsQuery = (search, projectId) => {
@@ -55,9 +53,9 @@ const organizationsQuery = (search, projectId) => {
55
53
  key: JSON.stringify(query),
56
54
  };
57
55
  };
58
- const organizationsAtom = Atom.family(({ projectId, reloadKey, search, }) => {
56
+ const organizationsAtom = Atom.family(({ baseUrl, projectId, reloadKey, search, }) => {
59
57
  const request = organizationsQuery(search, projectId);
60
- return AdminApiClient.query("admin", "listOrganizations", {
58
+ return authClientApi(baseUrl).query("admin", "listOrganizations", {
61
59
  query: request.query,
62
60
  timeToLive: "1 minute",
63
61
  reactivityKeys: [
@@ -71,9 +69,15 @@ export function AdminOrganizationsTable({ from, reloadKey = 0, search, }) {
71
69
  const auth = useKrakstackAuth();
72
70
  const locale = auth?.locale ?? "en";
73
71
  const m = labels(locale);
72
+ const baseUrl = auth?.baseUrl;
74
73
  const projectId = auth?.projectId;
75
74
  const [refreshKey, setRefreshKey] = useState(0);
76
- const result = useAtomValue(organizationsAtom({ projectId, reloadKey: reloadKey + refreshKey, search }));
75
+ const result = useAtomValue(organizationsAtom({
76
+ baseUrl,
77
+ projectId,
78
+ reloadKey: reloadKey + refreshKey,
79
+ search,
80
+ }));
77
81
  const organizations = AsyncResult.match(result, {
78
82
  onInitial: () => [],
79
83
  onFailure: () => [],
@@ -94,14 +98,14 @@ export function AdminOrganizationsTable({ from, reloadKey = 0, search, }) {
94
98
  onFailure: () => false,
95
99
  onSuccess: () => false,
96
100
  });
97
- return (_jsxs("div", { className: "flex flex-col gap-4", children: [error ? _jsx(ErrorMessage, { text: error }) : null, _jsx(DataTable, { columns: organizationColumns(m, locale), data: organizations, exportFileName: "organizations.csv", features: { gallery: false }, ...(from ? { from } : {}), isLoading: isLoading, onRefresh: () => setRefreshKey((current) => current + 1), serverPagination: { rowCount: total } })] }));
101
+ return (_jsxs("div", { className: "flex flex-col gap-4", children: [error ? _jsx(ErrorMessage, { text: error }) : null, _jsx(DataTable, { columns: organizationColumns(m, locale, baseUrl), data: organizations, exportFileName: "organizations.csv", features: { gallery: false }, ...(from ? { from } : {}), isLoading: isLoading, onRefresh: () => setRefreshKey((current) => current + 1), serverPagination: { rowCount: total } })] }));
98
102
  }
99
- const organizationColumns = (m, locale) => [
103
+ const organizationColumns = (m, locale, baseUrl) => [
100
104
  {
101
105
  accessorKey: "name",
102
106
  header: m.admin_column_organization,
103
107
  cell: ({ row }) => {
104
- const display = organizationDisplay(row.original, locale);
108
+ const display = organizationDisplay(row.original, locale, baseUrl);
105
109
  return (_jsx(AppBrand, { to: null, label: display.name, subtitle: row.original.slug, icon: Building2, className: "min-w-56", ...(display.image ? { imageSrc: display.image } : {}) }));
106
110
  },
107
111
  },
@@ -5,4 +5,4 @@ export declare function AdminUsersTable({ from, reloadKey, search, }: {
5
5
  reloadKey?: number;
6
6
  search: TableParams;
7
7
  }): import("react").JSX.Element;
8
- export declare function useAdminUsersTotal(search: TableParams): unknown;
8
+ export declare function useAdminUsersTotal(search: TableParams): number;