@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.
- package/dist/admin/api.group.d.ts +197 -0
- package/dist/admin/api.group.js +159 -0
- package/dist/admin/schema.d.ts +128 -0
- package/dist/admin/schema.js +190 -0
- package/dist/api.d.ts +264 -11
- package/dist/api.js +14 -5
- package/dist/better-auth/{index.d.ts → api.group.d.ts} +6 -8
- package/dist/better-auth/{api.js → api.group.js} +2 -4
- package/dist/components/admin-organization-form.d.ts +3 -3
- package/dist/components/admin-organization-form.js +9 -19
- package/dist/components/admin-organizations.js +16 -12
- package/dist/components/admin-users.d.ts +1 -1
- package/dist/components/admin-users.js +35 -18
- package/dist/components/{auth-api-client.d.ts → auth-client-api.d.ts} +179 -209
- package/dist/components/auth-client-api.js +29 -0
- package/dist/components/auth-forms.js +3 -3
- package/dist/components/auth-provider.js +2 -2
- package/dist/components/organization-switcher.js +15 -16
- package/dist/components/user-button.js +3 -3
- package/dist/components/utils.d.ts +11 -0
- package/dist/components/utils.js +24 -0
- package/dist/extra/api.group.d.ts +68 -0
- package/dist/extra/{api.js → api.group.js} +5 -17
- package/dist/index.d.ts +5 -3
- package/dist/index.js +5 -3
- package/dist/query.d.ts +49 -0
- package/dist/query.js +114 -0
- package/dist/server/{api.d.ts → api.group.d.ts} +0 -196
- package/dist/server/{api.js → api.group.js} +1 -6
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +2 -1
- package/dist/service.d.ts +12 -24
- package/dist/service.js +2 -2
- package/package.json +13 -5
- package/dist/better-auth/api.d.ts +0 -55
- package/dist/better-auth/index.js +0 -12
- package/dist/components/auth-api-client.js +0 -29
- package/dist/extra/api.d.ts +0 -139
- package/dist/extra/index.d.ts +0 -76
- package/dist/extra/index.js +0 -14
|
@@ -1,97 +1,5 @@
|
|
|
1
1
|
import { AtomHttpApi } from "effect/unstable/reactivity";
|
|
2
|
-
export declare const
|
|
3
|
-
readonly session: import("effect/Schema").Struct<{
|
|
4
|
-
readonly id: import("effect/Schema").String;
|
|
5
|
-
readonly expiresAt: import("effect/Schema").Date;
|
|
6
|
-
readonly token: import("effect/Schema").String;
|
|
7
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
8
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
9
|
-
readonly ipAddress: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
10
|
-
readonly userAgent: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
11
|
-
readonly userId: import("effect/Schema").String;
|
|
12
|
-
readonly impersonatedBy: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
13
|
-
readonly activeOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
14
|
-
}>;
|
|
15
|
-
readonly user: import("effect/Schema").Struct<{
|
|
16
|
-
readonly id: import("effect/Schema").String;
|
|
17
|
-
readonly name: import("effect/Schema").String;
|
|
18
|
-
readonly email: import("effect/Schema").String;
|
|
19
|
-
readonly emailVerified: import("effect/Schema").Boolean;
|
|
20
|
-
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
21
|
-
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
22
|
-
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
23
|
-
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
24
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
25
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
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<{
|
|
28
|
-
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
29
|
-
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
30
|
-
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
31
|
-
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
32
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
33
|
-
readonly id: import("effect/Schema").String;
|
|
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<{
|
|
36
|
-
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
37
|
-
readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
38
|
-
readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
39
|
-
readonly rootHost: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
40
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
41
|
-
readonly projectKey: import("effect/Schema").String;
|
|
42
|
-
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
43
|
-
readonly logoUrl: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
44
|
-
readonly authDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
45
|
-
readonly rootDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
46
|
-
readonly themeCss: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
47
|
-
readonly authOptions: import("effect/Schema").Struct<{
|
|
48
|
-
readonly emailPassword: import("effect/Schema").Boolean;
|
|
49
|
-
readonly emailOtp: import("effect/Schema").Boolean;
|
|
50
|
-
readonly google: import("effect/Schema").Boolean;
|
|
51
|
-
readonly signUp: import("effect/Schema").Boolean;
|
|
52
|
-
readonly signUpName: import("effect/Schema").Boolean;
|
|
53
|
-
}>;
|
|
54
|
-
}>>, 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<{
|
|
55
|
-
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
56
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
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<{
|
|
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
|
-
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
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<{
|
|
67
|
-
readonly key: import("effect/Schema").NonEmptyString;
|
|
68
|
-
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
|
-
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
70
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
71
|
-
readonly valid: import("effect/Schema").Boolean;
|
|
72
|
-
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
73
|
-
readonly message: import("effect/Schema").String;
|
|
74
|
-
readonly code: import("effect/Schema").String;
|
|
75
|
-
}>>;
|
|
76
|
-
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
77
|
-
readonly id: import("effect/Schema").String;
|
|
78
|
-
readonly configId: import("effect/Schema").String;
|
|
79
|
-
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
80
|
-
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
81
|
-
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
82
|
-
readonly referenceId: import("effect/Schema").String;
|
|
83
|
-
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
84
|
-
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
85
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
86
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
87
|
-
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
88
|
-
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
89
|
-
}>>;
|
|
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<{
|
|
91
|
-
readonly password: import("effect/Schema").NonEmptyString;
|
|
92
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
93
|
-
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<{
|
|
2
|
+
export declare const authClientApi: (baseUrl?: string | undefined) => AtomHttpApi.AtomHttpApiClient<object, `AuthClientApi:${string}`, 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<{
|
|
95
3
|
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
96
4
|
readonly rootHostname: import("effect/Schema").NonEmptyString;
|
|
97
5
|
readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
@@ -112,7 +20,42 @@ export declare const authApiClient: (baseUrl?: string | undefined) => AtomHttpAp
|
|
|
112
20
|
readonly active: import("effect/Schema").Boolean;
|
|
113
21
|
readonly createdAt: import("effect/Schema").Date;
|
|
114
22
|
readonly updatedAt: import("effect/Schema").Date;
|
|
115
|
-
}>>, 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").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"
|
|
23
|
+
}>>, 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<{
|
|
24
|
+
readonly name: import("effect/Schema").NonEmptyString;
|
|
25
|
+
readonly slug: import("effect/Schema").NonEmptyString;
|
|
26
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
27
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
28
|
+
readonly id: import("effect/Schema").String;
|
|
29
|
+
readonly name: import("effect/Schema").String;
|
|
30
|
+
readonly slug: import("effect/Schema").String;
|
|
31
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
32
|
+
readonly metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
33
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
34
|
+
}>>, 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<{
|
|
35
|
+
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">]>>;
|
|
36
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
37
|
+
readonly totalUsers: import("effect/Schema").Number;
|
|
38
|
+
readonly totalOrganizations: import("effect/Schema").Number;
|
|
39
|
+
readonly totalProjects: import("effect/Schema").Number;
|
|
40
|
+
readonly totalDomains: import("effect/Schema").Number;
|
|
41
|
+
readonly totalApiKeys: import("effect/Schema").Number;
|
|
42
|
+
readonly totalOauthClients: import("effect/Schema").Number;
|
|
43
|
+
readonly dailyActiveUsers: import("effect/Schema").Number;
|
|
44
|
+
readonly dailyActiveUsersByDay: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
45
|
+
readonly date: import("effect/Schema").String;
|
|
46
|
+
readonly count: import("effect/Schema").Number;
|
|
47
|
+
}>>;
|
|
48
|
+
readonly signupsByDay: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
49
|
+
readonly date: import("effect/Schema").String;
|
|
50
|
+
readonly count: import("effect/Schema").Number;
|
|
51
|
+
}>>;
|
|
52
|
+
readonly projectConnections: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
53
|
+
readonly projectId: import("effect/Schema").String;
|
|
54
|
+
readonly projectName: import("effect/Schema").String;
|
|
55
|
+
readonly users: import("effect/Schema").Number;
|
|
56
|
+
readonly organizations: import("effect/Schema").Number;
|
|
57
|
+
}>>;
|
|
58
|
+
}>>, 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<{
|
|
116
59
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
117
60
|
}>>, 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<{
|
|
118
61
|
readonly id: import("effect/Schema").String;
|
|
@@ -129,9 +72,24 @@ export declare const authApiClient: (baseUrl?: string | undefined) => AtomHttpAp
|
|
|
129
72
|
readonly active: import("effect/Schema").Boolean;
|
|
130
73
|
readonly createdAt: import("effect/Schema").Date;
|
|
131
74
|
readonly updatedAt: import("effect/Schema").Date;
|
|
132
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"
|
|
75
|
+
}>>, 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<{
|
|
76
|
+
readonly id: import("effect/Schema").String;
|
|
77
|
+
}>>, 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<{
|
|
78
|
+
readonly id: import("effect/Schema").String;
|
|
79
|
+
readonly name: import("effect/Schema").String;
|
|
80
|
+
readonly slug: import("effect/Schema").String;
|
|
81
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
82
|
+
readonly metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
83
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
84
|
+
}>>, 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<{
|
|
133
85
|
readonly id: import("effect/Schema").NonEmptyString;
|
|
134
|
-
}>>, 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").Struct<{
|
|
86
|
+
}>>, 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<{
|
|
87
|
+
readonly required: import("effect/Schema").Boolean;
|
|
88
|
+
readonly status: import("effect/Schema").String;
|
|
89
|
+
readonly type: import("effect/Schema").String;
|
|
90
|
+
readonly name: import("effect/Schema").String;
|
|
91
|
+
readonly value: import("effect/Schema").String;
|
|
92
|
+
}>>>, 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<{
|
|
135
93
|
readonly id: import("effect/Schema").String;
|
|
136
94
|
readonly hostname: import("effect/Schema").String;
|
|
137
95
|
readonly rootHostname: import("effect/Schema").String;
|
|
@@ -146,9 +104,67 @@ export declare const authApiClient: (baseUrl?: string | undefined) => AtomHttpAp
|
|
|
146
104
|
readonly active: import("effect/Schema").Boolean;
|
|
147
105
|
readonly createdAt: import("effect/Schema").Date;
|
|
148
106
|
readonly updatedAt: import("effect/Schema").Date;
|
|
149
|
-
}
|
|
107
|
+
}>>>, 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<{
|
|
108
|
+
readonly page: import("effect/Schema").Int;
|
|
109
|
+
readonly pageSize: import("effect/Schema").Int;
|
|
110
|
+
readonly globalFilter: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
111
|
+
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<{
|
|
112
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
113
|
+
readonly direction: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"asc">, import("effect/Schema").Literal<"desc">]>;
|
|
114
|
+
}>>, import("effect/Schema").String, never, never>, never, never>>;
|
|
115
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
116
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
117
|
+
readonly data: import("effect/Schema").$Array<import("effect/Schema").Schema<{
|
|
118
|
+
readonly id: string;
|
|
119
|
+
readonly name: string;
|
|
120
|
+
readonly slug: string;
|
|
121
|
+
readonly logo?: string | null | undefined;
|
|
122
|
+
readonly metadata?: string | null | undefined;
|
|
123
|
+
readonly createdAt: Date;
|
|
124
|
+
}>>;
|
|
125
|
+
readonly meta: import("effect/Schema").Struct<{
|
|
126
|
+
readonly page: import("effect/Schema").Int;
|
|
127
|
+
readonly pageSize: import("effect/Schema").Int;
|
|
128
|
+
readonly total: import("effect/Schema").Int;
|
|
129
|
+
readonly pageCount: import("effect/Schema").Int;
|
|
130
|
+
}>;
|
|
131
|
+
}>>, 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<{
|
|
132
|
+
readonly page: import("effect/Schema").Int;
|
|
133
|
+
readonly pageSize: import("effect/Schema").Int;
|
|
134
|
+
readonly globalFilter: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
135
|
+
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<{
|
|
136
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
137
|
+
readonly direction: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"asc">, import("effect/Schema").Literal<"desc">]>;
|
|
138
|
+
}>>, import("effect/Schema").String, never, never>, never, never>>;
|
|
139
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
140
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
141
|
+
readonly data: import("effect/Schema").$Array<import("effect/Schema").Schema<import("effect/Schema").Struct.ReadonlySide<{
|
|
142
|
+
readonly id: import("effect/Schema").String;
|
|
143
|
+
readonly name: import("effect/Schema").String;
|
|
144
|
+
readonly email: import("effect/Schema").String;
|
|
145
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
146
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
147
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
148
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
149
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
150
|
+
readonly banReason: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
151
|
+
readonly banExpires: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
152
|
+
}, "Type">>>;
|
|
153
|
+
readonly meta: import("effect/Schema").Struct<{
|
|
154
|
+
readonly page: import("effect/Schema").Int;
|
|
155
|
+
readonly pageSize: import("effect/Schema").Int;
|
|
156
|
+
readonly total: import("effect/Schema").Int;
|
|
157
|
+
readonly pageCount: import("effect/Schema").Int;
|
|
158
|
+
}>;
|
|
159
|
+
}>>, 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<{
|
|
160
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
161
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
150
162
|
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
151
|
-
|
|
163
|
+
readonly rootHostname: import("effect/Schema").NonEmptyString;
|
|
164
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
165
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
166
|
+
readonly managed: import("effect/Schema").Boolean;
|
|
167
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
152
168
|
readonly id: import("effect/Schema").String;
|
|
153
169
|
readonly hostname: import("effect/Schema").String;
|
|
154
170
|
readonly rootHostname: import("effect/Schema").String;
|
|
@@ -163,126 +179,80 @@ export declare const authApiClient: (baseUrl?: string | undefined) => AtomHttpAp
|
|
|
163
179
|
readonly active: import("effect/Schema").Boolean;
|
|
164
180
|
readonly createdAt: import("effect/Schema").Date;
|
|
165
181
|
readonly updatedAt: import("effect/Schema").Date;
|
|
166
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"
|
|
167
|
-
readonly id: import("effect/Schema").NonEmptyString;
|
|
168
|
-
}>>, 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<{
|
|
169
|
-
readonly required: import("effect/Schema").Boolean;
|
|
170
|
-
readonly status: import("effect/Schema").String;
|
|
171
|
-
readonly type: import("effect/Schema").String;
|
|
172
|
-
readonly name: import("effect/Schema").String;
|
|
173
|
-
readonly value: import("effect/Schema").String;
|
|
174
|
-
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"organizations", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getActiveMember", "GET", "/api/organizations/:organizationId/members/:userId", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
175
|
-
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
176
|
-
readonly userId: import("effect/Schema").NonEmptyString;
|
|
177
|
-
}>>, 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").Struct<{
|
|
182
|
+
}>>, 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<{
|
|
178
183
|
readonly id: import("effect/Schema").String;
|
|
179
|
-
|
|
180
|
-
readonly
|
|
181
|
-
readonly
|
|
182
|
-
readonly
|
|
183
|
-
|
|
184
|
-
readonly id: import("effect/Schema").String;
|
|
185
|
-
readonly name: import("effect/Schema").String;
|
|
186
|
-
readonly email: import("effect/Schema").String;
|
|
187
|
-
readonly emailVerified: import("effect/Schema").Boolean;
|
|
188
|
-
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
189
|
-
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
190
|
-
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
191
|
-
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
192
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
193
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
194
|
-
}>;
|
|
195
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getOrganization", "GET", "/api/organizations/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
196
|
-
readonly id: import("effect/Schema").NonEmptyString;
|
|
197
|
-
}>>, 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").Struct<{
|
|
184
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
185
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
186
|
+
readonly slug: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
187
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
188
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
198
189
|
readonly id: import("effect/Schema").String;
|
|
199
190
|
readonly name: import("effect/Schema").String;
|
|
200
191
|
readonly slug: import("effect/Schema").String;
|
|
201
|
-
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String
|
|
202
|
-
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").
|
|
203
|
-
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
204
|
-
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
205
|
-
readonly name: import("effect/Schema").String;
|
|
206
|
-
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
207
|
-
readonly icon: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
208
|
-
readonly contactEmail: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
209
|
-
readonly location: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
210
|
-
}>>;
|
|
211
|
-
}>>;
|
|
192
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
193
|
+
readonly metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
212
194
|
readonly createdAt: import("effect/Schema").Date;
|
|
213
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"
|
|
214
|
-
readonly
|
|
215
|
-
|
|
195
|
+
}>>, 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<{
|
|
196
|
+
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
197
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
198
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
199
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
200
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
216
201
|
readonly id: import("effect/Schema").String;
|
|
217
|
-
readonly
|
|
218
|
-
|
|
219
|
-
readonly
|
|
220
|
-
readonly
|
|
221
|
-
readonly
|
|
222
|
-
|
|
223
|
-
readonly name: import("effect/Schema").String;
|
|
224
|
-
readonly email: import("effect/Schema").String;
|
|
225
|
-
readonly emailVerified: import("effect/Schema").Boolean;
|
|
226
|
-
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
227
|
-
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
228
|
-
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
229
|
-
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
230
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
231
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
232
|
-
}>;
|
|
233
|
-
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listOrganizations", "GET", "/api/organizations", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
234
|
-
readonly ids: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
235
|
-
readonly userId: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
202
|
+
readonly key: import("effect/Schema").String;
|
|
203
|
+
}>>, 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<{
|
|
204
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
205
|
+
readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
206
|
+
readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
207
|
+
readonly rootHost: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
236
208
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
237
|
-
readonly
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
209
|
+
readonly projectKey: import("effect/Schema").String;
|
|
210
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
211
|
+
readonly logoUrl: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
212
|
+
readonly authDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
213
|
+
readonly rootDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
214
|
+
readonly themeCss: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
215
|
+
readonly authOptions: import("effect/Schema").Struct<{
|
|
216
|
+
readonly emailPassword: import("effect/Schema").Boolean;
|
|
217
|
+
readonly emailOtp: import("effect/Schema").Boolean;
|
|
218
|
+
readonly google: import("effect/Schema").Boolean;
|
|
219
|
+
readonly signUp: import("effect/Schema").Boolean;
|
|
220
|
+
readonly signUpName: import("effect/Schema").Boolean;
|
|
221
|
+
}>;
|
|
222
|
+
}>>, 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<{
|
|
223
|
+
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
224
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
225
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
226
|
+
}>>, 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<{
|
|
227
|
+
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
228
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
229
|
+
readonly url: import("effect/Schema").String;
|
|
230
|
+
}>>, 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<{
|
|
231
|
+
readonly key: import("effect/Schema").NonEmptyString;
|
|
232
|
+
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">]>>;
|
|
233
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
234
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
235
|
+
readonly valid: import("effect/Schema").Boolean;
|
|
236
|
+
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
237
|
+
readonly message: import("effect/Schema").String;
|
|
238
|
+
readonly code: import("effect/Schema").String;
|
|
253
239
|
}>>;
|
|
254
|
-
readonly
|
|
255
|
-
}>>, 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").InternalServerError>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"users", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getUser", "GET", "/api/users/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
256
|
-
readonly id: import("effect/Schema").NonEmptyString;
|
|
257
|
-
}>>, 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").Struct<{
|
|
258
|
-
readonly id: import("effect/Schema").String;
|
|
259
|
-
readonly name: import("effect/Schema").String;
|
|
260
|
-
readonly email: import("effect/Schema").String;
|
|
261
|
-
readonly emailVerified: import("effect/Schema").Boolean;
|
|
262
|
-
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
263
|
-
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
264
|
-
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
265
|
-
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
266
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
267
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
268
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getUserActiveOrganization", "GET", "/api/organizations/user/:userId/active", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
269
|
-
readonly userId: import("effect/Schema").NonEmptyString;
|
|
270
|
-
}>>, 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").Struct<{
|
|
271
|
-
readonly id: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
272
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listUsersByIds", "GET", "/api/users", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
273
|
-
readonly ids: import("effect/Schema").NonEmptyString;
|
|
274
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
275
|
-
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
240
|
+
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
276
241
|
readonly id: import("effect/Schema").String;
|
|
277
|
-
readonly
|
|
278
|
-
readonly
|
|
279
|
-
readonly
|
|
280
|
-
readonly
|
|
281
|
-
readonly
|
|
282
|
-
readonly
|
|
283
|
-
readonly
|
|
242
|
+
readonly configId: import("effect/Schema").String;
|
|
243
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
244
|
+
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
245
|
+
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
246
|
+
readonly referenceId: import("effect/Schema").String;
|
|
247
|
+
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
248
|
+
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
284
249
|
readonly createdAt: import("effect/Schema").Date;
|
|
285
250
|
readonly updatedAt: import("effect/Schema").Date;
|
|
251
|
+
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
252
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
286
253
|
}>>;
|
|
287
|
-
|
|
288
|
-
|
|
254
|
+
}>>, 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<{
|
|
255
|
+
readonly password: import("effect/Schema").NonEmptyString;
|
|
256
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
257
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
258
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../extra/schema").ExtraBadRequest>, never, never>, false>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
|
+
import { FetchHttpClient, HttpClient } from "effect/unstable/http";
|
|
3
|
+
import { AtomHttpApi } from "effect/unstable/reactivity";
|
|
4
|
+
import { AuthClientApi } from "../api";
|
|
5
|
+
import { defaultBaseUrl } from "../config";
|
|
6
|
+
const fetchHttpClientLayer = FetchHttpClient.layer;
|
|
7
|
+
const authClientApiUrl = (baseUrl) => {
|
|
8
|
+
const url = baseUrl?.trim() ||
|
|
9
|
+
(typeof window === "undefined" ? defaultBaseUrl() : window.location.origin);
|
|
10
|
+
return url.replace(/\/$/, "");
|
|
11
|
+
};
|
|
12
|
+
const createAuthClientApiClient = (key) => AtomHttpApi.Service()(`AuthClientApi:${key}`, {
|
|
13
|
+
api: AuthClientApi,
|
|
14
|
+
baseUrl: key,
|
|
15
|
+
httpClient: fetchHttpClientLayer,
|
|
16
|
+
transformClient: (client) => HttpClient.makeWith((request) => client.postprocess(request).pipe(Effect.provideService(FetchHttpClient.RequestInit, {
|
|
17
|
+
credentials: "include",
|
|
18
|
+
})), client.preprocess),
|
|
19
|
+
});
|
|
20
|
+
const authClientApis = new Map();
|
|
21
|
+
export const authClientApi = (baseUrl) => {
|
|
22
|
+
const key = authClientApiUrl(baseUrl);
|
|
23
|
+
const existing = authClientApis.get(key);
|
|
24
|
+
if (existing)
|
|
25
|
+
return existing;
|
|
26
|
+
const client = createAuthClientApiClient(key);
|
|
27
|
+
authClientApis.set(key, client);
|
|
28
|
+
return client;
|
|
29
|
+
};
|
|
@@ -11,9 +11,9 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/co
|
|
|
11
11
|
import { Field, FieldLabel } from "@/components/ui/field";
|
|
12
12
|
import { FieldError, useAppForm } from "@/components/ui/form";
|
|
13
13
|
import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, } from "@/components/ui/input-otp";
|
|
14
|
-
import {
|
|
15
|
-
import { authApiClient } from "./auth-api-client";
|
|
14
|
+
import { authClientApi } from "./auth-client-api";
|
|
16
15
|
import { useKrakstackAuth } from "./auth-provider";
|
|
16
|
+
import { cn } from "./utils";
|
|
17
17
|
const EMAIL_OTP_RESEND_COOLDOWN_SECONDS = 60;
|
|
18
18
|
const defaultMessages = {
|
|
19
19
|
en: {
|
|
@@ -140,7 +140,7 @@ const useAuthProjectConfig = (baseUrl, searchString, projectConfig) => {
|
|
|
140
140
|
const clientId = getSearchParam(searchString, "client_id");
|
|
141
141
|
const host = getBrowserAuthHost();
|
|
142
142
|
const atom = projectConfig === undefined
|
|
143
|
-
?
|
|
143
|
+
? authClientApi(baseUrl).query("authExtra", "getProjectPublicConfig", {
|
|
144
144
|
query: {
|
|
145
145
|
...(projectId ? { projectId } : {}),
|
|
146
146
|
...(clientId ? { clientId } : {}),
|
|
@@ -5,7 +5,7 @@ import { useRouterState } from "@tanstack/react-router";
|
|
|
5
5
|
import { adminClient, emailOTPClient, genericOAuthClient, lastLoginMethodClient, organizationClient, twoFactorClient, } from "better-auth/client/plugins";
|
|
6
6
|
import { createAuthClient } from "better-auth/react";
|
|
7
7
|
import { createContext, useContext, useEffect, useMemo, } from "react";
|
|
8
|
-
import {
|
|
8
|
+
import { authClientApi } from "./auth-client-api";
|
|
9
9
|
const KrakstackAuthContext = createContext(null);
|
|
10
10
|
const PROJECT_CONTEXT_COOKIE = "krakstack-auth.project_context";
|
|
11
11
|
const setProjectContextCookie = (projectId) => {
|
|
@@ -62,7 +62,7 @@ const useProjectConfig = (baseUrl, providedProjectId) => {
|
|
|
62
62
|
const clientId = getSearchParam(searchString, "client_id");
|
|
63
63
|
const host = getBrowserAuthHost();
|
|
64
64
|
const rootHost = getRedirectHost(searchString);
|
|
65
|
-
const result = useAtomSuspense(
|
|
65
|
+
const result = useAtomSuspense(authClientApi(baseUrl).query("authExtra", "getProjectPublicConfig", {
|
|
66
66
|
query: {
|
|
67
67
|
...(projectId ? { projectId } : {}),
|
|
68
68
|
...(clientId ? { clientId } : {}),
|