@krak-stack/auth 0.1.8 → 0.1.10
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 +18 -14
- package/dist/better-auth/api.d.ts +53 -0
- package/dist/better-auth/api.js +27 -0
- package/dist/better-auth/index.d.ts +31 -0
- package/dist/better-auth/index.js +12 -0
- package/dist/better-auth/schema.d.ts +35 -0
- package/dist/better-auth/schema.js +53 -0
- package/dist/client.d.ts +308 -108
- package/dist/client.js +22 -9
- package/dist/components/auth-client.d.ts +10 -0
- package/dist/components/auth-client.js +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/organization-switcher.d.ts +3 -8
- package/dist/components/organization-switcher.js +25 -28
- package/dist/components/user-button.d.ts +3 -1
- package/dist/components/user-button.js +44 -65
- package/dist/extra/api.d.ts +109 -0
- package/dist/extra/api.js +70 -0
- package/dist/extra/index.d.ts +60 -0
- package/dist/{frontend → extra}/index.js +5 -4
- package/dist/extra/schema.d.ts +90 -0
- package/dist/extra/schema.js +162 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/schema.d.ts +13 -0
- package/dist/schema.js +30 -0
- package/dist/{backend → server}/api.d.ts +13 -12
- package/dist/{backend → server}/api.js +23 -17
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js +2 -0
- package/dist/{backend → server}/schema.d.ts +14 -14
- package/dist/server/schema.js +81 -0
- package/package.json +11 -7
- package/dist/backend/index.d.ts +0 -4
- package/dist/backend/index.js +0 -2
- package/dist/backend/schema.js +0 -81
- package/dist/frontend/api.d.ts +0 -16
- package/dist/frontend/api.js +0 -21
- package/dist/frontend/index.d.ts +0 -14
- package/dist/frontend/schema.d.ts +0 -11
- package/dist/frontend/schema.js +0 -18
package/dist/client.d.ts
CHANGED
|
@@ -14,51 +14,8 @@ export declare class AuthClientConfig extends AuthClientConfig_base {
|
|
|
14
14
|
static readonly layer: Layer.Layer<AuthClientConfig, import("effect/Config").ConfigError, never>;
|
|
15
15
|
}
|
|
16
16
|
declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/auth/AuthClient", {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
readonly query: {
|
|
20
|
-
readonly ids: string;
|
|
21
|
-
};
|
|
22
|
-
readonly responseMode?: Mode;
|
|
23
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
24
|
-
readonly data: readonly {
|
|
25
|
-
readonly id: string;
|
|
26
|
-
readonly name: string;
|
|
27
|
-
readonly email: string;
|
|
28
|
-
readonly emailVerified: boolean;
|
|
29
|
-
readonly image: string | null;
|
|
30
|
-
readonly role: string | null;
|
|
31
|
-
readonly banned: boolean | null;
|
|
32
|
-
readonly createdAt: Date;
|
|
33
|
-
readonly updatedAt: Date;
|
|
34
|
-
}[];
|
|
35
|
-
readonly missingIds: readonly string[];
|
|
36
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
37
|
-
readonly getUser: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
38
|
-
readonly params: {
|
|
39
|
-
readonly id: string;
|
|
40
|
-
};
|
|
41
|
-
readonly responseMode?: Mode;
|
|
42
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
43
|
-
readonly id: string;
|
|
44
|
-
readonly name: string;
|
|
45
|
-
readonly email: string;
|
|
46
|
-
readonly emailVerified: boolean;
|
|
47
|
-
readonly image: string | null;
|
|
48
|
-
readonly role: string | null;
|
|
49
|
-
readonly banned: boolean | null;
|
|
50
|
-
readonly createdAt: Date;
|
|
51
|
-
readonly updatedAt: Date;
|
|
52
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError | import("effect/unstable/httpapi/HttpApiError").NotFound), [Mode] extends ["response-only"] ? never : never>;
|
|
53
|
-
readonly getUserActiveOrganization: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
54
|
-
readonly params: {
|
|
55
|
-
readonly userId: string;
|
|
56
|
-
};
|
|
57
|
-
readonly responseMode?: Mode;
|
|
58
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
59
|
-
readonly id: string | null;
|
|
60
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
61
|
-
readonly listOrganizations: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
17
|
+
server: {
|
|
18
|
+
listOrganizations: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
62
19
|
readonly query: {
|
|
63
20
|
readonly ids?: string | undefined;
|
|
64
21
|
readonly userId?: string | undefined;
|
|
@@ -82,8 +39,8 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
82
39
|
readonly createdAt: Date;
|
|
83
40
|
}[];
|
|
84
41
|
readonly missingIds: readonly string[];
|
|
85
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").
|
|
86
|
-
|
|
42
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").BadRequest | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
43
|
+
getOrganization: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
87
44
|
readonly params: {
|
|
88
45
|
readonly id: string;
|
|
89
46
|
};
|
|
@@ -103,8 +60,8 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
103
60
|
}[];
|
|
104
61
|
} | null;
|
|
105
62
|
readonly createdAt: Date;
|
|
106
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").
|
|
107
|
-
|
|
63
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
64
|
+
getActiveMember: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
108
65
|
readonly params: {
|
|
109
66
|
readonly organizationId: string;
|
|
110
67
|
readonly userId: string;
|
|
@@ -127,8 +84,8 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
127
84
|
readonly createdAt: Date;
|
|
128
85
|
readonly updatedAt: Date;
|
|
129
86
|
};
|
|
130
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").
|
|
131
|
-
|
|
87
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
88
|
+
listOrganizationMembers: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
132
89
|
readonly params: {
|
|
133
90
|
readonly organizationId: string;
|
|
134
91
|
};
|
|
@@ -151,47 +108,13 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
151
108
|
readonly updatedAt: Date;
|
|
152
109
|
};
|
|
153
110
|
}[], Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
readonly payload: {
|
|
158
|
-
readonly fileName: string;
|
|
159
|
-
readonly contentType: string;
|
|
111
|
+
listUsersByIds: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
112
|
+
readonly query: {
|
|
113
|
+
readonly ids: string;
|
|
160
114
|
};
|
|
161
115
|
readonly responseMode?: Mode;
|
|
162
116
|
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
163
|
-
readonly
|
|
164
|
-
readonly url: string;
|
|
165
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError | import("effect/unstable/httpapi/HttpApiError").BadRequest | import("effect/unstable/httpapi/HttpApiError").Forbidden), [Mode] extends ["response-only"] ? never : never>;
|
|
166
|
-
};
|
|
167
|
-
}> & {
|
|
168
|
-
readonly make: Effect.Effect<{
|
|
169
|
-
backend: {
|
|
170
|
-
readonly listUsersByIds: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
171
|
-
readonly query: {
|
|
172
|
-
readonly ids: string;
|
|
173
|
-
};
|
|
174
|
-
readonly responseMode?: Mode;
|
|
175
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
176
|
-
readonly data: readonly {
|
|
177
|
-
readonly id: string;
|
|
178
|
-
readonly name: string;
|
|
179
|
-
readonly email: string;
|
|
180
|
-
readonly emailVerified: boolean;
|
|
181
|
-
readonly image: string | null;
|
|
182
|
-
readonly role: string | null;
|
|
183
|
-
readonly banned: boolean | null;
|
|
184
|
-
readonly createdAt: Date;
|
|
185
|
-
readonly updatedAt: Date;
|
|
186
|
-
}[];
|
|
187
|
-
readonly missingIds: readonly string[];
|
|
188
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
189
|
-
readonly getUser: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
190
|
-
readonly params: {
|
|
191
|
-
readonly id: string;
|
|
192
|
-
};
|
|
193
|
-
readonly responseMode?: Mode;
|
|
194
|
-
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
117
|
+
readonly data: readonly {
|
|
195
118
|
readonly id: string;
|
|
196
119
|
readonly name: string;
|
|
197
120
|
readonly email: string;
|
|
@@ -201,16 +124,150 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
201
124
|
readonly banned: boolean | null;
|
|
202
125
|
readonly createdAt: Date;
|
|
203
126
|
readonly updatedAt: Date;
|
|
204
|
-
}
|
|
205
|
-
readonly
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
readonly
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
readonly
|
|
127
|
+
}[];
|
|
128
|
+
readonly missingIds: readonly string[];
|
|
129
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
130
|
+
getUser: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
131
|
+
readonly params: {
|
|
132
|
+
readonly id: string;
|
|
133
|
+
};
|
|
134
|
+
readonly responseMode?: Mode;
|
|
135
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
136
|
+
readonly id: string;
|
|
137
|
+
readonly name: string;
|
|
138
|
+
readonly email: string;
|
|
139
|
+
readonly emailVerified: boolean;
|
|
140
|
+
readonly image: string | null;
|
|
141
|
+
readonly role: string | null;
|
|
142
|
+
readonly banned: boolean | null;
|
|
143
|
+
readonly createdAt: Date;
|
|
144
|
+
readonly updatedAt: Date;
|
|
145
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
146
|
+
getUserActiveOrganization: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
147
|
+
readonly params: {
|
|
148
|
+
readonly userId: string;
|
|
149
|
+
};
|
|
150
|
+
readonly responseMode?: Mode;
|
|
151
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
152
|
+
readonly id: string | null;
|
|
153
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
154
|
+
};
|
|
155
|
+
extra: {
|
|
156
|
+
readonly setPassword: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
157
|
+
readonly payload: {
|
|
158
|
+
readonly newPassword: string;
|
|
159
|
+
};
|
|
160
|
+
readonly responseMode?: Mode;
|
|
161
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
162
|
+
readonly ok: boolean;
|
|
163
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("./extra").ExtraBadRequest), [Mode] extends ["response-only"] ? never : never>;
|
|
164
|
+
readonly verifyPassword: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
165
|
+
readonly payload: {
|
|
166
|
+
readonly password: string;
|
|
167
|
+
};
|
|
168
|
+
readonly responseMode?: Mode;
|
|
169
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
170
|
+
readonly ok: boolean;
|
|
171
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("./extra").ExtraBadRequest), [Mode] extends ["response-only"] ? never : never>;
|
|
172
|
+
readonly createApiKey: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
173
|
+
readonly payload: {
|
|
174
|
+
readonly configId: "user" | "organization" | "service";
|
|
175
|
+
readonly name?: string | undefined;
|
|
176
|
+
readonly organizationId?: string | undefined;
|
|
177
|
+
readonly permissions?: {
|
|
178
|
+
readonly [x: string]: readonly string[];
|
|
179
|
+
} | undefined;
|
|
180
|
+
};
|
|
181
|
+
readonly responseMode?: Mode;
|
|
182
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
183
|
+
readonly id: string;
|
|
184
|
+
readonly key: string;
|
|
185
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("./extra").ExtraBadRequest), [Mode] extends ["response-only"] ? never : never>;
|
|
186
|
+
readonly verifyApiKey: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
187
|
+
readonly payload: {
|
|
188
|
+
readonly key: string;
|
|
189
|
+
readonly configId?: "user" | "organization" | "service" | undefined;
|
|
190
|
+
readonly permissions?: {
|
|
191
|
+
readonly [x: string]: readonly string[];
|
|
192
|
+
} | undefined;
|
|
193
|
+
};
|
|
194
|
+
readonly responseMode?: Mode;
|
|
195
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
196
|
+
readonly valid: boolean;
|
|
197
|
+
readonly error: {
|
|
198
|
+
readonly message: string;
|
|
199
|
+
readonly code: string;
|
|
200
|
+
} | null;
|
|
201
|
+
readonly key: {
|
|
202
|
+
readonly id: string;
|
|
203
|
+
readonly configId: string;
|
|
204
|
+
readonly name: string | null;
|
|
205
|
+
readonly start: string | null;
|
|
206
|
+
readonly prefix: string | null;
|
|
207
|
+
readonly referenceId: string;
|
|
208
|
+
readonly enabled: boolean | null;
|
|
209
|
+
readonly expiresAt: Date | null;
|
|
210
|
+
readonly createdAt: Date;
|
|
211
|
+
readonly updatedAt: Date;
|
|
212
|
+
readonly permissions: {
|
|
213
|
+
readonly [x: string]: readonly string[];
|
|
214
|
+
} | null;
|
|
215
|
+
readonly metadata: unknown;
|
|
216
|
+
} | null;
|
|
217
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("./extra").ExtraBadRequest), [Mode] extends ["response-only"] ? never : never>;
|
|
218
|
+
readonly presignUserImageUpload: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
219
|
+
readonly payload: {
|
|
220
|
+
readonly fileName: string;
|
|
221
|
+
readonly contentType: string;
|
|
222
|
+
};
|
|
223
|
+
readonly responseMode?: Mode;
|
|
224
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
225
|
+
readonly uploadUrl: string;
|
|
226
|
+
readonly url: string;
|
|
227
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError | import("./extra").ExtraBadRequest), [Mode] extends ["response-only"] ? never : never>;
|
|
228
|
+
readonly presign: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
229
|
+
readonly payload: {
|
|
230
|
+
readonly fileName: string;
|
|
231
|
+
readonly contentType: string;
|
|
232
|
+
};
|
|
233
|
+
readonly responseMode?: Mode;
|
|
234
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
235
|
+
readonly uploadUrl: string;
|
|
236
|
+
readonly url: string;
|
|
237
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").BadRequest | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").Forbidden | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
238
|
+
};
|
|
239
|
+
getSession: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
240
|
+
readonly payload: {};
|
|
241
|
+
readonly responseMode?: Mode;
|
|
242
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
243
|
+
readonly session: {
|
|
244
|
+
readonly id: string;
|
|
245
|
+
readonly expiresAt: Date;
|
|
246
|
+
readonly token: string;
|
|
247
|
+
readonly createdAt: Date;
|
|
248
|
+
readonly updatedAt: Date;
|
|
249
|
+
readonly userId: string;
|
|
250
|
+
readonly ipAddress?: string | null | undefined;
|
|
251
|
+
readonly userAgent?: string | null | undefined;
|
|
252
|
+
readonly impersonatedBy?: string | null | undefined;
|
|
253
|
+
readonly activeOrganizationId?: string | null | undefined;
|
|
254
|
+
};
|
|
255
|
+
readonly user: {
|
|
256
|
+
readonly id: string;
|
|
257
|
+
readonly name: string;
|
|
258
|
+
readonly email: string;
|
|
259
|
+
readonly emailVerified: boolean;
|
|
260
|
+
readonly image: string | null;
|
|
261
|
+
readonly role: string | null;
|
|
262
|
+
readonly banned: boolean | null;
|
|
263
|
+
readonly createdAt: Date;
|
|
264
|
+
readonly updatedAt: Date;
|
|
265
|
+
};
|
|
266
|
+
} | null, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("./better-auth").TooManyRequests | import("effect/unstable/httpapi/HttpApiError").BadRequest | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").Forbidden | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
267
|
+
}> & {
|
|
268
|
+
readonly make: Effect.Effect<{
|
|
269
|
+
server: {
|
|
270
|
+
listOrganizations: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
214
271
|
readonly query: {
|
|
215
272
|
readonly ids?: string | undefined;
|
|
216
273
|
readonly userId?: string | undefined;
|
|
@@ -234,8 +291,8 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
234
291
|
readonly createdAt: Date;
|
|
235
292
|
}[];
|
|
236
293
|
readonly missingIds: readonly string[];
|
|
237
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").
|
|
238
|
-
|
|
294
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").BadRequest | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
295
|
+
getOrganization: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
239
296
|
readonly params: {
|
|
240
297
|
readonly id: string;
|
|
241
298
|
};
|
|
@@ -255,8 +312,8 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
255
312
|
}[];
|
|
256
313
|
} | null;
|
|
257
314
|
readonly createdAt: Date;
|
|
258
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").
|
|
259
|
-
|
|
315
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
316
|
+
getActiveMember: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
260
317
|
readonly params: {
|
|
261
318
|
readonly organizationId: string;
|
|
262
319
|
readonly userId: string;
|
|
@@ -279,8 +336,8 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
279
336
|
readonly createdAt: Date;
|
|
280
337
|
readonly updatedAt: Date;
|
|
281
338
|
};
|
|
282
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").
|
|
283
|
-
|
|
339
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
340
|
+
listOrganizationMembers: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
284
341
|
readonly params: {
|
|
285
342
|
readonly organizationId: string;
|
|
286
343
|
};
|
|
@@ -303,9 +360,124 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
303
360
|
readonly updatedAt: Date;
|
|
304
361
|
};
|
|
305
362
|
}[], Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
363
|
+
listUsersByIds: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
364
|
+
readonly query: {
|
|
365
|
+
readonly ids: string;
|
|
366
|
+
};
|
|
367
|
+
readonly responseMode?: Mode;
|
|
368
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
369
|
+
readonly data: readonly {
|
|
370
|
+
readonly id: string;
|
|
371
|
+
readonly name: string;
|
|
372
|
+
readonly email: string;
|
|
373
|
+
readonly emailVerified: boolean;
|
|
374
|
+
readonly image: string | null;
|
|
375
|
+
readonly role: string | null;
|
|
376
|
+
readonly banned: boolean | null;
|
|
377
|
+
readonly createdAt: Date;
|
|
378
|
+
readonly updatedAt: Date;
|
|
379
|
+
}[];
|
|
380
|
+
readonly missingIds: readonly string[];
|
|
381
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
382
|
+
getUser: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
383
|
+
readonly params: {
|
|
384
|
+
readonly id: string;
|
|
385
|
+
};
|
|
386
|
+
readonly responseMode?: Mode;
|
|
387
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
388
|
+
readonly id: string;
|
|
389
|
+
readonly name: string;
|
|
390
|
+
readonly email: string;
|
|
391
|
+
readonly emailVerified: boolean;
|
|
392
|
+
readonly image: string | null;
|
|
393
|
+
readonly role: string | null;
|
|
394
|
+
readonly banned: boolean | null;
|
|
395
|
+
readonly createdAt: Date;
|
|
396
|
+
readonly updatedAt: Date;
|
|
397
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
398
|
+
getUserActiveOrganization: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
399
|
+
readonly params: {
|
|
400
|
+
readonly userId: string;
|
|
401
|
+
};
|
|
402
|
+
readonly responseMode?: Mode;
|
|
403
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
404
|
+
readonly id: string | null;
|
|
405
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
306
406
|
};
|
|
307
|
-
|
|
308
|
-
|
|
407
|
+
extra: {
|
|
408
|
+
readonly setPassword: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
409
|
+
readonly payload: {
|
|
410
|
+
readonly newPassword: string;
|
|
411
|
+
};
|
|
412
|
+
readonly responseMode?: Mode;
|
|
413
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
414
|
+
readonly ok: boolean;
|
|
415
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("./extra").ExtraBadRequest), [Mode] extends ["response-only"] ? never : never>;
|
|
416
|
+
readonly verifyPassword: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
417
|
+
readonly payload: {
|
|
418
|
+
readonly password: string;
|
|
419
|
+
};
|
|
420
|
+
readonly responseMode?: Mode;
|
|
421
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
422
|
+
readonly ok: boolean;
|
|
423
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("./extra").ExtraBadRequest), [Mode] extends ["response-only"] ? never : never>;
|
|
424
|
+
readonly createApiKey: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
425
|
+
readonly payload: {
|
|
426
|
+
readonly configId: "user" | "organization" | "service";
|
|
427
|
+
readonly name?: string | undefined;
|
|
428
|
+
readonly organizationId?: string | undefined;
|
|
429
|
+
readonly permissions?: {
|
|
430
|
+
readonly [x: string]: readonly string[];
|
|
431
|
+
} | undefined;
|
|
432
|
+
};
|
|
433
|
+
readonly responseMode?: Mode;
|
|
434
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
435
|
+
readonly id: string;
|
|
436
|
+
readonly key: string;
|
|
437
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("./extra").ExtraBadRequest), [Mode] extends ["response-only"] ? never : never>;
|
|
438
|
+
readonly verifyApiKey: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
439
|
+
readonly payload: {
|
|
440
|
+
readonly key: string;
|
|
441
|
+
readonly configId?: "user" | "organization" | "service" | undefined;
|
|
442
|
+
readonly permissions?: {
|
|
443
|
+
readonly [x: string]: readonly string[];
|
|
444
|
+
} | undefined;
|
|
445
|
+
};
|
|
446
|
+
readonly responseMode?: Mode;
|
|
447
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
448
|
+
readonly valid: boolean;
|
|
449
|
+
readonly error: {
|
|
450
|
+
readonly message: string;
|
|
451
|
+
readonly code: string;
|
|
452
|
+
} | null;
|
|
453
|
+
readonly key: {
|
|
454
|
+
readonly id: string;
|
|
455
|
+
readonly configId: string;
|
|
456
|
+
readonly name: string | null;
|
|
457
|
+
readonly start: string | null;
|
|
458
|
+
readonly prefix: string | null;
|
|
459
|
+
readonly referenceId: string;
|
|
460
|
+
readonly enabled: boolean | null;
|
|
461
|
+
readonly expiresAt: Date | null;
|
|
462
|
+
readonly createdAt: Date;
|
|
463
|
+
readonly updatedAt: Date;
|
|
464
|
+
readonly permissions: {
|
|
465
|
+
readonly [x: string]: readonly string[];
|
|
466
|
+
} | null;
|
|
467
|
+
readonly metadata: unknown;
|
|
468
|
+
} | null;
|
|
469
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("./extra").ExtraBadRequest), [Mode] extends ["response-only"] ? never : never>;
|
|
470
|
+
readonly presignUserImageUpload: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
471
|
+
readonly payload: {
|
|
472
|
+
readonly fileName: string;
|
|
473
|
+
readonly contentType: string;
|
|
474
|
+
};
|
|
475
|
+
readonly responseMode?: Mode;
|
|
476
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
477
|
+
readonly uploadUrl: string;
|
|
478
|
+
readonly url: string;
|
|
479
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").InternalServerError | import("./extra").ExtraBadRequest), [Mode] extends ["response-only"] ? never : never>;
|
|
480
|
+
readonly presign: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
309
481
|
readonly payload: {
|
|
310
482
|
readonly fileName: string;
|
|
311
483
|
readonly contentType: string;
|
|
@@ -314,8 +486,36 @@ declare const AuthClient_base: Context.ServiceClass<AuthClient, "@krak-stack/aut
|
|
|
314
486
|
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
315
487
|
readonly uploadUrl: string;
|
|
316
488
|
readonly url: string;
|
|
317
|
-
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").
|
|
489
|
+
}, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("effect/unstable/httpapi/HttpApiError").BadRequest | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").Forbidden | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
318
490
|
};
|
|
491
|
+
getSession: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
492
|
+
readonly payload: {};
|
|
493
|
+
readonly responseMode?: Mode;
|
|
494
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<{
|
|
495
|
+
readonly session: {
|
|
496
|
+
readonly id: string;
|
|
497
|
+
readonly expiresAt: Date;
|
|
498
|
+
readonly token: string;
|
|
499
|
+
readonly createdAt: Date;
|
|
500
|
+
readonly updatedAt: Date;
|
|
501
|
+
readonly userId: string;
|
|
502
|
+
readonly ipAddress?: string | null | undefined;
|
|
503
|
+
readonly userAgent?: string | null | undefined;
|
|
504
|
+
readonly impersonatedBy?: string | null | undefined;
|
|
505
|
+
readonly activeOrganizationId?: string | null | undefined;
|
|
506
|
+
};
|
|
507
|
+
readonly user: {
|
|
508
|
+
readonly id: string;
|
|
509
|
+
readonly name: string;
|
|
510
|
+
readonly email: string;
|
|
511
|
+
readonly emailVerified: boolean;
|
|
512
|
+
readonly image: string | null;
|
|
513
|
+
readonly role: string | null;
|
|
514
|
+
readonly banned: boolean | null;
|
|
515
|
+
readonly createdAt: Date;
|
|
516
|
+
readonly updatedAt: Date;
|
|
517
|
+
};
|
|
518
|
+
} | null, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("effect/Schema").SchemaError | import("./better-auth").TooManyRequests | import("effect/unstable/httpapi/HttpApiError").BadRequest | import("effect/unstable/httpapi/HttpApiError").Unauthorized | import("effect/unstable/httpapi/HttpApiError").Forbidden | import("effect/unstable/httpapi/HttpApiError").NotFound | import("effect/unstable/httpapi/HttpApiError").InternalServerError), [Mode] extends ["response-only"] ? never : never>;
|
|
319
519
|
}, never, AuthClientConfig | HttpClient.HttpClient>;
|
|
320
520
|
};
|
|
321
521
|
export declare class AuthClient extends AuthClient_base {
|
package/dist/client.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Redacted } from "effect";
|
|
2
2
|
import { FetchHttpClient, HttpClient, HttpClientRequest, } from "effect/unstable/http";
|
|
3
3
|
import { HttpApiClient } from "effect/unstable/httpapi";
|
|
4
|
-
import {
|
|
4
|
+
import { BetterAuthApi } from "./better-auth/api";
|
|
5
5
|
import { readClientConfig } from "./config";
|
|
6
|
-
import {
|
|
6
|
+
import { ExtraApi } from "./extra/api";
|
|
7
|
+
import { ServerApi } from "./server/api";
|
|
7
8
|
export class AuthClientConfig extends Context.Service()("@krak-stack/auth/AuthClientConfig", { make: readClientConfig }) {
|
|
8
9
|
static layer = Layer.effect(this, this.make);
|
|
9
10
|
}
|
|
@@ -12,21 +13,33 @@ export class AuthClient extends Context.Service()("@krak-stack/auth/AuthClient",
|
|
|
12
13
|
const config = yield* AuthClientConfig;
|
|
13
14
|
const http = yield* HttpClient.HttpClient;
|
|
14
15
|
const httpClient = HttpClient.mapRequest(http, (request) => HttpClientRequest.bearerToken(request, Redacted.value(config.apiKey)));
|
|
15
|
-
const
|
|
16
|
-
group: "
|
|
16
|
+
const serverUsers = yield* HttpApiClient.group(ServerApi, {
|
|
17
|
+
group: "serverUsers",
|
|
17
18
|
baseUrl: config.baseUrl,
|
|
18
19
|
httpClient,
|
|
19
20
|
});
|
|
20
|
-
const
|
|
21
|
-
group: "
|
|
21
|
+
const serverOrganizations = yield* HttpApiClient.group(ServerApi, {
|
|
22
|
+
group: "serverOrganizations",
|
|
22
23
|
baseUrl: config.baseUrl,
|
|
23
24
|
httpClient,
|
|
24
25
|
});
|
|
26
|
+
const extra = yield* HttpApiClient.group(ExtraApi, {
|
|
27
|
+
group: "extra",
|
|
28
|
+
baseUrl: config.baseUrl,
|
|
29
|
+
httpClient,
|
|
30
|
+
});
|
|
31
|
+
const betterAuth = yield* HttpApiClient.group(BetterAuthApi, {
|
|
32
|
+
group: "betterAuth",
|
|
33
|
+
baseUrl: config.baseUrl,
|
|
34
|
+
httpClient: http,
|
|
35
|
+
});
|
|
25
36
|
return {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
37
|
+
...betterAuth,
|
|
38
|
+
server: {
|
|
39
|
+
...serverUsers,
|
|
40
|
+
...serverOrganizations,
|
|
29
41
|
},
|
|
42
|
+
extra,
|
|
30
43
|
};
|
|
31
44
|
}),
|
|
32
45
|
}) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { apiKeyClient } from "@better-auth/api-key/client";
|
|
2
|
+
import type { organizationClient, twoFactorClient } from "better-auth/client/plugins";
|
|
3
|
+
import type { createAuthClient } from "better-auth/react";
|
|
4
|
+
export type AuthUiClient = ReturnType<typeof createAuthClient<{
|
|
5
|
+
plugins: [
|
|
6
|
+
ReturnType<typeof organizationClient>,
|
|
7
|
+
ReturnType<typeof twoFactorClient>,
|
|
8
|
+
ReturnType<typeof apiKeyClient>
|
|
9
|
+
];
|
|
10
|
+
}>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { type ComponentProps, type ReactNode } from "react";
|
|
2
2
|
import { DropdownMenuContent } from "@/components/ui/dropdown-menu";
|
|
3
|
+
import type { AuthUiClient } from "./auth-client";
|
|
3
4
|
type OrganizationSwitcherProps = {
|
|
5
|
+
authClient: AuthUiClient;
|
|
4
6
|
side?: ComponentProps<typeof DropdownMenuContent>["side"];
|
|
5
7
|
className?: string;
|
|
6
8
|
renderUnauthenticated?: () => ReactNode;
|
|
7
|
-
onChange?: (organization: OrganizationSummary) => void | Promise<void>;
|
|
8
9
|
locked?: boolean;
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
-
id: string;
|
|
12
|
-
name: string;
|
|
13
|
-
slug: string;
|
|
14
|
-
metadata?: unknown;
|
|
15
|
-
};
|
|
16
|
-
export declare function OrganizationSwitcher({ side, className, renderUnauthenticated, onChange, locked, }: OrganizationSwitcherProps): import("react").JSX.Element;
|
|
11
|
+
export declare function OrganizationSwitcher({ authClient, side, className, renderUnauthenticated, locked, }: OrganizationSwitcherProps): import("react").JSX.Element;
|
|
17
12
|
export {};
|