@krak-stack/auth 0.1.42 → 0.1.43
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/api.d.ts +223 -223
- package/dist/components/auth-client.d.ts +50 -4
- package/dist/components/auth-client.js +15 -1
- package/dist/components/auth-provider.d.ts +2 -1
- package/dist/components/auth-provider.js +8 -15
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +3 -1
- package/dist/components/organization-switcher.d.ts +2 -2
- package/dist/components/organization-switcher.js +4 -1
- package/dist/components/user-button.d.ts +2 -2
- package/dist/components/user-button.js +6 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -4
package/dist/api.d.ts
CHANGED
|
@@ -24,70 +24,121 @@ export declare const AuthServiceApi: HttpApi.HttpApi<"AuthServiceApi", import("e
|
|
|
24
24
|
readonly createdAt: import("effect/Schema").Date;
|
|
25
25
|
readonly updatedAt: import("effect/Schema").Date;
|
|
26
26
|
}>;
|
|
27
|
-
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("./better-auth/schema").TooManyRequests>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"
|
|
28
|
-
readonly
|
|
29
|
-
|
|
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<{
|
|
27
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("./better-auth/schema").TooManyRequests>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"users", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getUser", "GET", "/api/users/:id", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
28
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
29
|
+
}>>, 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<{
|
|
33
30
|
readonly id: import("effect/Schema").String;
|
|
34
|
-
readonly
|
|
35
|
-
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
38
|
-
readonly
|
|
39
|
-
readonly
|
|
31
|
+
readonly name: import("effect/Schema").String;
|
|
32
|
+
readonly email: import("effect/Schema").String;
|
|
33
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
34
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
35
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
36
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
37
|
+
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
38
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
39
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
40
|
+
}>>, 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<{
|
|
41
|
+
readonly userId: import("effect/Schema").NonEmptyString;
|
|
42
|
+
}>>, 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<{
|
|
43
|
+
readonly id: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
44
|
+
}>>, 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<{
|
|
45
|
+
readonly ids: import("effect/Schema").NonEmptyString;
|
|
40
46
|
}>>, 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
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
readonly
|
|
49
|
-
readonly
|
|
50
|
-
readonly
|
|
51
|
-
readonly
|
|
52
|
-
|
|
47
|
+
readonly data: import("effect/Schema").$Array<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
|
+
readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
60
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | 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<{
|
|
61
|
+
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
62
|
+
readonly userId: import("effect/Schema").NonEmptyString;
|
|
63
|
+
}>>, 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<{
|
|
64
|
+
readonly id: import("effect/Schema").String;
|
|
65
|
+
readonly organizationId: import("effect/Schema").String;
|
|
66
|
+
readonly userId: import("effect/Schema").String;
|
|
67
|
+
readonly role: import("effect/Schema").String;
|
|
68
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
69
|
+
readonly user: import("effect/Schema").Struct<{
|
|
70
|
+
readonly id: import("effect/Schema").String;
|
|
71
|
+
readonly name: import("effect/Schema").String;
|
|
72
|
+
readonly email: import("effect/Schema").String;
|
|
73
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
74
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
75
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
76
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
77
|
+
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
78
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
79
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
53
80
|
}>;
|
|
54
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").
|
|
55
|
-
readonly
|
|
56
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
57
|
-
readonly
|
|
58
|
-
|
|
59
|
-
readonly
|
|
60
|
-
|
|
61
|
-
readonly
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
readonly code: import("effect/Schema").String;
|
|
81
|
+
}>>, 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<{
|
|
82
|
+
readonly id: import("effect/Schema").NonEmptyString;
|
|
83
|
+
}>>, 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<{
|
|
84
|
+
readonly id: import("effect/Schema").String;
|
|
85
|
+
readonly name: import("effect/Schema").String;
|
|
86
|
+
readonly slug: import("effect/Schema").String;
|
|
87
|
+
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
88
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
89
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
90
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
91
|
+
readonly name: import("effect/Schema").String;
|
|
92
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
93
|
+
readonly icon: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
94
|
+
readonly contactEmail: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
95
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
96
|
+
}>>;
|
|
71
97
|
}>>;
|
|
72
|
-
readonly
|
|
98
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
99
|
+
}>>, 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<"listOrganizationMembers", "GET", "/api/organizations/:organizationId/members", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
100
|
+
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
101
|
+
}>>, 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<{
|
|
102
|
+
readonly id: import("effect/Schema").String;
|
|
103
|
+
readonly organizationId: import("effect/Schema").String;
|
|
104
|
+
readonly userId: import("effect/Schema").String;
|
|
105
|
+
readonly role: import("effect/Schema").String;
|
|
106
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
107
|
+
readonly user: import("effect/Schema").Struct<{
|
|
73
108
|
readonly id: import("effect/Schema").String;
|
|
74
|
-
readonly
|
|
75
|
-
readonly
|
|
76
|
-
readonly
|
|
77
|
-
readonly
|
|
78
|
-
readonly
|
|
79
|
-
readonly
|
|
80
|
-
readonly
|
|
109
|
+
readonly name: import("effect/Schema").String;
|
|
110
|
+
readonly email: import("effect/Schema").String;
|
|
111
|
+
readonly emailVerified: import("effect/Schema").Boolean;
|
|
112
|
+
readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
113
|
+
readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
114
|
+
readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
115
|
+
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
81
116
|
readonly createdAt: import("effect/Schema").Date;
|
|
82
117
|
readonly updatedAt: import("effect/Schema").Date;
|
|
83
|
-
|
|
84
|
-
|
|
118
|
+
}>;
|
|
119
|
+
}>>>, 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<{
|
|
120
|
+
readonly ids: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
121
|
+
readonly userId: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
122
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
123
|
+
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
124
|
+
readonly id: import("effect/Schema").String;
|
|
125
|
+
readonly name: import("effect/Schema").String;
|
|
126
|
+
readonly slug: import("effect/Schema").String;
|
|
127
|
+
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
128
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
129
|
+
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
130
|
+
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
131
|
+
readonly name: import("effect/Schema").String;
|
|
132
|
+
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
133
|
+
readonly icon: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
134
|
+
readonly contactEmail: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
135
|
+
readonly location: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
136
|
+
}>>;
|
|
137
|
+
}>>;
|
|
138
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
85
139
|
}>>;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
89
|
-
readonly ok: import("effect/Schema").Boolean;
|
|
90
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never>, false> | import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"domains", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"createDomain", "POST", "/api/domains", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
140
|
+
readonly missingIds: import("effect/Schema").$Array<import("effect/Schema").String>;
|
|
141
|
+
}>>, 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<"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<{
|
|
91
142
|
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
92
143
|
readonly rootHostname: import("effect/Schema").NonEmptyString;
|
|
93
144
|
readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
@@ -167,122 +218,134 @@ export declare const AuthServiceApi: HttpApi.HttpApi<"AuthServiceApi", import("e
|
|
|
167
218
|
readonly type: import("effect/Schema").String;
|
|
168
219
|
readonly name: import("effect/Schema").String;
|
|
169
220
|
readonly value: import("effect/Schema").String;
|
|
170
|
-
}>>>, 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<"
|
|
171
|
-
readonly
|
|
172
|
-
readonly
|
|
173
|
-
|
|
221
|
+
}>>>, 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<"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<{
|
|
222
|
+
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
223
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
224
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
225
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
226
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
174
227
|
readonly id: import("effect/Schema").String;
|
|
175
|
-
readonly
|
|
176
|
-
|
|
177
|
-
readonly
|
|
178
|
-
readonly
|
|
179
|
-
readonly
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
readonly
|
|
228
|
+
readonly key: import("effect/Schema").String;
|
|
229
|
+
}>>, 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<{
|
|
230
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
231
|
+
readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
232
|
+
readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
233
|
+
readonly rootHost: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
234
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
235
|
+
readonly projectKey: import("effect/Schema").String;
|
|
236
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
237
|
+
readonly logoUrl: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
238
|
+
readonly authDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
239
|
+
readonly rootDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
240
|
+
readonly themeCss: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
241
|
+
readonly authOptions: import("effect/Schema").Struct<{
|
|
242
|
+
readonly emailPassword: import("effect/Schema").Boolean;
|
|
243
|
+
readonly emailOtp: import("effect/Schema").Boolean;
|
|
244
|
+
readonly google: import("effect/Schema").Boolean;
|
|
245
|
+
readonly signUp: import("effect/Schema").Boolean;
|
|
246
|
+
readonly signUpName: import("effect/Schema").Boolean;
|
|
190
247
|
}>;
|
|
191
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").
|
|
192
|
-
readonly
|
|
193
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").
|
|
194
|
-
readonly
|
|
195
|
-
|
|
196
|
-
readonly
|
|
197
|
-
|
|
198
|
-
readonly
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
248
|
+
}>>, 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<{
|
|
249
|
+
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
250
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
251
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
252
|
+
}>>, 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<{
|
|
253
|
+
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
254
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
255
|
+
readonly url: import("effect/Schema").String;
|
|
256
|
+
}>>, 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<{
|
|
257
|
+
readonly key: import("effect/Schema").NonEmptyString;
|
|
258
|
+
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">]>>;
|
|
259
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
260
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
261
|
+
readonly valid: import("effect/Schema").Boolean;
|
|
262
|
+
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
263
|
+
readonly message: import("effect/Schema").String;
|
|
264
|
+
readonly code: import("effect/Schema").String;
|
|
207
265
|
}>>;
|
|
208
|
-
readonly
|
|
209
|
-
}>>, 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<"listOrganizationMembers", "GET", "/api/organizations/:organizationId/members", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
210
|
-
readonly organizationId: import("effect/Schema").NonEmptyString;
|
|
211
|
-
}>>, 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<{
|
|
212
|
-
readonly id: import("effect/Schema").String;
|
|
213
|
-
readonly organizationId: import("effect/Schema").String;
|
|
214
|
-
readonly userId: import("effect/Schema").String;
|
|
215
|
-
readonly role: import("effect/Schema").String;
|
|
216
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
217
|
-
readonly user: import("effect/Schema").Struct<{
|
|
266
|
+
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
218
267
|
readonly id: import("effect/Schema").String;
|
|
219
|
-
readonly
|
|
220
|
-
readonly
|
|
221
|
-
readonly
|
|
222
|
-
readonly
|
|
223
|
-
readonly
|
|
224
|
-
readonly
|
|
225
|
-
readonly
|
|
268
|
+
readonly configId: import("effect/Schema").String;
|
|
269
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
270
|
+
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
271
|
+
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
272
|
+
readonly referenceId: import("effect/Schema").String;
|
|
273
|
+
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
274
|
+
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
226
275
|
readonly createdAt: import("effect/Schema").Date;
|
|
227
276
|
readonly updatedAt: import("effect/Schema").Date;
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
readonly ids: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
231
|
-
readonly userId: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
232
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
233
|
-
readonly data: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
234
|
-
readonly id: import("effect/Schema").String;
|
|
235
|
-
readonly name: import("effect/Schema").String;
|
|
236
|
-
readonly slug: import("effect/Schema").String;
|
|
237
|
-
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
238
|
-
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
239
|
-
readonly translations: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
240
|
-
readonly locale: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"en">, import("effect/Schema").Literal<"fr">]>;
|
|
241
|
-
readonly name: import("effect/Schema").String;
|
|
242
|
-
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
243
|
-
readonly icon: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
244
|
-
readonly contactEmail: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
245
|
-
readonly location: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
246
|
-
}>>;
|
|
247
|
-
}>>;
|
|
248
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
277
|
+
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
278
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
249
279
|
}>>;
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
280
|
+
}>>, 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<{
|
|
281
|
+
readonly password: import("effect/Schema").NonEmptyString;
|
|
282
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
283
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
284
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never>, false>>;
|
|
285
|
+
export declare const AuthClientApi: HttpApi.HttpApi<"AuthClientApi", 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<{
|
|
286
|
+
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
287
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
288
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
289
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
290
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
254
291
|
readonly id: import("effect/Schema").String;
|
|
255
|
-
readonly
|
|
256
|
-
|
|
257
|
-
readonly
|
|
258
|
-
readonly
|
|
259
|
-
readonly
|
|
260
|
-
readonly
|
|
261
|
-
readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
262
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
263
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
264
|
-
}>>, 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<{
|
|
265
|
-
readonly userId: import("effect/Schema").NonEmptyString;
|
|
266
|
-
}>>, 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<{
|
|
267
|
-
readonly id: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
268
|
-
}>>, 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<{
|
|
269
|
-
readonly ids: import("effect/Schema").NonEmptyString;
|
|
292
|
+
readonly key: import("effect/Schema").String;
|
|
293
|
+
}>>, 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<{
|
|
294
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
295
|
+
readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
296
|
+
readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
297
|
+
readonly rootHost: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
270
298
|
}>>, 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
|
|
299
|
+
readonly projectKey: import("effect/Schema").String;
|
|
300
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
301
|
+
readonly logoUrl: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
302
|
+
readonly authDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
303
|
+
readonly rootDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
304
|
+
readonly themeCss: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
305
|
+
readonly authOptions: import("effect/Schema").Struct<{
|
|
306
|
+
readonly emailPassword: import("effect/Schema").Boolean;
|
|
307
|
+
readonly emailOtp: import("effect/Schema").Boolean;
|
|
308
|
+
readonly google: import("effect/Schema").Boolean;
|
|
309
|
+
readonly signUp: import("effect/Schema").Boolean;
|
|
310
|
+
readonly signUpName: import("effect/Schema").Boolean;
|
|
311
|
+
}>;
|
|
312
|
+
}>>, 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<{
|
|
313
|
+
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
314
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
315
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
316
|
+
}>>, 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<{
|
|
317
|
+
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
318
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
319
|
+
readonly url: import("effect/Schema").String;
|
|
320
|
+
}>>, 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<{
|
|
321
|
+
readonly key: import("effect/Schema").NonEmptyString;
|
|
322
|
+
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">]>>;
|
|
323
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
324
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
325
|
+
readonly valid: import("effect/Schema").Boolean;
|
|
326
|
+
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
327
|
+
readonly message: import("effect/Schema").String;
|
|
328
|
+
readonly code: import("effect/Schema").String;
|
|
329
|
+
}>>;
|
|
330
|
+
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
272
331
|
readonly id: import("effect/Schema").String;
|
|
273
|
-
readonly
|
|
274
|
-
readonly
|
|
275
|
-
readonly
|
|
276
|
-
readonly
|
|
277
|
-
readonly
|
|
278
|
-
readonly
|
|
279
|
-
readonly
|
|
332
|
+
readonly configId: import("effect/Schema").String;
|
|
333
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
334
|
+
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
335
|
+
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
336
|
+
readonly referenceId: import("effect/Schema").String;
|
|
337
|
+
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
338
|
+
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
280
339
|
readonly createdAt: import("effect/Schema").Date;
|
|
281
340
|
readonly updatedAt: import("effect/Schema").Date;
|
|
341
|
+
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
342
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
282
343
|
}>>;
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
344
|
+
}>>, 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<{
|
|
345
|
+
readonly password: import("effect/Schema").NonEmptyString;
|
|
346
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
347
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
348
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<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<{
|
|
286
349
|
readonly hostname: import("effect/Schema").NonEmptyString;
|
|
287
350
|
readonly rootHostname: import("effect/Schema").NonEmptyString;
|
|
288
351
|
readonly projectId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
@@ -475,67 +538,4 @@ export declare const AuthClientApi: HttpApi.HttpApi<"AuthClientApi", import("eff
|
|
|
475
538
|
readonly logo: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
476
539
|
readonly metadata: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
|
|
477
540
|
readonly createdAt: import("effect/Schema").Date;
|
|
478
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never>, false
|
|
479
|
-
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
480
|
-
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
481
|
-
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
482
|
-
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
483
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
484
|
-
readonly id: import("effect/Schema").String;
|
|
485
|
-
readonly key: import("effect/Schema").String;
|
|
486
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getProjectPublicConfig", "GET", "/api/auth/project-config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
487
|
-
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
488
|
-
readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
489
|
-
readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
490
|
-
readonly rootHost: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
491
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
492
|
-
readonly projectKey: import("effect/Schema").String;
|
|
493
|
-
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
494
|
-
readonly logoUrl: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
495
|
-
readonly authDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
496
|
-
readonly rootDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
497
|
-
readonly themeCss: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
498
|
-
readonly authOptions: import("effect/Schema").Struct<{
|
|
499
|
-
readonly emailPassword: import("effect/Schema").Boolean;
|
|
500
|
-
readonly emailOtp: import("effect/Schema").Boolean;
|
|
501
|
-
readonly google: import("effect/Schema").Boolean;
|
|
502
|
-
readonly signUp: import("effect/Schema").Boolean;
|
|
503
|
-
readonly signUpName: import("effect/Schema").Boolean;
|
|
504
|
-
}>;
|
|
505
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"setPassword", "POST", "/api/auth/set-password", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
506
|
-
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
507
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
508
|
-
readonly ok: import("effect/Schema").Boolean;
|
|
509
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"uploadUserImage", "POST", "/api/auth/image/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
|
|
510
|
-
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
511
|
-
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
512
|
-
readonly url: import("effect/Schema").String;
|
|
513
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("./extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"verifyApiKey", "POST", "/api/auth/verify-api-key", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
514
|
-
readonly key: import("effect/Schema").NonEmptyString;
|
|
515
|
-
readonly configId: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>>;
|
|
516
|
-
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
517
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
518
|
-
readonly valid: import("effect/Schema").Boolean;
|
|
519
|
-
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
520
|
-
readonly message: import("effect/Schema").String;
|
|
521
|
-
readonly code: import("effect/Schema").String;
|
|
522
|
-
}>>;
|
|
523
|
-
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
524
|
-
readonly id: import("effect/Schema").String;
|
|
525
|
-
readonly configId: import("effect/Schema").String;
|
|
526
|
-
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
527
|
-
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
528
|
-
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
529
|
-
readonly referenceId: import("effect/Schema").String;
|
|
530
|
-
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
531
|
-
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
532
|
-
readonly createdAt: import("effect/Schema").Date;
|
|
533
|
-
readonly updatedAt: import("effect/Schema").Date;
|
|
534
|
-
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
535
|
-
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
536
|
-
}>>;
|
|
537
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"verifyPassword", "POST", "/api/auth/verify-password", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
538
|
-
readonly password: import("effect/Schema").NonEmptyString;
|
|
539
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
540
|
-
readonly ok: import("effect/Schema").Boolean;
|
|
541
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra/schema").ExtraBadRequest>, never, never>, false>>;
|
|
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").NotFound | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never>, false>>;
|
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { apiKeyClient } from "@better-auth/api-key/client";
|
|
2
|
+
import { adminClient, emailOTPClient, genericOAuthClient, lastLoginMethodClient, organizationClient, twoFactorClient } from "better-auth/client/plugins";
|
|
3
|
+
import { createAuthClient } from "better-auth/react";
|
|
4
|
+
type Session = {
|
|
5
|
+
session: {
|
|
6
|
+
activeOrganizationId?: string | null | undefined;
|
|
7
|
+
impersonatedBy?: string | null | undefined;
|
|
8
|
+
};
|
|
9
|
+
user: {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
email: string;
|
|
13
|
+
image?: string | null | undefined;
|
|
14
|
+
role?: string | null | undefined;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
type Query<T> = {
|
|
18
|
+
data: T | null | undefined;
|
|
19
|
+
isPending: boolean;
|
|
20
|
+
refetch: () => Promise<unknown>;
|
|
21
|
+
};
|
|
22
|
+
type BaseAuthUiClient = ReturnType<typeof createAuthClient<{
|
|
5
23
|
plugins: [
|
|
6
24
|
ReturnType<typeof adminClient>,
|
|
7
25
|
ReturnType<typeof emailOTPClient>,
|
|
@@ -12,3 +30,31 @@ export type AuthUiClient = ReturnType<typeof createAuthClient<{
|
|
|
12
30
|
ReturnType<typeof genericOAuthClient>
|
|
13
31
|
];
|
|
14
32
|
}>>;
|
|
33
|
+
export type AuthUiClient = Omit<BaseAuthUiClient, "getSession" | "organization" | "useSession" | "useActiveOrganization" | "useActiveMemberRole"> & {
|
|
34
|
+
getSession: () => Promise<{
|
|
35
|
+
data: Session | null;
|
|
36
|
+
error: unknown;
|
|
37
|
+
}>;
|
|
38
|
+
organization: {
|
|
39
|
+
setActive: (input: {
|
|
40
|
+
organizationId: string;
|
|
41
|
+
}) => Promise<{
|
|
42
|
+
data: unknown;
|
|
43
|
+
error: unknown;
|
|
44
|
+
}>;
|
|
45
|
+
};
|
|
46
|
+
useSession: () => Query<Session>;
|
|
47
|
+
useActiveOrganization: () => Query<{
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
slug: string;
|
|
51
|
+
createdAt: Date | string;
|
|
52
|
+
members: unknown[];
|
|
53
|
+
invitations: unknown[];
|
|
54
|
+
}>;
|
|
55
|
+
useActiveMemberRole: () => Query<{
|
|
56
|
+
role: string;
|
|
57
|
+
}>;
|
|
58
|
+
};
|
|
59
|
+
export declare const createAuthUiClient: (baseUrl?: string | undefined) => AuthUiClient;
|
|
60
|
+
export {};
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { apiKeyClient } from "@better-auth/api-key/client";
|
|
2
|
+
import { adminClient, emailOTPClient, genericOAuthClient, lastLoginMethodClient, organizationClient, twoFactorClient, } from "better-auth/client/plugins";
|
|
3
|
+
import { createAuthClient } from "better-auth/react";
|
|
4
|
+
export const createAuthUiClient = (baseUrl) => createAuthClient({
|
|
5
|
+
...(baseUrl ? { baseURL: baseUrl } : {}),
|
|
6
|
+
plugins: [
|
|
7
|
+
adminClient(),
|
|
8
|
+
emailOTPClient(),
|
|
9
|
+
lastLoginMethodClient(),
|
|
10
|
+
organizationClient(),
|
|
11
|
+
twoFactorClient(),
|
|
12
|
+
apiKeyClient(),
|
|
13
|
+
genericOAuthClient(),
|
|
14
|
+
],
|
|
15
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type
|
|
2
|
+
import { type AuthUiClient } from "./auth-client";
|
|
3
3
|
import type { ExtraProjectPublicConfig } from "../extra/schema";
|
|
4
4
|
export type KrakstackAuthLocale = "en" | "fr";
|
|
5
5
|
export type KrakstackAuthProviderProps = {
|
|
@@ -18,6 +18,7 @@ export type KrakstackAuthContextValue = {
|
|
|
18
18
|
};
|
|
19
19
|
export declare function KrakstackAuthProvider({ children, locale, baseUrl, projectId, authClient, }: KrakstackAuthProviderProps): import("react").JSX.Element;
|
|
20
20
|
export declare const useKrakstackAuth: () => KrakstackAuthContextValue | null;
|
|
21
|
+
export declare const useAuthClient: () => AuthUiClient;
|
|
21
22
|
export declare const useKrakstackAuthProjectConfig: () => import("effect/Schema").Struct.ReadonlySide<{
|
|
22
23
|
readonly projectKey: import("effect/Schema").String;
|
|
23
24
|
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { apiKeyClient } from "@better-auth/api-key/client";
|
|
3
2
|
import { useAtomSuspense } from "@effect/atom-react";
|
|
4
3
|
import { useRouterState } from "@tanstack/react-router";
|
|
5
|
-
import { adminClient, emailOTPClient, genericOAuthClient, lastLoginMethodClient, organizationClient, twoFactorClient, } from "better-auth/client/plugins";
|
|
6
|
-
import { createAuthClient } from "better-auth/react";
|
|
7
4
|
import { createContext, useContext, useEffect, useMemo, } from "react";
|
|
5
|
+
import { createAuthUiClient } from "./auth-client";
|
|
8
6
|
import { authClientApi } from "./auth-client-api";
|
|
9
7
|
const KrakstackAuthContext = createContext(null);
|
|
10
8
|
const PROJECT_CONTEXT_COOKIE = "krakstack-auth.project_context";
|
|
@@ -18,18 +16,6 @@ const setProjectContextCookie = (projectId) => {
|
|
|
18
16
|
}
|
|
19
17
|
document.cookie = `${PROJECT_CONTEXT_COOKIE}=${encodeURIComponent(projectId)}; Path=/; Max-Age=600; SameSite=Lax${secure}`;
|
|
20
18
|
};
|
|
21
|
-
const createAuthUiClient = (baseUrl) => createAuthClient({
|
|
22
|
-
...(baseUrl ? { baseURL: baseUrl } : {}),
|
|
23
|
-
plugins: [
|
|
24
|
-
adminClient(),
|
|
25
|
-
emailOTPClient(),
|
|
26
|
-
lastLoginMethodClient(),
|
|
27
|
-
organizationClient(),
|
|
28
|
-
twoFactorClient(),
|
|
29
|
-
apiKeyClient(),
|
|
30
|
-
genericOAuthClient(),
|
|
31
|
-
],
|
|
32
|
-
});
|
|
33
19
|
const getSearchParam = (searchString, key) => {
|
|
34
20
|
if (!searchString)
|
|
35
21
|
return null;
|
|
@@ -101,4 +87,11 @@ export function KrakstackAuthProvider({ children, locale = "en", baseUrl, projec
|
|
|
101
87
|
return (_jsx(KrakstackAuthContext.Provider, { value: value, children: children }));
|
|
102
88
|
}
|
|
103
89
|
export const useKrakstackAuth = () => useContext(KrakstackAuthContext);
|
|
90
|
+
export const useAuthClient = () => {
|
|
91
|
+
const auth = useKrakstackAuth();
|
|
92
|
+
if (!auth?.authClient) {
|
|
93
|
+
throw new Error("KrakstackAuthProvider is required to use authClient.");
|
|
94
|
+
}
|
|
95
|
+
return auth.authClient;
|
|
96
|
+
};
|
|
104
97
|
export const useKrakstackAuthProjectConfig = () => useKrakstackAuth()?.projectConfig ?? null;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export { KrakstackAuthProvider, useKrakstackAuth, useKrakstackAuthProjectConfig, } from "./auth-provider";
|
|
1
|
+
export { KrakstackAuthProvider, useAuthClient, useKrakstackAuth, useKrakstackAuthProjectConfig, } from "./auth-provider";
|
|
2
|
+
export { createAuthUiClient } from "./auth-client";
|
|
2
3
|
export { OrganizationSwitcher } from "./organization-switcher";
|
|
3
4
|
export { ResetPassword, Signin, Signup, TwoFactor } from "./auth-forms";
|
|
4
5
|
export { UserButton } from "./user-button";
|
|
5
6
|
export { AdminOrganizationsTable } from "./admin-organizations";
|
|
6
7
|
export { AdminOrganizationForm } from "./admin-organization-form";
|
|
7
8
|
export { AdminUsersTable, useAdminUsersTotal } from "./admin-users";
|
|
9
|
+
export { assetUrl } from "./utils";
|
|
8
10
|
export type { KrakstackAuthContextValue, KrakstackAuthLocale, KrakstackAuthProviderProps, } from "./auth-provider";
|
|
9
11
|
export type { OrganizationSwitcherDialog } from "./organization-switcher";
|
|
10
12
|
export type { UserButtonDialog } from "./user-button";
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export { KrakstackAuthProvider, useKrakstackAuth, useKrakstackAuthProjectConfig, } from "./auth-provider";
|
|
1
|
+
export { KrakstackAuthProvider, useAuthClient, useKrakstackAuth, useKrakstackAuthProjectConfig, } from "./auth-provider";
|
|
2
|
+
export { createAuthUiClient } from "./auth-client";
|
|
2
3
|
export { OrganizationSwitcher } from "./organization-switcher";
|
|
3
4
|
export { ResetPassword, Signin, Signup, TwoFactor } from "./auth-forms";
|
|
4
5
|
export { UserButton } from "./user-button";
|
|
5
6
|
export { AdminOrganizationsTable } from "./admin-organizations";
|
|
6
7
|
export { AdminOrganizationForm } from "./admin-organization-form";
|
|
7
8
|
export { AdminUsersTable, useAdminUsersTotal } from "./admin-users";
|
|
9
|
+
export { assetUrl } from "./utils";
|
|
@@ -164,7 +164,7 @@ declare const messages: {
|
|
|
164
164
|
type OrganizationSwitcherMessageKey = keyof (typeof messages)["en"];
|
|
165
165
|
export type OrganizationSwitcherMessages = Partial<Record<OrganizationSwitcherMessageKey, string>>;
|
|
166
166
|
type OrganizationSwitcherProps = {
|
|
167
|
-
authClient
|
|
167
|
+
authClient?: AuthUiClient;
|
|
168
168
|
baseUrl?: string | undefined;
|
|
169
169
|
side?: ComponentProps<typeof DropdownMenuContent>["side"];
|
|
170
170
|
className?: string;
|
|
@@ -185,5 +185,5 @@ type OrganizationSummary = {
|
|
|
185
185
|
metadata?: unknown;
|
|
186
186
|
};
|
|
187
187
|
export type OrganizationSwitcherDialog = "create" | "manage" | "members" | "apiKeys" | "invitations";
|
|
188
|
-
export declare function OrganizationSwitcher({ authClient, baseUrl, side, className, defaultDialog, hideTrigger, renderUnauthenticated, locked, messages, dialog: controlledDialog, onChange, onCreate, onDialogChange, }: OrganizationSwitcherProps): import("react").JSX.Element;
|
|
188
|
+
export declare function OrganizationSwitcher({ authClient: providedAuthClient, baseUrl, side, className, defaultDialog, hideTrigger, renderUnauthenticated, locked, messages, dialog: controlledDialog, onChange, onCreate, onDialogChange, }: OrganizationSwitcherProps): import("react").JSX.Element;
|
|
189
189
|
export {};
|
|
@@ -18,6 +18,7 @@ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "
|
|
|
18
18
|
import { Separator } from "@/components/ui/separator";
|
|
19
19
|
import { OrganizationMetadata, } from "@krak-stack/auth/schema";
|
|
20
20
|
import { authClientApi } from "./auth-client-api";
|
|
21
|
+
import { useAuthClient } from "./auth-provider";
|
|
21
22
|
import { createApiKey } from "./api-key";
|
|
22
23
|
import { useOpenedOnce } from "./hooks";
|
|
23
24
|
import { ExtraUploadedAsset } from "../extra/schema";
|
|
@@ -378,7 +379,9 @@ const organizationMetadataFromForm = async (value, m, uploadImage) => {
|
|
|
378
379
|
}
|
|
379
380
|
return { translations };
|
|
380
381
|
};
|
|
381
|
-
export function OrganizationSwitcher({ authClient, baseUrl, side = "bottom", className, defaultDialog = null, hideTrigger = false, renderUnauthenticated, locked = false, messages, dialog: controlledDialog, onChange, onCreate, onDialogChange, }) {
|
|
382
|
+
export function OrganizationSwitcher({ authClient: providedAuthClient, baseUrl, side = "bottom", className, defaultDialog = null, hideTrigger = false, renderUnauthenticated, locked = false, messages, dialog: controlledDialog, onChange, onCreate, onDialogChange, }) {
|
|
383
|
+
const contextAuthClient = useAuthClient();
|
|
384
|
+
const authClient = providedAuthClient ?? contextAuthClient;
|
|
382
385
|
const labels = organizationSwitcherMessages(messages);
|
|
383
386
|
const m = organizationMessageFns(labels);
|
|
384
387
|
const session = authClient.useSession();
|
|
@@ -180,7 +180,7 @@ declare const messages: {
|
|
|
180
180
|
type UserButtonMessageKey = keyof (typeof messages)["en"];
|
|
181
181
|
export type UserButtonMessages = Partial<Record<UserButtonMessageKey, string>>;
|
|
182
182
|
type UserDropdownProps = {
|
|
183
|
-
authClient
|
|
183
|
+
authClient?: AuthUiClient;
|
|
184
184
|
baseUrl?: string | undefined;
|
|
185
185
|
signOutRedirect?: string;
|
|
186
186
|
side?: ComponentProps<typeof DropdownMenuContent>["side"];
|
|
@@ -193,5 +193,5 @@ type UserDropdownProps = {
|
|
|
193
193
|
onDialogChange?: (dialog: UserButtonDialog | null) => void;
|
|
194
194
|
};
|
|
195
195
|
export type UserButtonDialog = "account" | "security" | "apiKeys" | "adminUsers" | "adminOrganizations";
|
|
196
|
-
export declare const UserButton: ({ authClient, baseUrl, signOutRedirect, side, defaultDialog, hideTrigger, renderUnauthenticated, apiKeyPermissions, messages, dialog: controlledDialog, onDialogChange, }: UserDropdownProps) => import("react").JSX.Element;
|
|
196
|
+
export declare const UserButton: ({ authClient: providedAuthClient, baseUrl, signOutRedirect, side, defaultDialog, hideTrigger, renderUnauthenticated, apiKeyPermissions, messages, dialog: controlledDialog, onDialogChange, }: UserDropdownProps) => import("react").JSX.Element;
|
|
197
197
|
export {};
|
|
@@ -18,7 +18,7 @@ import { Field, FieldContent, FieldDescription, FieldGroup, FieldLabel, FieldLeg
|
|
|
18
18
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu";
|
|
19
19
|
import { Separator } from "@/components/ui/separator";
|
|
20
20
|
import { authClientApi } from "./auth-client-api";
|
|
21
|
-
import {
|
|
21
|
+
import { useAuthClient, useKrakstackAuth } from "./auth-provider";
|
|
22
22
|
import { createApiKey } from "./api-key";
|
|
23
23
|
import { useOpenedOnce } from "./hooks";
|
|
24
24
|
import { ExtraUploadedAsset } from "../extra/schema";
|
|
@@ -268,10 +268,13 @@ const userApiKeysAtom = Atom.family((authClient) => Atom.keepAlive(Atom.make(Eff
|
|
|
268
268
|
catch: (error) => error,
|
|
269
269
|
}))));
|
|
270
270
|
const emptyApiKeysAtom = Atom.make(Effect.succeed([]));
|
|
271
|
-
export const UserButton = ({ authClient, baseUrl, signOutRedirect = "/", side = "bottom", defaultDialog = null, hideTrigger = false, renderUnauthenticated, apiKeyPermissions, messages, dialog: controlledDialog, onDialogChange, }) => {
|
|
271
|
+
export const UserButton = ({ authClient: providedAuthClient, baseUrl, signOutRedirect = "/", side = "bottom", defaultDialog = null, hideTrigger = false, renderUnauthenticated, apiKeyPermissions, messages, dialog: controlledDialog, onDialogChange, }) => {
|
|
272
|
+
const auth = useKrakstackAuth();
|
|
273
|
+
const contextAuthClient = useAuthClient();
|
|
274
|
+
const authClient = providedAuthClient ?? contextAuthClient;
|
|
272
275
|
const labels = userButtonMessages(messages);
|
|
273
276
|
const m = userButtonMessageFns(labels);
|
|
274
|
-
const projectConfig =
|
|
277
|
+
const projectConfig = auth?.projectConfig ?? null;
|
|
275
278
|
const navigate = useNavigate();
|
|
276
279
|
const currentSiteHref = useRouterState({
|
|
277
280
|
select: (state) => `${import.meta.env.VITE_SITE_URL}${state.location.href}`,
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { AuthClientApi, AuthServiceApi } from "./api";
|
|
|
4
4
|
export { AuthService, type AuthServiceLayerOptions } from "./service";
|
|
5
5
|
export { AuthClientConfig } from "./config";
|
|
6
6
|
export { proxyAuthRequest } from "./server/proxy";
|
|
7
|
-
export { OrganizationSwitcher, KrakstackAuthProvider, ResetPassword, Signin, Signup, TwoFactor, AdminOrganizationForm, AdminOrganizationsTable, AdminUsersTable, UserButton, type AuthUiClient, type KrakstackAuthContextValue, type KrakstackAuthLocale, type KrakstackAuthProviderProps, type OrganizationSwitcherDialog, type UserButtonDialog, useAdminUsersTotal, } from "./components";
|
|
7
|
+
export { OrganizationSwitcher, KrakstackAuthProvider, ResetPassword, Signin, Signup, TwoFactor, AdminOrganizationForm, AdminOrganizationsTable, AdminUsersTable, UserButton, assetUrl, createAuthUiClient, type AuthUiClient, type KrakstackAuthContextValue, type KrakstackAuthLocale, type KrakstackAuthProviderProps, type OrganizationSwitcherDialog, type UserButtonDialog, useAuthClient, useAdminUsersTotal, } from "./components";
|
|
8
8
|
export * as BetterAuth from "./better-auth/api.group";
|
|
9
9
|
export * as Extra from "./extra/api.group";
|
|
10
10
|
export * as Server from "./server";
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { AuthClientApi, AuthServiceApi } from "./api";
|
|
|
4
4
|
export { AuthService } from "./service";
|
|
5
5
|
export { AuthClientConfig } from "./config";
|
|
6
6
|
export { proxyAuthRequest } from "./server/proxy";
|
|
7
|
-
export { OrganizationSwitcher, KrakstackAuthProvider, ResetPassword, Signin, Signup, TwoFactor, AdminOrganizationForm, AdminOrganizationsTable, AdminUsersTable, UserButton, useAdminUsersTotal, } from "./components";
|
|
7
|
+
export { OrganizationSwitcher, KrakstackAuthProvider, ResetPassword, Signin, Signup, TwoFactor, AdminOrganizationForm, AdminOrganizationsTable, AdminUsersTable, UserButton, assetUrl, createAuthUiClient, useAuthClient, useAdminUsersTotal, } from "./components";
|
|
8
8
|
export * as BetterAuth from "./better-auth/api.group";
|
|
9
9
|
export * as Extra from "./extra/api.group";
|
|
10
10
|
export * as Server from "./server";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krak-stack/auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.43",
|
|
4
4
|
"description": "Effect HttpApi clients and schemas for KrakStack Auth.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -62,7 +62,9 @@
|
|
|
62
62
|
"prepack": "bun run build",
|
|
63
63
|
"type:check": "tsc -p tsconfig.json --noEmit"
|
|
64
64
|
},
|
|
65
|
-
"dependencies": {
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"react-qr-code": "^2.2.0"
|
|
67
|
+
},
|
|
66
68
|
"peerDependencies": {
|
|
67
69
|
"@better-auth/api-key": "^1.6.14",
|
|
68
70
|
"@tanstack/react-router": "^1.170.15",
|
|
@@ -71,7 +73,6 @@
|
|
|
71
73
|
"effect": "^4.0.0-beta.78",
|
|
72
74
|
"input-otp": "^1.4.2",
|
|
73
75
|
"lucide-react": "^1.17.0",
|
|
74
|
-
"react": "^19.2.7"
|
|
75
|
-
"react-qr-code": "^2.1.1"
|
|
76
|
+
"react": "^19.2.7"
|
|
76
77
|
}
|
|
77
78
|
}
|