@krak-stack/auth 0.1.9 → 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/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 +3 -2
- package/dist/index.js +3 -2
- 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
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { HttpApi } from "effect/unstable/httpapi";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiError, HttpApiGroup } from "effect/unstable/httpapi";
|
|
3
|
+
import { ExtraBadRequest } from "./schema";
|
|
4
|
+
export declare const ExtraApiGroup: HttpApiGroup.HttpApiGroup<"extra", HttpApiEndpoint.HttpApiEndpoint<"setPassword", "POST", "/auth/set-password", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
5
|
+
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
6
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
7
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
8
|
+
}>>, HttpApiEndpoint.Json<typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"verifyPassword", "POST", "/auth/verify-password", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
9
|
+
readonly password: import("effect/Schema").NonEmptyString;
|
|
10
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
11
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
12
|
+
}>>, HttpApiEndpoint.Json<typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"createApiKey", "POST", "/auth/create-api-key", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
13
|
+
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
14
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
15
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
16
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
17
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
18
|
+
readonly id: import("effect/Schema").String;
|
|
19
|
+
readonly key: import("effect/Schema").String;
|
|
20
|
+
}>>, HttpApiEndpoint.Json<typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"verifyApiKey", "POST", "/auth/verify-api-key", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
21
|
+
readonly key: import("effect/Schema").NonEmptyString;
|
|
22
|
+
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">]>>;
|
|
23
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
24
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
25
|
+
readonly valid: import("effect/Schema").Boolean;
|
|
26
|
+
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
27
|
+
readonly message: import("effect/Schema").String;
|
|
28
|
+
readonly code: import("effect/Schema").String;
|
|
29
|
+
}>>;
|
|
30
|
+
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
31
|
+
readonly id: import("effect/Schema").String;
|
|
32
|
+
readonly configId: import("effect/Schema").String;
|
|
33
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
34
|
+
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
35
|
+
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
36
|
+
readonly referenceId: import("effect/Schema").String;
|
|
37
|
+
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
38
|
+
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
39
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
40
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
41
|
+
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
42
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
43
|
+
}>>;
|
|
44
|
+
}>>, HttpApiEndpoint.Json<typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"presignUserImageUpload", "POST", "/auth/image/presign", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
45
|
+
readonly fileName: import("effect/Schema").NonEmptyString;
|
|
46
|
+
readonly contentType: import("effect/Schema").NonEmptyString;
|
|
47
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
48
|
+
readonly uploadUrl: import("effect/Schema").String;
|
|
49
|
+
readonly url: import("effect/Schema").String;
|
|
50
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"presign", "POST", "/organizations/logo/presign", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
51
|
+
readonly fileName: import("effect/Schema").NonEmptyString;
|
|
52
|
+
readonly contentType: import("effect/Schema").NonEmptyString;
|
|
53
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
54
|
+
readonly uploadUrl: import("effect/Schema").String;
|
|
55
|
+
readonly url: import("effect/Schema").String;
|
|
56
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never>, false>;
|
|
57
|
+
export declare const ExtraApi: HttpApi.HttpApi<"ExtraApi", HttpApiGroup.HttpApiGroup<"extra", HttpApiEndpoint.HttpApiEndpoint<"setPassword", "POST", "/api/auth/set-password", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
58
|
+
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
59
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
60
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
61
|
+
}>>, HttpApiEndpoint.Json<typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"verifyPassword", "POST", "/api/auth/verify-password", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
62
|
+
readonly password: import("effect/Schema").NonEmptyString;
|
|
63
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
64
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
65
|
+
}>>, HttpApiEndpoint.Json<typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"createApiKey", "POST", "/api/auth/create-api-key", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
66
|
+
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
67
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
68
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
69
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
70
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
71
|
+
readonly id: import("effect/Schema").String;
|
|
72
|
+
readonly key: import("effect/Schema").String;
|
|
73
|
+
}>>, HttpApiEndpoint.Json<typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"verifyApiKey", "POST", "/api/auth/verify-api-key", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
74
|
+
readonly key: import("effect/Schema").NonEmptyString;
|
|
75
|
+
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">]>>;
|
|
76
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
77
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
78
|
+
readonly valid: import("effect/Schema").Boolean;
|
|
79
|
+
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
80
|
+
readonly message: import("effect/Schema").String;
|
|
81
|
+
readonly code: import("effect/Schema").String;
|
|
82
|
+
}>>;
|
|
83
|
+
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
84
|
+
readonly id: import("effect/Schema").String;
|
|
85
|
+
readonly configId: import("effect/Schema").String;
|
|
86
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
87
|
+
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
88
|
+
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
89
|
+
readonly referenceId: import("effect/Schema").String;
|
|
90
|
+
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
91
|
+
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
92
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
93
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
94
|
+
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
95
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
96
|
+
}>>;
|
|
97
|
+
}>>, HttpApiEndpoint.Json<typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"presignUserImageUpload", "POST", "/api/auth/image/presign", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
98
|
+
readonly fileName: import("effect/Schema").NonEmptyString;
|
|
99
|
+
readonly contentType: import("effect/Schema").NonEmptyString;
|
|
100
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
101
|
+
readonly uploadUrl: import("effect/Schema").String;
|
|
102
|
+
readonly url: import("effect/Schema").String;
|
|
103
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"presign", "POST", "/api/organizations/logo/presign", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
104
|
+
readonly fileName: import("effect/Schema").NonEmptyString;
|
|
105
|
+
readonly contentType: import("effect/Schema").NonEmptyString;
|
|
106
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
107
|
+
readonly uploadUrl: import("effect/Schema").String;
|
|
108
|
+
readonly url: import("effect/Schema").String;
|
|
109
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.BadRequest | typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never>, false>>;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { HttpApi, OpenApi } from "effect/unstable/httpapi";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiError, HttpApiGroup, } from "effect/unstable/httpapi";
|
|
3
|
+
import { ExtraBadRequest, ExtraCreateApiKeyPayload, ExtraCreateApiKeyResponse, ExtraOkResponse, ExtraPresignedUpload, ExtraPresignUploadPayload, ExtraSetPasswordPayload, ExtraVerifyApiKeyPayload, ExtraVerifyApiKeyResponse, ExtraVerifyPasswordPayload, } from "./schema";
|
|
4
|
+
export const ExtraApiGroup = HttpApiGroup.make("extra")
|
|
5
|
+
.add(HttpApiEndpoint.post("setPassword", "/auth/set-password", {
|
|
6
|
+
payload: ExtraSetPasswordPayload,
|
|
7
|
+
success: ExtraOkResponse,
|
|
8
|
+
error: ExtraBadRequest,
|
|
9
|
+
}).annotateMerge(OpenApi.annotations({
|
|
10
|
+
title: "Set password",
|
|
11
|
+
summary: "Set password for the current user",
|
|
12
|
+
description: "Sets a password for the authenticated user using schema-validated input.",
|
|
13
|
+
})))
|
|
14
|
+
.add(HttpApiEndpoint.post("verifyPassword", "/auth/verify-password", {
|
|
15
|
+
payload: ExtraVerifyPasswordPayload,
|
|
16
|
+
success: ExtraOkResponse,
|
|
17
|
+
error: ExtraBadRequest,
|
|
18
|
+
}).annotateMerge(OpenApi.annotations({
|
|
19
|
+
title: "Verify password",
|
|
20
|
+
summary: "Verify current user password",
|
|
21
|
+
description: "Verifies the authenticated user's password using schema-validated input.",
|
|
22
|
+
})))
|
|
23
|
+
.add(HttpApiEndpoint.post("createApiKey", "/auth/create-api-key", {
|
|
24
|
+
payload: ExtraCreateApiKeyPayload,
|
|
25
|
+
success: ExtraCreateApiKeyResponse,
|
|
26
|
+
error: ExtraBadRequest,
|
|
27
|
+
}).annotateMerge(OpenApi.annotations({
|
|
28
|
+
title: "Create API key",
|
|
29
|
+
summary: "Create an API key with optional permissions",
|
|
30
|
+
description: "Creates a user or organization API key through Better Auth's server-side API so server-only fields like permissions can be set.",
|
|
31
|
+
})))
|
|
32
|
+
.add(HttpApiEndpoint.post("verifyApiKey", "/auth/verify-api-key", {
|
|
33
|
+
payload: ExtraVerifyApiKeyPayload,
|
|
34
|
+
success: ExtraVerifyApiKeyResponse,
|
|
35
|
+
error: ExtraBadRequest,
|
|
36
|
+
}).annotateMerge(OpenApi.annotations({
|
|
37
|
+
title: "Verify API key",
|
|
38
|
+
summary: "Verify a remote API key",
|
|
39
|
+
description: "Verifies a user or organization API key and optional permissions using Better Auth's server-side API key verifier.",
|
|
40
|
+
})))
|
|
41
|
+
.add(HttpApiEndpoint.post("presignUserImageUpload", "/auth/image/presign", {
|
|
42
|
+
payload: ExtraPresignUploadPayload,
|
|
43
|
+
success: ExtraPresignedUpload,
|
|
44
|
+
error: [
|
|
45
|
+
ExtraBadRequest,
|
|
46
|
+
HttpApiError.Unauthorized,
|
|
47
|
+
HttpApiError.InternalServerError,
|
|
48
|
+
],
|
|
49
|
+
}).annotateMerge(OpenApi.annotations({
|
|
50
|
+
title: "Presign user image upload",
|
|
51
|
+
summary: "Create a presigned user image upload URL",
|
|
52
|
+
description: "Returns a short-lived S3 upload URL and stable asset URL for the current user's profile image.",
|
|
53
|
+
})))
|
|
54
|
+
.add(HttpApiEndpoint.post("presign", "/organizations/logo/presign", {
|
|
55
|
+
payload: ExtraPresignUploadPayload,
|
|
56
|
+
success: ExtraPresignedUpload,
|
|
57
|
+
error: [
|
|
58
|
+
HttpApiError.BadRequest,
|
|
59
|
+
HttpApiError.Unauthorized,
|
|
60
|
+
HttpApiError.Forbidden,
|
|
61
|
+
HttpApiError.InternalServerError,
|
|
62
|
+
],
|
|
63
|
+
}))
|
|
64
|
+
.annotateMerge(OpenApi.annotations({
|
|
65
|
+
title: "Extra",
|
|
66
|
+
description: "KrakStack-specific endpoints layered on top of Better Auth.",
|
|
67
|
+
}));
|
|
68
|
+
export const ExtraApi = HttpApi.make("ExtraApi")
|
|
69
|
+
.add(ExtraApiGroup)
|
|
70
|
+
.prefix("/api");
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { AtomHttpApi } from "effect/unstable/reactivity";
|
|
2
|
+
declare const ExtraApiClient_base: AtomHttpApi.AtomHttpApiClient<ExtraApiClient, "ExtraApiClient", import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"extra", 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<{
|
|
3
|
+
readonly newPassword: import("effect/Schema").NonEmptyString;
|
|
4
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
5
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
6
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./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<{
|
|
7
|
+
readonly password: import("effect/Schema").NonEmptyString;
|
|
8
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
9
|
+
readonly ok: import("effect/Schema").Boolean;
|
|
10
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./schema").ExtraBadRequest>, never, never> | 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<{
|
|
11
|
+
readonly configId: import("effect/Schema").Union<readonly [import("effect/Schema").Literal<"user">, import("effect/Schema").Literal<"organization">, import("effect/Schema").Literal<"service">]>;
|
|
12
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").NonEmptyString>;
|
|
13
|
+
readonly organizationId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
14
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
15
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
16
|
+
readonly id: import("effect/Schema").String;
|
|
17
|
+
readonly key: import("effect/Schema").String;
|
|
18
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./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<{
|
|
19
|
+
readonly key: import("effect/Schema").NonEmptyString;
|
|
20
|
+
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">]>>;
|
|
21
|
+
readonly permissions: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
22
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
23
|
+
readonly valid: import("effect/Schema").Boolean;
|
|
24
|
+
readonly error: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
25
|
+
readonly message: import("effect/Schema").String;
|
|
26
|
+
readonly code: import("effect/Schema").String;
|
|
27
|
+
}>>;
|
|
28
|
+
readonly key: import("effect/Schema").NullOr<import("effect/Schema").Struct<{
|
|
29
|
+
readonly id: import("effect/Schema").String;
|
|
30
|
+
readonly configId: import("effect/Schema").String;
|
|
31
|
+
readonly name: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
32
|
+
readonly start: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
33
|
+
readonly prefix: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
34
|
+
readonly referenceId: import("effect/Schema").String;
|
|
35
|
+
readonly enabled: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
|
|
36
|
+
readonly expiresAt: import("effect/Schema").NullOr<import("effect/Schema").Date>;
|
|
37
|
+
readonly createdAt: import("effect/Schema").Date;
|
|
38
|
+
readonly updatedAt: import("effect/Schema").Date;
|
|
39
|
+
readonly permissions: import("effect/Schema").NullOr<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").String>>>;
|
|
40
|
+
readonly metadata: import("effect/Schema").NullOr<import("effect/Schema").Unknown>;
|
|
41
|
+
}>>;
|
|
42
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("./schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"presignUserImageUpload", "POST", "/api/auth/image/presign", 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 fileName: import("effect/Schema").NonEmptyString;
|
|
44
|
+
readonly contentType: import("effect/Schema").NonEmptyString;
|
|
45
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
46
|
+
readonly uploadUrl: import("effect/Schema").String;
|
|
47
|
+
readonly url: import("effect/Schema").String;
|
|
48
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("effect/unstable/httpapi/HttpApiError").Unauthorized | typeof import("effect/unstable/httpapi/HttpApiError").InternalServerError | typeof import("./schema").ExtraBadRequest>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"presign", "POST", "/api/organizations/logo/presign", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
49
|
+
readonly fileName: import("effect/Schema").NonEmptyString;
|
|
50
|
+
readonly contentType: import("effect/Schema").NonEmptyString;
|
|
51
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
52
|
+
readonly uploadUrl: import("effect/Schema").String;
|
|
53
|
+
readonly url: import("effect/Schema").String;
|
|
54
|
+
}>>, 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>, false>>;
|
|
55
|
+
export declare class ExtraApiClient extends ExtraApiClient_base {
|
|
56
|
+
}
|
|
57
|
+
export { AuthClient, AuthClientConfig } from "../client";
|
|
58
|
+
export { ExtraApi, ExtraApiGroup } from "./api";
|
|
59
|
+
export * from "./schema";
|
|
60
|
+
export type { Organization, OrganizationMetadata } from "../schema";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { FetchHttpClient } from "effect/unstable/http";
|
|
2
2
|
import { AtomHttpApi } from "effect/unstable/reactivity";
|
|
3
3
|
import { defaultBaseUrl } from "../config";
|
|
4
|
-
import {
|
|
5
|
-
export class
|
|
6
|
-
api:
|
|
4
|
+
import { ExtraApi } from "./api";
|
|
5
|
+
export class ExtraApiClient extends AtomHttpApi.Service()("ExtraApiClient", {
|
|
6
|
+
api: ExtraApi,
|
|
7
7
|
baseUrl: defaultBaseUrl(),
|
|
8
8
|
httpClient: FetchHttpClient.layer,
|
|
9
9
|
}) {
|
|
10
10
|
}
|
|
11
11
|
export { AuthClient, AuthClientConfig } from "../client";
|
|
12
|
-
export {
|
|
12
|
+
export { ExtraApi, ExtraApiGroup } from "./api";
|
|
13
|
+
export * from "./schema";
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export declare const ExtraPresignUploadPayload: Schema.Struct<{
|
|
3
|
+
readonly fileName: Schema.NonEmptyString;
|
|
4
|
+
readonly contentType: Schema.NonEmptyString;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const ExtraSetPasswordPayload: Schema.Struct<{
|
|
7
|
+
readonly newPassword: Schema.NonEmptyString;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const ExtraVerifyPasswordPayload: Schema.Struct<{
|
|
10
|
+
readonly password: Schema.NonEmptyString;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const ExtraApiKeyConfigId: Schema.Union<readonly [Schema.Literal<"user">, Schema.Literal<"organization">, Schema.Literal<"service">]>;
|
|
13
|
+
export declare const ExtraApiKeyPermissions: Schema.$Record<Schema.String, Schema.$Array<Schema.String>>;
|
|
14
|
+
export declare const ExtraCreateApiKeyPayload: Schema.Struct<{
|
|
15
|
+
readonly configId: Schema.Union<readonly [Schema.Literal<"user">, Schema.Literal<"organization">, Schema.Literal<"service">]>;
|
|
16
|
+
readonly name: Schema.optional<Schema.NonEmptyString>;
|
|
17
|
+
readonly organizationId: Schema.optional<Schema.String>;
|
|
18
|
+
readonly permissions: Schema.optional<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const ExtraCreateApiKeyResponse: Schema.Struct<{
|
|
21
|
+
readonly id: Schema.String;
|
|
22
|
+
readonly key: Schema.String;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const ExtraVerifyApiKeyPayload: Schema.Struct<{
|
|
25
|
+
readonly key: Schema.NonEmptyString;
|
|
26
|
+
readonly configId: Schema.optional<Schema.Union<readonly [Schema.Literal<"user">, Schema.Literal<"organization">, Schema.Literal<"service">]>>;
|
|
27
|
+
readonly permissions: Schema.optional<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
28
|
+
}>;
|
|
29
|
+
export declare const ExtraApiKeyVerificationError: Schema.Struct<{
|
|
30
|
+
readonly message: Schema.String;
|
|
31
|
+
readonly code: Schema.String;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const ExtraVerifiedApiKey: Schema.Struct<{
|
|
34
|
+
readonly id: Schema.String;
|
|
35
|
+
readonly configId: Schema.String;
|
|
36
|
+
readonly name: Schema.NullOr<Schema.String>;
|
|
37
|
+
readonly start: Schema.NullOr<Schema.String>;
|
|
38
|
+
readonly prefix: Schema.NullOr<Schema.String>;
|
|
39
|
+
readonly referenceId: Schema.String;
|
|
40
|
+
readonly enabled: Schema.NullOr<Schema.Boolean>;
|
|
41
|
+
readonly expiresAt: Schema.NullOr<Schema.Date>;
|
|
42
|
+
readonly createdAt: Schema.Date;
|
|
43
|
+
readonly updatedAt: Schema.Date;
|
|
44
|
+
readonly permissions: Schema.NullOr<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
45
|
+
readonly metadata: Schema.NullOr<Schema.Unknown>;
|
|
46
|
+
}>;
|
|
47
|
+
export declare const ExtraVerifyApiKeyResponse: Schema.Struct<{
|
|
48
|
+
readonly valid: Schema.Boolean;
|
|
49
|
+
readonly error: Schema.NullOr<Schema.Struct<{
|
|
50
|
+
readonly message: Schema.String;
|
|
51
|
+
readonly code: Schema.String;
|
|
52
|
+
}>>;
|
|
53
|
+
readonly key: Schema.NullOr<Schema.Struct<{
|
|
54
|
+
readonly id: Schema.String;
|
|
55
|
+
readonly configId: Schema.String;
|
|
56
|
+
readonly name: Schema.NullOr<Schema.String>;
|
|
57
|
+
readonly start: Schema.NullOr<Schema.String>;
|
|
58
|
+
readonly prefix: Schema.NullOr<Schema.String>;
|
|
59
|
+
readonly referenceId: Schema.String;
|
|
60
|
+
readonly enabled: Schema.NullOr<Schema.Boolean>;
|
|
61
|
+
readonly expiresAt: Schema.NullOr<Schema.Date>;
|
|
62
|
+
readonly createdAt: Schema.Date;
|
|
63
|
+
readonly updatedAt: Schema.Date;
|
|
64
|
+
readonly permissions: Schema.NullOr<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>;
|
|
65
|
+
readonly metadata: Schema.NullOr<Schema.Unknown>;
|
|
66
|
+
}>>;
|
|
67
|
+
}>;
|
|
68
|
+
export declare const ExtraOkResponse: Schema.Struct<{
|
|
69
|
+
readonly ok: Schema.Boolean;
|
|
70
|
+
}>;
|
|
71
|
+
export declare const ExtraPresignedUpload: Schema.Struct<{
|
|
72
|
+
readonly uploadUrl: Schema.String;
|
|
73
|
+
readonly url: Schema.String;
|
|
74
|
+
}>;
|
|
75
|
+
declare const ExtraBadRequest_base: Schema.Class<ExtraBadRequest, Schema.Struct<{
|
|
76
|
+
readonly _tag: Schema.tag<"ExtraBadRequest">;
|
|
77
|
+
readonly message: Schema.String;
|
|
78
|
+
}>, import("effect/Cause").YieldableError>;
|
|
79
|
+
export declare class ExtraBadRequest extends ExtraBadRequest_base {
|
|
80
|
+
}
|
|
81
|
+
export type ExtraPresignUploadPayload = typeof ExtraPresignUploadPayload.Type;
|
|
82
|
+
export type ExtraPresignedUpload = typeof ExtraPresignedUpload.Type;
|
|
83
|
+
export type ExtraSetPasswordPayload = typeof ExtraSetPasswordPayload.Type;
|
|
84
|
+
export type ExtraVerifyPasswordPayload = typeof ExtraVerifyPasswordPayload.Type;
|
|
85
|
+
export type ExtraCreateApiKeyPayload = typeof ExtraCreateApiKeyPayload.Type;
|
|
86
|
+
export type ExtraCreateApiKeyResponse = typeof ExtraCreateApiKeyResponse.Type;
|
|
87
|
+
export type ExtraVerifyApiKeyPayload = typeof ExtraVerifyApiKeyPayload.Type;
|
|
88
|
+
export type ExtraVerifyApiKeyResponse = typeof ExtraVerifyApiKeyResponse.Type;
|
|
89
|
+
export type ExtraOkResponse = typeof ExtraOkResponse.Type;
|
|
90
|
+
export {};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
export const ExtraPresignUploadPayload = Schema.Struct({
|
|
3
|
+
fileName: Schema.NonEmptyString,
|
|
4
|
+
contentType: Schema.NonEmptyString,
|
|
5
|
+
}).annotate({
|
|
6
|
+
identifier: "ExtraPresignUploadPayload",
|
|
7
|
+
title: "Extra presign upload payload",
|
|
8
|
+
description: "Payload used to request a presigned organization logo upload URL.",
|
|
9
|
+
examples: [{ fileName: "logo.png", contentType: "image/png" }],
|
|
10
|
+
});
|
|
11
|
+
export const ExtraSetPasswordPayload = Schema.Struct({
|
|
12
|
+
newPassword: Schema.NonEmptyString,
|
|
13
|
+
}).annotate({
|
|
14
|
+
identifier: "ExtraSetPasswordPayload",
|
|
15
|
+
title: "Extra set password payload",
|
|
16
|
+
description: "Payload used to set a password for the current authenticated user.",
|
|
17
|
+
examples: [{ newPassword: "correct-horse-battery-staple" }],
|
|
18
|
+
});
|
|
19
|
+
export const ExtraVerifyPasswordPayload = Schema.Struct({
|
|
20
|
+
password: Schema.NonEmptyString,
|
|
21
|
+
}).annotate({
|
|
22
|
+
identifier: "ExtraVerifyPasswordPayload",
|
|
23
|
+
title: "Extra verify password payload",
|
|
24
|
+
description: "Payload used to verify the current authenticated user's password.",
|
|
25
|
+
examples: [{ password: "correct-horse-battery-staple" }],
|
|
26
|
+
});
|
|
27
|
+
export const ExtraApiKeyConfigId = Schema.Union([
|
|
28
|
+
Schema.Literal("user"),
|
|
29
|
+
Schema.Literal("organization"),
|
|
30
|
+
Schema.Literal("service"),
|
|
31
|
+
]).annotate({
|
|
32
|
+
identifier: "ExtraApiKeyConfigId",
|
|
33
|
+
title: "Extra API key configuration ID",
|
|
34
|
+
description: "The configured API key owner type to verify against.",
|
|
35
|
+
examples: ["user"],
|
|
36
|
+
});
|
|
37
|
+
export const ExtraApiKeyPermissions = Schema.Record(Schema.String, Schema.Array(Schema.String)).annotate({
|
|
38
|
+
identifier: "ExtraApiKeyPermissions",
|
|
39
|
+
title: "Extra API key permissions",
|
|
40
|
+
description: "Resource/action permissions required for API key verification.",
|
|
41
|
+
examples: [{ projects: ["read"] }],
|
|
42
|
+
});
|
|
43
|
+
export const ExtraCreateApiKeyPayload = Schema.Struct({
|
|
44
|
+
configId: ExtraApiKeyConfigId,
|
|
45
|
+
name: Schema.optional(Schema.NonEmptyString),
|
|
46
|
+
organizationId: Schema.optional(Schema.String),
|
|
47
|
+
permissions: Schema.optional(ExtraApiKeyPermissions),
|
|
48
|
+
}).annotate({
|
|
49
|
+
identifier: "ExtraCreateApiKeyPayload",
|
|
50
|
+
title: "Extra create API key payload",
|
|
51
|
+
description: "Payload used to create a user or organization API key from the server auth instance.",
|
|
52
|
+
examples: [
|
|
53
|
+
{
|
|
54
|
+
configId: "user",
|
|
55
|
+
name: "Production key",
|
|
56
|
+
permissions: { projects: ["read"] },
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
});
|
|
60
|
+
export const ExtraCreateApiKeyResponse = Schema.Struct({
|
|
61
|
+
id: Schema.String,
|
|
62
|
+
key: Schema.String,
|
|
63
|
+
}).annotate({
|
|
64
|
+
identifier: "ExtraCreateApiKeyResponse",
|
|
65
|
+
title: "Extra create API key response",
|
|
66
|
+
description: "Response returned after creating an API key. The secret key is only returned once.",
|
|
67
|
+
examples: [{ id: "api-key-id", key: "user_1234567890" }],
|
|
68
|
+
});
|
|
69
|
+
export const ExtraVerifyApiKeyPayload = Schema.Struct({
|
|
70
|
+
key: Schema.NonEmptyString,
|
|
71
|
+
configId: Schema.optional(ExtraApiKeyConfigId),
|
|
72
|
+
permissions: Schema.optional(ExtraApiKeyPermissions),
|
|
73
|
+
}).annotate({
|
|
74
|
+
identifier: "ExtraVerifyApiKeyPayload",
|
|
75
|
+
title: "Extra verify API key payload",
|
|
76
|
+
description: "Payload used by remote services to verify a KrakStack API key.",
|
|
77
|
+
examples: [
|
|
78
|
+
{
|
|
79
|
+
key: "user_1234567890",
|
|
80
|
+
configId: "user",
|
|
81
|
+
permissions: { projects: ["read"] },
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
});
|
|
85
|
+
export const ExtraApiKeyVerificationError = Schema.Struct({
|
|
86
|
+
message: Schema.String,
|
|
87
|
+
code: Schema.String,
|
|
88
|
+
}).annotate({
|
|
89
|
+
identifier: "ExtraApiKeyVerificationError",
|
|
90
|
+
title: "Extra API key verification error",
|
|
91
|
+
description: "Structured reason returned when an API key is invalid.",
|
|
92
|
+
examples: [{ message: "API key is invalid", code: "INVALID_API_KEY" }],
|
|
93
|
+
});
|
|
94
|
+
export const ExtraVerifiedApiKey = Schema.Struct({
|
|
95
|
+
id: Schema.String,
|
|
96
|
+
configId: Schema.String,
|
|
97
|
+
name: Schema.NullOr(Schema.String),
|
|
98
|
+
start: Schema.NullOr(Schema.String),
|
|
99
|
+
prefix: Schema.NullOr(Schema.String),
|
|
100
|
+
referenceId: Schema.String,
|
|
101
|
+
enabled: Schema.NullOr(Schema.Boolean),
|
|
102
|
+
expiresAt: Schema.NullOr(Schema.Date),
|
|
103
|
+
createdAt: Schema.Date,
|
|
104
|
+
updatedAt: Schema.Date,
|
|
105
|
+
permissions: Schema.NullOr(ExtraApiKeyPermissions),
|
|
106
|
+
metadata: Schema.NullOr(Schema.Unknown),
|
|
107
|
+
}).annotate({
|
|
108
|
+
identifier: "ExtraVerifiedApiKey",
|
|
109
|
+
title: "Extra verified API key metadata",
|
|
110
|
+
description: "Non-secret metadata for a verified API key.",
|
|
111
|
+
examples: [
|
|
112
|
+
{
|
|
113
|
+
id: "api-key-id",
|
|
114
|
+
configId: "user",
|
|
115
|
+
name: "Production key",
|
|
116
|
+
start: "user_1234",
|
|
117
|
+
prefix: "user_",
|
|
118
|
+
referenceId: "user-id",
|
|
119
|
+
enabled: true,
|
|
120
|
+
expiresAt: null,
|
|
121
|
+
createdAt: new Date("2026-01-01T00:00:00.000Z"),
|
|
122
|
+
updatedAt: new Date("2026-01-01T00:00:00.000Z"),
|
|
123
|
+
permissions: { projects: ["read"] },
|
|
124
|
+
metadata: null,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
});
|
|
128
|
+
export const ExtraVerifyApiKeyResponse = Schema.Struct({
|
|
129
|
+
valid: Schema.Boolean,
|
|
130
|
+
error: Schema.NullOr(ExtraApiKeyVerificationError),
|
|
131
|
+
key: Schema.NullOr(ExtraVerifiedApiKey),
|
|
132
|
+
}).annotate({
|
|
133
|
+
identifier: "ExtraVerifyApiKeyResponse",
|
|
134
|
+
title: "Extra verify API key response",
|
|
135
|
+
description: "Result of verifying a remote API key.",
|
|
136
|
+
});
|
|
137
|
+
export const ExtraOkResponse = Schema.Struct({
|
|
138
|
+
ok: Schema.Boolean,
|
|
139
|
+
}).annotate({
|
|
140
|
+
identifier: "ExtraOkResponse",
|
|
141
|
+
title: "Extra auth operation response",
|
|
142
|
+
description: "Successful response for custom auth actions.",
|
|
143
|
+
examples: [{ ok: true }],
|
|
144
|
+
});
|
|
145
|
+
export const ExtraPresignedUpload = Schema.Struct({
|
|
146
|
+
uploadUrl: Schema.String,
|
|
147
|
+
url: Schema.String,
|
|
148
|
+
}).annotate({
|
|
149
|
+
identifier: "ExtraPresignedUpload",
|
|
150
|
+
title: "Extra presigned upload",
|
|
151
|
+
description: "Presigned upload URL and stable public asset URL.",
|
|
152
|
+
});
|
|
153
|
+
export class ExtraBadRequest extends Schema.ErrorClass("ExtraBadRequest")({
|
|
154
|
+
_tag: Schema.tag("ExtraBadRequest"),
|
|
155
|
+
message: Schema.String,
|
|
156
|
+
}, {
|
|
157
|
+
identifier: "ExtraBadRequest",
|
|
158
|
+
title: "Extra bad request",
|
|
159
|
+
description: "The extra auth operation could not be completed.",
|
|
160
|
+
httpApiStatus: 400,
|
|
161
|
+
}) {
|
|
162
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./schema";
|
|
2
2
|
export { AuthClient, AuthClientConfig } from "./client";
|
|
3
3
|
export { OrganizationSwitcher, UserButton, type AuthUiClient, } from "./components";
|
|
4
|
-
export * as
|
|
5
|
-
export * as
|
|
4
|
+
export * as BetterAuth from "./better-auth";
|
|
5
|
+
export * as Extra from "./extra";
|
|
6
|
+
export * as Server from "./server";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./schema";
|
|
2
2
|
export { AuthClient, AuthClientConfig } from "./client";
|
|
3
3
|
export { OrganizationSwitcher, UserButton, } from "./components";
|
|
4
|
-
export * as
|
|
5
|
-
export * as
|
|
4
|
+
export * as BetterAuth from "./better-auth";
|
|
5
|
+
export * as Extra from "./extra";
|
|
6
|
+
export * as Server from "./server";
|
package/dist/schema.d.ts
CHANGED
|
@@ -10,6 +10,18 @@ export declare const User: Schema.Struct<{
|
|
|
10
10
|
readonly createdAt: Schema.Date;
|
|
11
11
|
readonly updatedAt: Schema.Date;
|
|
12
12
|
}>;
|
|
13
|
+
export declare const Session: Schema.Struct<{
|
|
14
|
+
readonly id: Schema.String;
|
|
15
|
+
readonly expiresAt: Schema.Date;
|
|
16
|
+
readonly token: Schema.String;
|
|
17
|
+
readonly createdAt: Schema.Date;
|
|
18
|
+
readonly updatedAt: Schema.Date;
|
|
19
|
+
readonly ipAddress: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
20
|
+
readonly userAgent: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
21
|
+
readonly userId: Schema.String;
|
|
22
|
+
readonly impersonatedBy: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
23
|
+
readonly activeOrganizationId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
24
|
+
}>;
|
|
13
25
|
export declare const OrganizationLocale: Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>;
|
|
14
26
|
export declare const OrganizationTranslation: Schema.Struct<{
|
|
15
27
|
readonly locale: Schema.Union<readonly [Schema.Literal<"en">, Schema.Literal<"fr">]>;
|
|
@@ -62,6 +74,7 @@ export declare const Member: Schema.Struct<{
|
|
|
62
74
|
}>;
|
|
63
75
|
}>;
|
|
64
76
|
export type User = typeof User.Type;
|
|
77
|
+
export type Session = typeof Session.Type;
|
|
65
78
|
export type OrganizationLocale = typeof OrganizationLocale.Type;
|
|
66
79
|
export type OrganizationTranslation = typeof OrganizationTranslation.Type;
|
|
67
80
|
export type OrganizationMetadata = typeof OrganizationMetadata.Type;
|
package/dist/schema.js
CHANGED
|
@@ -27,6 +27,36 @@ export const User = Schema.Struct({
|
|
|
27
27
|
},
|
|
28
28
|
],
|
|
29
29
|
});
|
|
30
|
+
export const Session = Schema.Struct({
|
|
31
|
+
id: Schema.String,
|
|
32
|
+
expiresAt: Schema.Date,
|
|
33
|
+
token: Schema.String,
|
|
34
|
+
createdAt: Schema.Date,
|
|
35
|
+
updatedAt: Schema.Date,
|
|
36
|
+
ipAddress: Schema.optional(Schema.NullOr(Schema.String)),
|
|
37
|
+
userAgent: Schema.optional(Schema.NullOr(Schema.String)),
|
|
38
|
+
userId: Schema.String,
|
|
39
|
+
impersonatedBy: Schema.optional(Schema.NullOr(Schema.String)),
|
|
40
|
+
activeOrganizationId: Schema.optional(Schema.NullOr(Schema.String)),
|
|
41
|
+
}).annotate({
|
|
42
|
+
identifier: "Session",
|
|
43
|
+
title: "Session",
|
|
44
|
+
description: "Current Better Auth browser session record.",
|
|
45
|
+
examples: [
|
|
46
|
+
{
|
|
47
|
+
id: "session_1",
|
|
48
|
+
expiresAt: new Date("2026-02-01T00:00:00.000Z"),
|
|
49
|
+
token: "session-token",
|
|
50
|
+
createdAt: new Date("2026-01-01T00:00:00.000Z"),
|
|
51
|
+
updatedAt: new Date("2026-01-01T00:00:00.000Z"),
|
|
52
|
+
ipAddress: "127.0.0.1",
|
|
53
|
+
userAgent: "Mozilla/5.0",
|
|
54
|
+
userId: "user_1",
|
|
55
|
+
impersonatedBy: null,
|
|
56
|
+
activeOrganizationId: "org_1",
|
|
57
|
+
},
|
|
58
|
+
],
|
|
59
|
+
});
|
|
30
60
|
export const OrganizationLocale = Schema.Union([
|
|
31
61
|
Schema.Literal("en"),
|
|
32
62
|
Schema.Literal("fr"),
|