@krak-stack/auth 0.1.29 → 0.1.31
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 +28 -14
- package/dist/components/auth-api-client.d.ts +28 -14
- package/dist/components/auth-client.d.ts +4 -2
- package/dist/components/auth-forms.d.ts +12 -0
- package/dist/components/auth-forms.js +669 -0
- package/dist/components/hooks.d.ts +1 -0
- package/dist/components/hooks.js +9 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/organization-switcher.js +138 -113
- package/dist/components/user-button.d.ts +2 -0
- package/dist/components/user-button.js +124 -111
- package/dist/extra/api.d.ts +56 -28
- package/dist/extra/api.js +19 -10
- package/dist/extra/index.d.ts +28 -14
- package/dist/extra/schema.d.ts +39 -7
- package/dist/extra/schema.js +78 -12
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/service.d.ts +60 -32
- package/package.json +2 -1
package/dist/api.d.ts
CHANGED
|
@@ -31,23 +31,37 @@ export declare const AuthApi: HttpApi.HttpApi<"AuthApi", import("effect/unstable
|
|
|
31
31
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
32
32
|
readonly id: import("effect/Schema").String;
|
|
33
33
|
readonly key: import("effect/Schema").String;
|
|
34
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
readonly
|
|
40
|
-
|
|
41
|
-
readonly
|
|
42
|
-
readonly
|
|
43
|
-
|
|
44
|
-
readonly
|
|
45
|
-
readonly
|
|
46
|
-
|
|
34
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getProjectPublicConfig", "GET", "/api/auth/project-config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
35
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
36
|
+
readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
37
|
+
readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
38
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
39
|
+
readonly projectKey: import("effect/Schema").String;
|
|
40
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
41
|
+
readonly logoUrl: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
42
|
+
readonly authDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
43
|
+
readonly rootDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
44
|
+
readonly themeCss: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
45
|
+
readonly authOptions: import("effect/Schema").Struct<{
|
|
46
|
+
readonly emailPassword: import("effect/Schema").Boolean;
|
|
47
|
+
readonly emailOtp: import("effect/Schema").Boolean;
|
|
48
|
+
readonly google: import("effect/Schema").Boolean;
|
|
49
|
+
readonly signUp: import("effect/Schema").Boolean;
|
|
50
|
+
readonly signUpName: import("effect/Schema").Boolean;
|
|
51
|
+
}>;
|
|
52
|
+
}>>, 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<{
|
|
47
53
|
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
48
54
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
49
55
|
readonly ok: import("effect/Schema").Boolean;
|
|
50
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"
|
|
56
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"uploadOrganizationLogo", "POST", "/api/organizations/logo/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
|
|
57
|
+
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
58
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
59
|
+
readonly url: import("effect/Schema").String;
|
|
60
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"uploadUserImage", "POST", "/api/auth/image/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
|
|
61
|
+
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
62
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
63
|
+
readonly url: import("effect/Schema").String;
|
|
64
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("./extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"verifyApiKey", "POST", "/api/auth/verify-api-key", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
51
65
|
readonly key: import("effect/Schema").NonEmptyString;
|
|
52
66
|
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">]>>;
|
|
53
67
|
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
@@ -31,23 +31,37 @@ export declare const authApiClient: (baseUrl?: string | undefined) => AtomHttpAp
|
|
|
31
31
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
32
32
|
readonly id: import("effect/Schema").String;
|
|
33
33
|
readonly key: import("effect/Schema").String;
|
|
34
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"
|
|
35
|
-
readonly
|
|
36
|
-
readonly
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
readonly
|
|
40
|
-
|
|
41
|
-
readonly
|
|
42
|
-
readonly
|
|
43
|
-
|
|
44
|
-
readonly
|
|
45
|
-
readonly
|
|
46
|
-
|
|
34
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getProjectPublicConfig", "GET", "/api/auth/project-config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
35
|
+
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
36
|
+
readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
37
|
+
readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
38
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
39
|
+
readonly projectKey: import("effect/Schema").String;
|
|
40
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
41
|
+
readonly logoUrl: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
42
|
+
readonly authDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
43
|
+
readonly rootDomain: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
44
|
+
readonly themeCss: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
45
|
+
readonly authOptions: import("effect/Schema").Struct<{
|
|
46
|
+
readonly emailPassword: import("effect/Schema").Boolean;
|
|
47
|
+
readonly emailOtp: import("effect/Schema").Boolean;
|
|
48
|
+
readonly google: import("effect/Schema").Boolean;
|
|
49
|
+
readonly signUp: import("effect/Schema").Boolean;
|
|
50
|
+
readonly signUpName: import("effect/Schema").Boolean;
|
|
51
|
+
}>;
|
|
52
|
+
}>>, 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<{
|
|
47
53
|
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
48
54
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
49
55
|
readonly ok: import("effect/Schema").Boolean;
|
|
50
|
-
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"
|
|
56
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"uploadOrganizationLogo", "POST", "/api/organizations/logo/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
|
|
57
|
+
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
58
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
59
|
+
readonly url: import("effect/Schema").String;
|
|
60
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").BadRequest | typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").Forbidden | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"uploadUserImage", "POST", "/api/auth/image/upload", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/unstable/httpapi/HttpApiSchema").asMultipartStream<import("effect/Schema").Struct<{
|
|
61
|
+
readonly file: import("effect/Schema").decodeTo<import("effect/unstable/http/Multipart").PersistedFileSchema, import("effect/Schema").$Array<import("effect/unstable/http/Multipart").PersistedFileSchema>, never, never>;
|
|
62
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
63
|
+
readonly url: import("effect/Schema").String;
|
|
64
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("../extra").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"verifyApiKey", "POST", "/api/auth/verify-api-key", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
51
65
|
readonly key: import("effect/Schema").NonEmptyString;
|
|
52
66
|
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">]>>;
|
|
53
67
|
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { apiKeyClient } from "@better-auth/api-key/client";
|
|
2
|
-
import type { organizationClient, twoFactorClient } from "better-auth/client/plugins";
|
|
2
|
+
import type { emailOTPClient, genericOAuthClient, organizationClient, twoFactorClient } from "better-auth/client/plugins";
|
|
3
3
|
import type { createAuthClient } from "better-auth/react";
|
|
4
4
|
export type AuthUiClient = ReturnType<typeof createAuthClient<{
|
|
5
5
|
plugins: [
|
|
6
|
+
ReturnType<typeof emailOTPClient>,
|
|
6
7
|
ReturnType<typeof organizationClient>,
|
|
7
8
|
ReturnType<typeof twoFactorClient>,
|
|
8
|
-
ReturnType<typeof apiKeyClient
|
|
9
|
+
ReturnType<typeof apiKeyClient>,
|
|
10
|
+
ReturnType<typeof genericOAuthClient>
|
|
9
11
|
];
|
|
10
12
|
}>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AuthUiClient } from "./auth-client";
|
|
2
|
+
type AuthFormProps = {
|
|
3
|
+
authClient: AuthUiClient;
|
|
4
|
+
baseUrl?: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
export declare function Signin({ authClient, baseUrl }: AuthFormProps): import("react").JSX.Element;
|
|
7
|
+
export declare function Signup({ authClient, baseUrl }: AuthFormProps): import("react").JSX.Element;
|
|
8
|
+
export declare function ResetPassword({ authClient }: {
|
|
9
|
+
authClient: AuthUiClient;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
11
|
+
export declare function TwoFactor({ authClient, baseUrl }: AuthFormProps): import("react").JSX.Element;
|
|
12
|
+
export {};
|