@krak-stack/auth 0.1.62 → 0.1.63
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/README.md +16 -0
- package/dist/api.d.ts +366 -366
- package/dist/components/auth-client-api.d.ts +185 -185
- package/dist/components/auth-forms.js +48 -37
- package/dist/components/index.d.ts +1 -1
- package/dist/components/user-button.d.ts +3 -2
- package/dist/components/user-button.js +2 -2
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,188 +1,5 @@
|
|
|
1
1
|
import { AtomHttpApi } from "effect/unstable/reactivity";
|
|
2
|
-
export declare const authClientApi: (baseUrl?: string | undefined) => AtomHttpApi.AtomHttpApiClient<object, `AuthClientApi:${string}`, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"
|
|
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 impersonatedByOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
14
|
-
readonly activeOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
15
|
-
}>;
|
|
16
|
-
readonly user: import("effect/Schema").Struct<{
|
|
17
|
-
readonly id: import("effect/Schema").String;
|
|
18
|
-
readonly name: import("effect/Schema").String;
|
|
19
|
-
readonly email: import("effect/Schema").String;
|
|
20
|
-
readonly emailVerified: import("effect/Schema").Boolean;
|
|
21
|
-
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
22
|
-
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
23
|
-
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
24
|
-
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
25
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
26
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
27
|
-
}>;
|
|
28
|
-
}>>>, 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> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"organizationImpersonateUser", "POST", "/api/auth/organization/impersonate-user", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
29
|
-
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
30
|
-
readonly actorUserId: import("effect/Schema").NonEmptyString;
|
|
31
|
-
readonly targetUserId: import("effect/Schema").NonEmptyString;
|
|
32
|
-
readonly expiresInSeconds: import("effect/Schema").optional<import("effect/Schema").Number>;
|
|
33
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
34
|
-
readonly session: import("effect/Schema").Struct<{
|
|
35
|
-
readonly id: import("effect/Schema").String;
|
|
36
|
-
readonly expiresAt: import("effect/Schema").Date;
|
|
37
|
-
readonly token: import("effect/Schema").String;
|
|
38
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
39
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
40
|
-
readonly ipAddress: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
41
|
-
readonly userAgent: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
42
|
-
readonly userId: import("effect/Schema").String;
|
|
43
|
-
readonly impersonatedBy: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
44
|
-
readonly impersonatedByOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
45
|
-
readonly activeOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
46
|
-
}>;
|
|
47
|
-
readonly user: import("effect/Schema").Struct<{
|
|
48
|
-
readonly id: import("effect/Schema").String;
|
|
49
|
-
readonly name: import("effect/Schema").String;
|
|
50
|
-
readonly email: import("effect/Schema").String;
|
|
51
|
-
readonly emailVerified: import("effect/Schema").Boolean;
|
|
52
|
-
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
53
|
-
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
54
|
-
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
55
|
-
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
56
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
57
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
58
|
-
}>;
|
|
59
|
-
}>>, 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>, 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<{
|
|
60
|
-
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
61
|
-
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
62
|
-
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
63
|
-
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
64
|
-
readonly referrers: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
65
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
66
|
-
readonly id: import("effect/Schema").String;
|
|
67
|
-
readonly key: import("effect/Schema").String;
|
|
68
|
-
}>>, 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 | typeof import("../extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getOrganizationPublicProfile", "GET", "/api/auth/organization-profile", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
69
|
-
readonly organizationId: import("effect/Schema").String;
|
|
70
|
-
readonly locale: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>>;
|
|
71
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
72
|
-
readonly id: import("effect/Schema").String;
|
|
73
|
-
readonly name: import("effect/Schema").String;
|
|
74
|
-
readonly slug: import("effect/Schema").String;
|
|
75
|
-
readonly displayName: import("effect/Schema").String;
|
|
76
|
-
readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
77
|
-
readonly emails: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
78
|
-
readonly email: import("effect/Schema").NonEmptyString;
|
|
79
|
-
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
80
|
-
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
81
|
-
readonly label: import("effect/Schema").NonEmptyString;
|
|
82
|
-
}>>;
|
|
83
|
-
}>>>;
|
|
84
|
-
readonly phones: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
85
|
-
readonly number: import("effect/Schema").NonEmptyString;
|
|
86
|
-
readonly extension: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
87
|
-
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
88
|
-
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
89
|
-
readonly label: import("effect/Schema").NonEmptyString;
|
|
90
|
-
}>>;
|
|
91
|
-
}>>>;
|
|
92
|
-
readonly websites: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
93
|
-
readonly url: import("effect/Schema").NonEmptyString;
|
|
94
|
-
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
95
|
-
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
96
|
-
readonly label: import("effect/Schema").NonEmptyString;
|
|
97
|
-
}>>;
|
|
98
|
-
}>>>;
|
|
99
|
-
readonly socials: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
100
|
-
readonly platform: import("effect/Schema").Literals<readonly ["facebook", "github", "instagram", "linkedin", "tiktok", "x", "youtube"]>;
|
|
101
|
-
readonly url: import("effect/Schema").NonEmptyString;
|
|
102
|
-
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
103
|
-
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
104
|
-
readonly label: import("effect/Schema").NonEmptyString;
|
|
105
|
-
}>>;
|
|
106
|
-
}>>>;
|
|
107
|
-
readonly addresses: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
108
|
-
readonly streetAddress: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
109
|
-
readonly locality: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
110
|
-
readonly region: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
111
|
-
readonly postalCode: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
112
|
-
readonly country: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
113
|
-
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
114
|
-
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
115
|
-
readonly label: import("effect/Schema").NonEmptyString;
|
|
116
|
-
}>>;
|
|
117
|
-
readonly formatted: import("effect/Schema").String;
|
|
118
|
-
}>>>;
|
|
119
|
-
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
120
|
-
readonly icon: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
121
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, 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<{
|
|
122
|
-
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
123
|
-
readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
124
|
-
readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
125
|
-
readonly rootHost: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
126
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
127
|
-
readonly projectKey: import("effect/Schema").String;
|
|
128
|
-
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
129
|
-
readonly logoUrl: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
130
|
-
readonly authDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
131
|
-
readonly rootDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
132
|
-
readonly themeCss: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
133
|
-
readonly authOptions: import("effect/Schema").Struct<{
|
|
134
|
-
readonly emailPassword: import("effect/Schema").Boolean;
|
|
135
|
-
readonly emailOtp: import("effect/Schema").Boolean;
|
|
136
|
-
readonly google: import("effect/Schema").Boolean;
|
|
137
|
-
readonly signUp: import("effect/Schema").Boolean;
|
|
138
|
-
readonly signUpName: import("effect/Schema").Boolean;
|
|
139
|
-
}>;
|
|
140
|
-
}>>, 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<{
|
|
141
|
-
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
142
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
143
|
-
readonly ok: import("effect/Schema").Boolean;
|
|
144
|
-
}>>, 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 | typeof import("../extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateApiKey", "PATCH", "/api/auth/api-key/:keyId", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
145
|
-
readonly keyId: import("effect/Schema").NonEmptyString;
|
|
146
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
147
|
-
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
148
|
-
readonly name: import("effect/Schema").NonEmptyString;
|
|
149
|
-
readonly enabled: import("effect/Schema").Boolean;
|
|
150
|
-
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
151
|
-
readonly referrers: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
152
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
153
|
-
readonly ok: import("effect/Schema").Boolean;
|
|
154
|
-
}>>, 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 | 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<{
|
|
155
|
-
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
156
|
-
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
157
|
-
readonly url: import("effect/Schema").String;
|
|
158
|
-
}>>, 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 | 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<{
|
|
159
|
-
readonly key: import("effect/Schema").NonEmptyString;
|
|
160
|
-
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">]>>;
|
|
161
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
162
|
-
readonly valid: import("effect/Schema").Boolean;
|
|
163
|
-
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
164
|
-
readonly message: import("effect/Schema").String;
|
|
165
|
-
readonly code: import("effect/Schema").String;
|
|
166
|
-
}>>;
|
|
167
|
-
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
168
|
-
readonly id: import("effect/Schema").String;
|
|
169
|
-
readonly configId: import("effect/Schema").String;
|
|
170
|
-
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
171
|
-
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
172
|
-
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
173
|
-
readonly referenceId: import("effect/Schema").String;
|
|
174
|
-
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
175
|
-
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
176
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
177
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
178
|
-
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
179
|
-
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
180
|
-
}>>;
|
|
181
|
-
}>>, 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<{
|
|
182
|
-
readonly password: import("effect/Schema").NonEmptyString;
|
|
183
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
184
|
-
readonly ok: import("effect/Schema").Boolean;
|
|
185
|
-
}>>, 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 | typeof import("../extra/schema").ExtraBadRequest>, never, never>, false> | 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<{
|
|
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<{
|
|
186
3
|
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
187
4
|
readonly rootHostname: import("effect/Schema").NonEmptyString;
|
|
188
5
|
readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
@@ -565,4 +382,187 @@ export declare const authClientApi: (baseUrl?: string | undefined) => AtomHttpAp
|
|
|
565
382
|
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
566
383
|
}>>>;
|
|
567
384
|
readonly createdAt: import("effect/Schema").Date;
|
|
568
|
-
}>>, 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
|
|
385
|
+
}>>, 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<"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<{
|
|
386
|
+
readonly session: import("effect/Schema").Struct<{
|
|
387
|
+
readonly id: import("effect/Schema").String;
|
|
388
|
+
readonly expiresAt: import("effect/Schema").Date;
|
|
389
|
+
readonly token: import("effect/Schema").String;
|
|
390
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
391
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
392
|
+
readonly ipAddress: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
393
|
+
readonly userAgent: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
394
|
+
readonly userId: import("effect/Schema").String;
|
|
395
|
+
readonly impersonatedBy: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
396
|
+
readonly impersonatedByOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
397
|
+
readonly activeOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
398
|
+
}>;
|
|
399
|
+
readonly user: import("effect/Schema").Struct<{
|
|
400
|
+
readonly id: import("effect/Schema").String;
|
|
401
|
+
readonly name: import("effect/Schema").String;
|
|
402
|
+
readonly email: import("effect/Schema").String;
|
|
403
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
404
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
405
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
406
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
407
|
+
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
408
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
409
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
410
|
+
}>;
|
|
411
|
+
}>>>, 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> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"organizationImpersonateUser", "POST", "/api/auth/organization/impersonate-user", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
412
|
+
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
413
|
+
readonly actorUserId: import("effect/Schema").NonEmptyString;
|
|
414
|
+
readonly targetUserId: import("effect/Schema").NonEmptyString;
|
|
415
|
+
readonly expiresInSeconds: import("effect/Schema").optional<import("effect/Schema").Number>;
|
|
416
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
417
|
+
readonly session: import("effect/Schema").Struct<{
|
|
418
|
+
readonly id: import("effect/Schema").String;
|
|
419
|
+
readonly expiresAt: import("effect/Schema").Date;
|
|
420
|
+
readonly token: import("effect/Schema").String;
|
|
421
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
422
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
423
|
+
readonly ipAddress: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
424
|
+
readonly userAgent: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
425
|
+
readonly userId: import("effect/Schema").String;
|
|
426
|
+
readonly impersonatedBy: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
427
|
+
readonly impersonatedByOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
428
|
+
readonly activeOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
429
|
+
}>;
|
|
430
|
+
readonly user: import("effect/Schema").Struct<{
|
|
431
|
+
readonly id: import("effect/Schema").String;
|
|
432
|
+
readonly name: import("effect/Schema").String;
|
|
433
|
+
readonly email: import("effect/Schema").String;
|
|
434
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
435
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
436
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
437
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
438
|
+
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
439
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
440
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
441
|
+
}>;
|
|
442
|
+
}>>, 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>, 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<{
|
|
443
|
+
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
444
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
445
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
446
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
447
|
+
readonly referrers: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
448
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
449
|
+
readonly id: import("effect/Schema").String;
|
|
450
|
+
readonly key: import("effect/Schema").String;
|
|
451
|
+
}>>, 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 | typeof import("../extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getOrganizationPublicProfile", "GET", "/api/auth/organization-profile", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
452
|
+
readonly organizationId: import("effect/Schema").String;
|
|
453
|
+
readonly locale: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>>;
|
|
454
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
455
|
+
readonly id: import("effect/Schema").String;
|
|
456
|
+
readonly name: import("effect/Schema").String;
|
|
457
|
+
readonly slug: import("effect/Schema").String;
|
|
458
|
+
readonly displayName: import("effect/Schema").String;
|
|
459
|
+
readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
460
|
+
readonly emails: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
461
|
+
readonly email: import("effect/Schema").NonEmptyString;
|
|
462
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
463
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
464
|
+
readonly label: import("effect/Schema").NonEmptyString;
|
|
465
|
+
}>>;
|
|
466
|
+
}>>>;
|
|
467
|
+
readonly phones: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
468
|
+
readonly number: import("effect/Schema").NonEmptyString;
|
|
469
|
+
readonly extension: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
470
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
471
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
472
|
+
readonly label: import("effect/Schema").NonEmptyString;
|
|
473
|
+
}>>;
|
|
474
|
+
}>>>;
|
|
475
|
+
readonly websites: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
476
|
+
readonly url: import("effect/Schema").NonEmptyString;
|
|
477
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
478
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
479
|
+
readonly label: import("effect/Schema").NonEmptyString;
|
|
480
|
+
}>>;
|
|
481
|
+
}>>>;
|
|
482
|
+
readonly socials: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
483
|
+
readonly platform: import("effect/Schema").Literals<readonly ["facebook", "github", "instagram", "linkedin", "tiktok", "x", "youtube"]>;
|
|
484
|
+
readonly url: import("effect/Schema").NonEmptyString;
|
|
485
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
486
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
487
|
+
readonly label: import("effect/Schema").NonEmptyString;
|
|
488
|
+
}>>;
|
|
489
|
+
}>>>;
|
|
490
|
+
readonly addresses: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
491
|
+
readonly streetAddress: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
492
|
+
readonly locality: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
493
|
+
readonly region: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
494
|
+
readonly postalCode: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
495
|
+
readonly country: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
496
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
497
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
498
|
+
readonly label: import("effect/Schema").NonEmptyString;
|
|
499
|
+
}>>;
|
|
500
|
+
readonly formatted: import("effect/Schema").String;
|
|
501
|
+
}>>>;
|
|
502
|
+
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
503
|
+
readonly icon: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
504
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, 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<{
|
|
505
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
506
|
+
readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
507
|
+
readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
508
|
+
readonly rootHost: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
509
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
510
|
+
readonly projectKey: import("effect/Schema").String;
|
|
511
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
512
|
+
readonly logoUrl: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
513
|
+
readonly authDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
514
|
+
readonly rootDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
515
|
+
readonly themeCss: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
516
|
+
readonly authOptions: import("effect/Schema").Struct<{
|
|
517
|
+
readonly emailPassword: import("effect/Schema").Boolean;
|
|
518
|
+
readonly emailOtp: import("effect/Schema").Boolean;
|
|
519
|
+
readonly google: import("effect/Schema").Boolean;
|
|
520
|
+
readonly signUp: import("effect/Schema").Boolean;
|
|
521
|
+
readonly signUpName: import("effect/Schema").Boolean;
|
|
522
|
+
}>;
|
|
523
|
+
}>>, 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<{
|
|
524
|
+
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
525
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
526
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
527
|
+
}>>, 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 | typeof import("../extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateApiKey", "PATCH", "/api/auth/api-key/:keyId", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
528
|
+
readonly keyId: import("effect/Schema").NonEmptyString;
|
|
529
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
530
|
+
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
531
|
+
readonly name: import("effect/Schema").NonEmptyString;
|
|
532
|
+
readonly enabled: import("effect/Schema").Boolean;
|
|
533
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
534
|
+
readonly referrers: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").String>>;
|
|
535
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
536
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
537
|
+
}>>, 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 | 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<{
|
|
538
|
+
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
539
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
540
|
+
readonly url: import("effect/Schema").String;
|
|
541
|
+
}>>, 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 | 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<{
|
|
542
|
+
readonly key: import("effect/Schema").NonEmptyString;
|
|
543
|
+
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">]>>;
|
|
544
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
545
|
+
readonly valid: import("effect/Schema").Boolean;
|
|
546
|
+
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
547
|
+
readonly message: import("effect/Schema").String;
|
|
548
|
+
readonly code: import("effect/Schema").String;
|
|
549
|
+
}>>;
|
|
550
|
+
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
551
|
+
readonly id: import("effect/Schema").String;
|
|
552
|
+
readonly configId: import("effect/Schema").String;
|
|
553
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
554
|
+
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
555
|
+
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
556
|
+
readonly referenceId: import("effect/Schema").String;
|
|
557
|
+
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
558
|
+
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
559
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
560
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
561
|
+
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
562
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
563
|
+
}>>;
|
|
564
|
+
}>>, 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<{
|
|
565
|
+
readonly password: import("effect/Schema").NonEmptyString;
|
|
566
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
567
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
568
|
+
}>>, 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 | typeof import("../extra/schema").ExtraBadRequest>, never, never>, false>>;
|
|
@@ -272,23 +272,6 @@ export function Signin(props) {
|
|
|
272
272
|
setOtpSentTo(email);
|
|
273
273
|
setEmailOtpResendAvailableAt(Date.now() + EMAIL_OTP_RESEND_COOLDOWN_SECONDS * 1000);
|
|
274
274
|
};
|
|
275
|
-
if (action.type === "social") {
|
|
276
|
-
const result = await authClient.signIn.social({
|
|
277
|
-
provider: "google",
|
|
278
|
-
callbackURL: socialRedirectTarget,
|
|
279
|
-
errorCallbackURL: "/sign-in",
|
|
280
|
-
...(oauthQuery
|
|
281
|
-
? { additionalData: { query: oauthQuery } }
|
|
282
|
-
: {}),
|
|
283
|
-
...(oauthQuery ? { oauth_query: oauthQuery } : {}),
|
|
284
|
-
});
|
|
285
|
-
if (result.error) {
|
|
286
|
-
throw new Error(result.error.message ?? m.sign_in_error);
|
|
287
|
-
}
|
|
288
|
-
if (result.data?.url)
|
|
289
|
-
onNavigate(result.data.url);
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
275
|
if (action.type === "sendEmailOtp") {
|
|
293
276
|
await sendEmailOtp();
|
|
294
277
|
return;
|
|
@@ -344,6 +327,25 @@ export function Signin(props) {
|
|
|
344
327
|
}));
|
|
345
328
|
const submit = useAtomSet(form.submit);
|
|
346
329
|
const submitResult = useAtomValue(form.submit);
|
|
330
|
+
const [socialSignIn] = useState(() => Atom.fn((provider) => Effect.tryPromise({
|
|
331
|
+
try: async () => {
|
|
332
|
+
const result = await authClient.signIn.social({
|
|
333
|
+
provider,
|
|
334
|
+
callbackURL: socialRedirectTarget,
|
|
335
|
+
errorCallbackURL: "/sign-in",
|
|
336
|
+
...(oauthQuery ? { additionalData: { query: oauthQuery } } : {}),
|
|
337
|
+
...(oauthQuery ? { oauth_query: oauthQuery } : {}),
|
|
338
|
+
});
|
|
339
|
+
if (result.error) {
|
|
340
|
+
throw new Error(result.error.message ?? m.sign_in_error);
|
|
341
|
+
}
|
|
342
|
+
if (result.data?.url)
|
|
343
|
+
onNavigate(result.data.url);
|
|
344
|
+
},
|
|
345
|
+
catch: (cause) => cause instanceof Error ? cause : new Error(m.sign_in_error),
|
|
346
|
+
})));
|
|
347
|
+
const startSocialSignIn = useAtomSet(socialSignIn);
|
|
348
|
+
const socialSignInResult = useAtomValue(socialSignIn);
|
|
347
349
|
const formValues = Option.getOrElse(useAtomValue(form.values), () => ({
|
|
348
350
|
email: "",
|
|
349
351
|
password: "",
|
|
@@ -378,7 +380,7 @@ export function Signin(props) {
|
|
|
378
380
|
setOtp("");
|
|
379
381
|
submit({ type: "sendEmailOtp" });
|
|
380
382
|
};
|
|
381
|
-
const signInWithGoogle = () =>
|
|
383
|
+
const signInWithGoogle = () => startSocialSignIn("google");
|
|
382
384
|
return (_jsxs(Card, { className: "w-full max-w-md", children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-3xl", children: m.auth_sign_in }), _jsx(CardDescription, { children: !emailSubmitted ? (m.sign_in_description) : (_jsxs(_Fragment, { children: [text(m.sign_in_email_as, { email: formValues.email }), " ", _jsx(Button, { type: "button", variant: "link", className: "h-auto px-0", onClick: resetEmailStep, children: m.sign_in_change_email })] })) })] }), _jsxs(CardContent, { children: [hasPrimaryAuth ? (_jsx(form.Initialize, { defaultValues: { email: "", password: "", otp: "" }, children: _jsxs("form", { className: "flex flex-col gap-4", onSubmit: (event) => {
|
|
383
385
|
event.preventDefault();
|
|
384
386
|
event.stopPropagation();
|
|
@@ -388,7 +390,12 @@ export function Signin(props) {
|
|
|
388
390
|
method: selectedAuthMethod,
|
|
389
391
|
otpSent: Boolean(otpSentTo),
|
|
390
392
|
});
|
|
391
|
-
}, children: [!emailSubmitted ? (_jsx(form.email, { label: m.field_email, type: "email", autoComplete: "email",
|
|
393
|
+
}, children: [!emailSubmitted ? (_jsx(form.email, { label: m.field_email, type: "email", autoComplete: "email", onKeyDown: (event) => {
|
|
394
|
+
if (event.key !== "Enter")
|
|
395
|
+
return;
|
|
396
|
+
event.preventDefault();
|
|
397
|
+
event.currentTarget.form?.requestSubmit();
|
|
398
|
+
}, required: true })) : null, emailSubmitted && selectedAuthMethod === "password" ? (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(form.password, { label: m.field_password, type: "password", autoComplete: "current-password", required: true }), _jsxs("div", { className: "flex flex-wrap gap-x-4 gap-y-2 text-sm", children: [_jsx(Link, { className: authLinkClassName, to: "/reset-password", search: searchObject(searchString), children: m.sign_in_forgot_password }), canChangeAuthMethod ? (_jsxs(Button, { type: "button", variant: "link", className: "h-auto px-0", onClick: switchAuthMethod, children: [_jsx(Mail, {}), m.sign_in_use_email_otp] })) : null] })] })) : null, emailSubmitted && selectedAuthMethod === "emailOtp" ? (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(form.otp, { label: m.sign_in_email_otp_code }), _jsxs("div", { className: "flex flex-wrap gap-x-4 gap-y-2 text-sm", children: [otpSentTo ? (_jsx(Button, { type: "button", variant: "link", className: "h-auto px-0", disabled: emailOtpResendSeconds > 0, onClick: resendEmailOtp, children: emailOtpResendSeconds > 0
|
|
392
399
|
? text(m.sign_in_email_otp_resend_countdown, {
|
|
393
400
|
seconds: String(emailOtpResendSeconds),
|
|
394
401
|
})
|
|
@@ -396,7 +403,7 @@ export function Signin(props) {
|
|
|
396
403
|
? m.sign_in_continue
|
|
397
404
|
: selectedAuthMethod === "emailOtp"
|
|
398
405
|
? m.sign_in_email_otp_verify
|
|
399
|
-
: m.auth_sign_in] }) })] }) })) : null, options.google && !emailSubmitted ? (_jsxs("div", { className: "mt-4 flex flex-col gap-3", children: [hasPrimaryAuth ? (_jsx(Divider, { label: m.auth_or_continue_with })) : null, _jsxs(Button, { type: "button", variant: "outline", className: "w-full", disabled: submitResult.waiting, onClick: signInWithGoogle, children: [_jsx(GoogleLogo, {}), m.auth_continue_with_google] })] })) : null, !hasPrimaryAuth && !options.google ? (_jsx("p", { className: "text-muted-foreground text-sm", children: m.oauth_client_no_auth_methods })) : null, options.signUp ? (_jsx("p", { className: "text-muted-foreground mt-6 text-center text-sm", children: _jsxs(Link, { className: authLinkClassName, to: "/sign-up", search: searchObject(searchString), children: [m.sign_in_need_account, " ", m.auth_sign_up] }) })) : null] })] }));
|
|
406
|
+
: m.auth_sign_in] }) })] }) })) : null, options.google && !emailSubmitted ? (_jsxs("div", { className: "mt-4 flex flex-col gap-3", children: [hasPrimaryAuth ? (_jsx(Divider, { label: m.auth_or_continue_with })) : null, _jsxs(Button, { type: "button", variant: "outline", className: "w-full", disabled: submitResult.waiting, onClick: signInWithGoogle, children: [_jsx(GoogleLogo, {}), m.auth_continue_with_google] }), _jsx(SubmitError, { result: socialSignInResult })] })) : null, !hasPrimaryAuth && !options.google ? (_jsx("p", { className: "text-muted-foreground text-sm", children: m.oauth_client_no_auth_methods })) : null, options.signUp ? (_jsx("p", { className: "text-muted-foreground mt-6 text-center text-sm", children: _jsxs(Link, { className: authLinkClassName, to: "/sign-up", search: searchObject(searchString), children: [m.sign_in_need_account, " ", m.auth_sign_up] }) })) : null] })] }));
|
|
400
407
|
}
|
|
401
408
|
export function Signup(props) {
|
|
402
409
|
const { authClient, baseUrl, labels: m, projectConfig: providedProjectConfig, } = useAuthFormOptions(props);
|
|
@@ -420,21 +427,8 @@ export function Signup(props) {
|
|
|
420
427
|
const [form] = useState(() => FormReact.make(signupFormBuilder, {
|
|
421
428
|
fields: { name: TextField, email: TextField, password: TextField },
|
|
422
429
|
mode: { validation: "onSubmit" },
|
|
423
|
-
onSubmit: (
|
|
430
|
+
onSubmit: (_, { decoded: value }) => Effect.tryPromise({
|
|
424
431
|
try: async () => {
|
|
425
|
-
if (action === "social") {
|
|
426
|
-
const result = await authClient.signIn.social({
|
|
427
|
-
provider: "google",
|
|
428
|
-
callbackURL: redirectTarget,
|
|
429
|
-
errorCallbackURL: "/sign-up",
|
|
430
|
-
});
|
|
431
|
-
if (result.error) {
|
|
432
|
-
throw new Error(result.error.message ?? m.sign_up_error);
|
|
433
|
-
}
|
|
434
|
-
if (result.data?.url)
|
|
435
|
-
onNavigate(result.data.url);
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
432
|
if (!options.signUp) {
|
|
439
433
|
throw new Error(m.sign_up_disabled_description);
|
|
440
434
|
}
|
|
@@ -455,15 +449,32 @@ export function Signup(props) {
|
|
|
455
449
|
}));
|
|
456
450
|
const submit = useAtomSet(form.submit);
|
|
457
451
|
const submitResult = useAtomValue(form.submit);
|
|
458
|
-
const
|
|
452
|
+
const [socialSignUp] = useState(() => Atom.fn((provider) => Effect.tryPromise({
|
|
453
|
+
try: async () => {
|
|
454
|
+
const result = await authClient.signIn.social({
|
|
455
|
+
provider,
|
|
456
|
+
callbackURL: redirectTarget,
|
|
457
|
+
errorCallbackURL: "/sign-up",
|
|
458
|
+
});
|
|
459
|
+
if (result.error) {
|
|
460
|
+
throw new Error(result.error.message ?? m.sign_up_error);
|
|
461
|
+
}
|
|
462
|
+
if (result.data?.url)
|
|
463
|
+
onNavigate(result.data.url);
|
|
464
|
+
},
|
|
465
|
+
catch: (cause) => cause instanceof Error ? cause : new Error(m.sign_up_error),
|
|
466
|
+
})));
|
|
467
|
+
const startSocialSignUp = useAtomSet(socialSignUp);
|
|
468
|
+
const socialSignUpResult = useAtomValue(socialSignUp);
|
|
469
|
+
const signUpWithGoogle = () => startSocialSignUp("google");
|
|
459
470
|
if (!options.signUp) {
|
|
460
471
|
return (_jsxs(Card, { className: "w-full max-w-md", children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-3xl", children: m.sign_up_disabled_title }), _jsx(CardDescription, { children: m.sign_up_disabled_description })] }), _jsx(CardContent, { children: _jsx("p", { className: "text-muted-foreground text-center text-sm", children: _jsxs(Link, { className: authLinkClassName, to: "/sign-in", search: searchObject(searchString), children: [m.sign_up_have_account, " ", m.auth_sign_in] }) }) })] }));
|
|
461
472
|
}
|
|
462
473
|
return (_jsxs(Card, { className: "w-full max-w-md", children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "text-3xl", children: m.sign_up_title }), _jsx(CardDescription, { children: m.sign_up_description })] }), _jsxs(CardContent, { children: [_jsx(form.Initialize, { defaultValues: { name: "", email: "", password: "" }, children: _jsxs("form", { className: "flex flex-col gap-4", onSubmit: (event) => {
|
|
463
474
|
event.preventDefault();
|
|
464
475
|
event.stopPropagation();
|
|
465
|
-
submit(
|
|
466
|
-
}, children: [options.signUpName ? (_jsx(form.name, { label: m.field_name, autoComplete: "name", required: true })) : null, _jsx(form.email, { label: m.field_email, type: "email", autoComplete: "email", required: true }), _jsx(form.password, { label: m.field_password, type: "password", autoComplete: "new-password", minLength: 8, required: true }), _jsx(SubmitError, { result: submitResult }), _jsxs(Button, { type: "submit", disabled: submitResult.waiting, children: [submitResult.waiting ? (_jsx(Loader2, { className: "animate-spin", "data-icon": "inline-start" })) : null, effectFormMessages().submit] })] }) }), options.google ? (_jsxs("div", { className: "mt-4 flex flex-col gap-3", children: [_jsx(Divider, { label: m.auth_or_continue_with }), _jsxs(Button, { type: "button", variant: "outline", className: "w-full", disabled: submitResult.waiting, onClick: signUpWithGoogle, children: [_jsx(GoogleLogo, {}), m.auth_continue_with_google] })] })) : null, _jsx("p", { className: "text-muted-foreground mt-6 text-center text-sm", children: _jsxs(Link, { className: authLinkClassName, to: "/sign-in", search: searchObject(searchString), children: [m.sign_up_have_account, " ", m.auth_sign_in] }) })] })] }));
|
|
476
|
+
submit();
|
|
477
|
+
}, children: [options.signUpName ? (_jsx(form.name, { label: m.field_name, autoComplete: "name", required: true })) : null, _jsx(form.email, { label: m.field_email, type: "email", autoComplete: "email", required: true }), _jsx(form.password, { label: m.field_password, type: "password", autoComplete: "new-password", minLength: 8, required: true }), _jsx(SubmitError, { result: submitResult }), _jsxs(Button, { type: "submit", disabled: submitResult.waiting, children: [submitResult.waiting ? (_jsx(Loader2, { className: "animate-spin", "data-icon": "inline-start" })) : null, effectFormMessages().submit] })] }) }), options.google ? (_jsxs("div", { className: "mt-4 flex flex-col gap-3", children: [_jsx(Divider, { label: m.auth_or_continue_with }), _jsxs(Button, { type: "button", variant: "outline", className: "w-full", disabled: submitResult.waiting, onClick: signUpWithGoogle, children: [_jsx(GoogleLogo, {}), m.auth_continue_with_google] }), _jsx(SubmitError, { result: socialSignUpResult })] })) : null, _jsx("p", { className: "text-muted-foreground mt-6 text-center text-sm", children: _jsxs(Link, { className: authLinkClassName, to: "/sign-in", search: searchObject(searchString), children: [m.sign_up_have_account, " ", m.auth_sign_in] }) })] })] }));
|
|
467
478
|
}
|
|
468
479
|
export function VerifyEmail(props) {
|
|
469
480
|
const { authClient, baseUrl, labels: m, projectConfig: providedProjectConfig, } = useAuthFormOptions(props);
|
|
@@ -15,6 +15,6 @@ export type { ApiKeyOwner, ApiKeyActor, Actor, Policy, ProjectAccessConfig, Proj
|
|
|
15
15
|
export type { ProjectAccessMatrixAccess, ProjectAccessMatrixMessages, } from "./project-access-matrix";
|
|
16
16
|
export type { KrakstackAuthContextValue, KrakstackAuthLocale, KrakstackAuthProviderProps, } from "./auth-provider";
|
|
17
17
|
export type { OrganizationSwitcherDialog, OrganizationSwitcherFeatures, OrganizationSwitcherProps, } from "./organization-switcher";
|
|
18
|
-
export type { UserButtonDialog } from "./user-button";
|
|
18
|
+
export type { UserButtonDialog, UserButtonProps } from "./user-button";
|
|
19
19
|
export type { AuthUiClient } from "./auth-client";
|
|
20
20
|
export type { MemberRequiredMessages, MemberRequiredProps, } from "./member-required";
|