@krak-stack/auth 0.1.47 → 0.1.49
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 +22 -2
- package/dist/components/admin-organization-form.js +0 -1
- package/dist/components/admin-organizations.js +0 -1
- package/dist/components/admin-users.js +0 -1
- package/dist/components/auth-client-api.d.ts +132 -122
- package/dist/components/auth-client.d.ts +24 -55
- package/dist/components/auth-client.js +23 -12
- package/dist/components/auth-forms.js +15 -12
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -0
- package/dist/components/member-required.d.ts +43 -0
- package/dist/components/member-required.js +177 -0
- package/dist/components/organization-switcher.d.ts +12 -0
- package/dist/components/organization-switcher.js +118 -48
- package/dist/extra/api.group.d.ts +11 -1
- package/dist/extra/api.group.js +10 -1
- package/dist/extra/schema.d.ts +14 -0
- package/dist/extra/schema.js +32 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/service.d.ts +28 -0
- package/package.json +3 -3
|
@@ -10,7 +10,17 @@ export declare const ExtraApiGroup: HttpApiGroup.HttpApiGroup<"authExtra", HttpA
|
|
|
10
10
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
11
11
|
readonly id: import("effect/Schema").String;
|
|
12
12
|
readonly key: import("effect/Schema").String;
|
|
13
|
-
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"
|
|
13
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError | typeof ExtraBadRequest>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getOrganizationPublicProfile", "GET", "/auth/organization-profile", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
14
|
+
readonly organizationId: import("effect/Schema").String;
|
|
15
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<import("effect/Schema").Struct<{
|
|
16
|
+
readonly id: import("effect/Schema").String;
|
|
17
|
+
readonly name: import("effect/Schema").String;
|
|
18
|
+
readonly slug: import("effect/Schema").String;
|
|
19
|
+
readonly displayName: import("effect/Schema").String;
|
|
20
|
+
readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
21
|
+
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
22
|
+
readonly icon: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
23
|
+
}>>, HttpApiEndpoint.Json<typeof HttpApiError.NotFound | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getProjectPublicConfig", "GET", "/auth/project-config", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<import("effect/Schema").Struct<{
|
|
14
24
|
readonly projectId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
15
25
|
readonly clientId: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
16
26
|
readonly host: import("effect/Schema").optional<import("effect/Schema").String>;
|
package/dist/extra/api.group.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OpenApi } from "effect/unstable/httpapi";
|
|
2
2
|
import { HttpApiEndpoint, HttpApiError, HttpApiGroup, } from "effect/unstable/httpapi";
|
|
3
|
-
import { ExtraBadRequest, ExtraCreateApiKeyPayload, ExtraCreateApiKeyResponse, ExtraImageUploadMultipartPayload, ExtraOkResponse, ExtraProjectPublicConfig, ExtraProjectPublicConfigQuery, ExtraSetPasswordPayload, ExtraUploadedAsset, ExtraVerifyApiKeyPayload, ExtraVerifyApiKeyResponse, ExtraVerifyPasswordPayload, } from "./schema";
|
|
3
|
+
import { ExtraBadRequest, ExtraCreateApiKeyPayload, ExtraCreateApiKeyResponse, ExtraImageUploadMultipartPayload, ExtraOkResponse, ExtraOrganizationPublicProfile, ExtraOrganizationPublicProfileQuery, ExtraProjectPublicConfig, ExtraProjectPublicConfigQuery, ExtraSetPasswordPayload, ExtraUploadedAsset, ExtraVerifyApiKeyPayload, ExtraVerifyApiKeyResponse, ExtraVerifyPasswordPayload, } from "./schema";
|
|
4
4
|
export * from "./schema";
|
|
5
5
|
export const ExtraApiGroup = HttpApiGroup.make("authExtra")
|
|
6
6
|
.add(HttpApiEndpoint.get("getProjectPublicConfig", "/auth/project-config", {
|
|
@@ -11,6 +11,15 @@ export const ExtraApiGroup = HttpApiGroup.make("authExtra")
|
|
|
11
11
|
title: "Get project public config",
|
|
12
12
|
summary: "Get host-aware project white-label config",
|
|
13
13
|
description: "Returns resolved public branding and authentication options through the proxied auth API.",
|
|
14
|
+
})))
|
|
15
|
+
.add(HttpApiEndpoint.get("getOrganizationPublicProfile", "/auth/organization-profile", {
|
|
16
|
+
query: ExtraOrganizationPublicProfileQuery,
|
|
17
|
+
success: ExtraOrganizationPublicProfile,
|
|
18
|
+
error: [HttpApiError.NotFound, HttpApiError.InternalServerError],
|
|
19
|
+
}).annotateMerge(OpenApi.annotations({
|
|
20
|
+
title: "Get organization public profile",
|
|
21
|
+
summary: "Get public organization display metadata",
|
|
22
|
+
description: "Returns public organization metadata used by access and invitation screens.",
|
|
14
23
|
})))
|
|
15
24
|
.add(HttpApiEndpoint.post("setPassword", "/auth/set-password", {
|
|
16
25
|
payload: ExtraSetPasswordPayload,
|
package/dist/extra/schema.d.ts
CHANGED
|
@@ -97,6 +97,18 @@ export declare const ExtraProjectPublicConfig: Schema.Struct<{
|
|
|
97
97
|
readonly signUpName: Schema.Boolean;
|
|
98
98
|
}>;
|
|
99
99
|
}>;
|
|
100
|
+
export declare const ExtraOrganizationPublicProfileQuery: Schema.Struct<{
|
|
101
|
+
readonly organizationId: Schema.String;
|
|
102
|
+
}>;
|
|
103
|
+
export declare const ExtraOrganizationPublicProfile: Schema.Struct<{
|
|
104
|
+
readonly id: Schema.String;
|
|
105
|
+
readonly name: Schema.String;
|
|
106
|
+
readonly slug: Schema.String;
|
|
107
|
+
readonly displayName: Schema.String;
|
|
108
|
+
readonly contactEmail: Schema.NullOr<Schema.String>;
|
|
109
|
+
readonly logo: Schema.NullOr<Schema.String>;
|
|
110
|
+
readonly icon: Schema.NullOr<Schema.String>;
|
|
111
|
+
}>;
|
|
100
112
|
export declare const ExtraOkResponse: Schema.Struct<{
|
|
101
113
|
readonly ok: Schema.Boolean;
|
|
102
114
|
}>;
|
|
@@ -119,5 +131,7 @@ export type ExtraVerifyApiKeyPayload = typeof ExtraVerifyApiKeyPayload.Type;
|
|
|
119
131
|
export type ExtraVerifyApiKeyResponse = typeof ExtraVerifyApiKeyResponse.Type;
|
|
120
132
|
export type ExtraProjectPublicConfigQuery = typeof ExtraProjectPublicConfigQuery.Type;
|
|
121
133
|
export type ExtraProjectPublicConfig = typeof ExtraProjectPublicConfig.Type;
|
|
134
|
+
export type ExtraOrganizationPublicProfileQuery = typeof ExtraOrganizationPublicProfileQuery.Type;
|
|
135
|
+
export type ExtraOrganizationPublicProfile = typeof ExtraOrganizationPublicProfile.Type;
|
|
122
136
|
export type ExtraOkResponse = typeof ExtraOkResponse.Type;
|
|
123
137
|
export {};
|
package/dist/extra/schema.js
CHANGED
|
@@ -203,6 +203,38 @@ export const ExtraProjectPublicConfig = Schema.Struct({
|
|
|
203
203
|
},
|
|
204
204
|
],
|
|
205
205
|
});
|
|
206
|
+
export const ExtraOrganizationPublicProfileQuery = Schema.Struct({
|
|
207
|
+
organizationId: Schema.String,
|
|
208
|
+
}).annotate({
|
|
209
|
+
identifier: "ExtraOrganizationPublicProfileQuery",
|
|
210
|
+
title: "Extra organization public profile query",
|
|
211
|
+
description: "Organization ID used to resolve public organization display metadata.",
|
|
212
|
+
examples: [{ organizationId: "org_1" }],
|
|
213
|
+
});
|
|
214
|
+
export const ExtraOrganizationPublicProfile = Schema.Struct({
|
|
215
|
+
id: Schema.String,
|
|
216
|
+
name: Schema.String,
|
|
217
|
+
slug: Schema.String,
|
|
218
|
+
displayName: Schema.String,
|
|
219
|
+
contactEmail: Schema.NullOr(Schema.String),
|
|
220
|
+
logo: Schema.NullOr(Schema.String),
|
|
221
|
+
icon: Schema.NullOr(Schema.String),
|
|
222
|
+
}).annotate({
|
|
223
|
+
identifier: "ExtraOrganizationPublicProfile",
|
|
224
|
+
title: "Extra organization public profile",
|
|
225
|
+
description: "Public organization display metadata used for access and invitation screens.",
|
|
226
|
+
examples: [
|
|
227
|
+
{
|
|
228
|
+
id: "org_1",
|
|
229
|
+
name: "Krak",
|
|
230
|
+
slug: "krak",
|
|
231
|
+
displayName: "Krak",
|
|
232
|
+
contactEmail: null,
|
|
233
|
+
logo: null,
|
|
234
|
+
icon: null,
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
});
|
|
206
238
|
export const ExtraOkResponse = Schema.Struct({
|
|
207
239
|
ok: Schema.Boolean,
|
|
208
240
|
}).annotate({
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { AuthClientApi, AuthServiceApi } from "./api";
|
|
|
5
5
|
export { AuthService, type AuthServiceLayerOptions } from "./service";
|
|
6
6
|
export { AuthClientConfig } from "./config";
|
|
7
7
|
export { proxyAuthRequest } from "./server/proxy";
|
|
8
|
-
export { OrganizationSwitcher, KrakstackAuthProvider, ResetPassword, Signin, Signup, TwoFactor, AdminOrganizationForm, AdminOrganizationsTable, AdminUsersTable, UserButton, assetUrl, createAuthUiClient, type AuthUiClient, type KrakstackAuthContextValue, type KrakstackAuthLocale, type KrakstackAuthProviderProps, type OrganizationSwitcherDialog, type OrganizationSwitcherProps, type UserButtonDialog, useAuthClient, useAdminUsersTotal, } from "./components";
|
|
8
|
+
export { OrganizationSwitcher, MemberRequired, KrakstackAuthProvider, ResetPassword, Signin, Signup, TwoFactor, AdminOrganizationForm, AdminOrganizationsTable, AdminUsersTable, UserButton, assetUrl, createAuthUiClient, type AuthUiClient, type MemberRequiredMessages, type MemberRequiredProps, type KrakstackAuthContextValue, type KrakstackAuthLocale, type KrakstackAuthProviderProps, type OrganizationSwitcherDialog, type OrganizationSwitcherProps, type UserButtonDialog, useAuthClient, useAdminUsersTotal, } from "./components";
|
|
9
9
|
export * as BetterAuth from "./better-auth/api.group";
|
|
10
10
|
export * as Extra from "./extra/api.group";
|
|
11
11
|
export * as Server from "./server";
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { AuthClientApi, AuthServiceApi } from "./api";
|
|
|
5
5
|
export { AuthService } from "./service";
|
|
6
6
|
export { AuthClientConfig } from "./config";
|
|
7
7
|
export { proxyAuthRequest } from "./server/proxy";
|
|
8
|
-
export { OrganizationSwitcher, KrakstackAuthProvider, ResetPassword, Signin, Signup, TwoFactor, AdminOrganizationForm, AdminOrganizationsTable, AdminUsersTable, UserButton, assetUrl, createAuthUiClient, useAuthClient, useAdminUsersTotal, } from "./components";
|
|
8
|
+
export { OrganizationSwitcher, MemberRequired, KrakstackAuthProvider, ResetPassword, Signin, Signup, TwoFactor, AdminOrganizationForm, AdminOrganizationsTable, AdminUsersTable, UserButton, assetUrl, createAuthUiClient, useAuthClient, useAdminUsersTotal, } from "./components";
|
|
9
9
|
export * as BetterAuth from "./better-auth/api.group";
|
|
10
10
|
export * as Extra from "./extra/api.group";
|
|
11
11
|
export * as Server from "./server";
|
package/dist/service.d.ts
CHANGED
|
@@ -117,6 +117,20 @@ declare const AuthService_base: Context.ServiceClass<AuthService, "@krak-stack/a
|
|
|
117
117
|
readonly id: import("effect/Schema").String;
|
|
118
118
|
readonly key: import("effect/Schema").String;
|
|
119
119
|
}, "Type">, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("./extra/schema").ExtraBadRequest | HttpApiError.Forbidden | HttpApiError.InternalServerError | import("effect/Schema").SchemaError | HttpApiError.Unauthorized), [Mode] extends ["response-only"] ? never : never>;
|
|
120
|
+
readonly getOrganizationPublicProfile: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
121
|
+
readonly query: import("effect/Schema").Struct.ReadonlySide<{
|
|
122
|
+
readonly organizationId: import("effect/Schema").String;
|
|
123
|
+
}, "Type">;
|
|
124
|
+
readonly responseMode?: Mode;
|
|
125
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<import("effect/Schema").Struct.ReadonlySide<{
|
|
126
|
+
readonly id: import("effect/Schema").String;
|
|
127
|
+
readonly name: import("effect/Schema").String;
|
|
128
|
+
readonly slug: import("effect/Schema").String;
|
|
129
|
+
readonly displayName: import("effect/Schema").String;
|
|
130
|
+
readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
131
|
+
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
132
|
+
readonly icon: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
133
|
+
}, "Type">, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : HttpApiError.InternalServerError | HttpApiError.NotFound | import("effect/Schema").SchemaError), [Mode] extends ["response-only"] ? never : never>;
|
|
120
134
|
readonly getProjectPublicConfig: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
121
135
|
readonly query: {
|
|
122
136
|
readonly projectId?: string | undefined;
|
|
@@ -529,6 +543,20 @@ declare const AuthService_base: Context.ServiceClass<AuthService, "@krak-stack/a
|
|
|
529
543
|
readonly id: import("effect/Schema").String;
|
|
530
544
|
readonly key: import("effect/Schema").String;
|
|
531
545
|
}, "Type">, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : import("./extra/schema").ExtraBadRequest | HttpApiError.Forbidden | HttpApiError.InternalServerError | import("effect/Schema").SchemaError | HttpApiError.Unauthorized), [Mode] extends ["response-only"] ? never : never>;
|
|
546
|
+
readonly getOrganizationPublicProfile: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
547
|
+
readonly query: import("effect/Schema").Struct.ReadonlySide<{
|
|
548
|
+
readonly organizationId: import("effect/Schema").String;
|
|
549
|
+
}, "Type">;
|
|
550
|
+
readonly responseMode?: Mode;
|
|
551
|
+
}) => Effect.Effect<HttpApiClient.Client.Response<import("effect/Schema").Struct.ReadonlySide<{
|
|
552
|
+
readonly id: import("effect/Schema").String;
|
|
553
|
+
readonly name: import("effect/Schema").String;
|
|
554
|
+
readonly slug: import("effect/Schema").String;
|
|
555
|
+
readonly displayName: import("effect/Schema").String;
|
|
556
|
+
readonly contactEmail: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
557
|
+
readonly logo: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
558
|
+
readonly icon: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
559
|
+
}, "Type">, Mode>, import("effect/unstable/http/HttpClientError").HttpClientError | ([Mode] extends ["response-only"] ? never : HttpApiError.InternalServerError | HttpApiError.NotFound | import("effect/Schema").SchemaError), [Mode] extends ["response-only"] ? never : never>;
|
|
532
560
|
readonly getProjectPublicConfig: <Mode extends HttpApiClient.Client.ResponseMode = import("effect/unstable/httpapi/HttpApiEndpoint").ClientResponseMode>(request: {
|
|
533
561
|
readonly query: {
|
|
534
562
|
readonly projectId?: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krak-stack/auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.49",
|
|
4
4
|
"description": "Effect HttpApi clients and schemas for KrakStack Auth.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
62
|
"scripts": {
|
|
63
|
-
"build": "rm -rf dist && tsc -p tsconfig.json",
|
|
64
|
-
"build:watch": "rm -rf dist && tsc -p tsconfig.json --watch --preserveWatchOutput",
|
|
63
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
64
|
+
"build:watch": "rm -rf dist && tsc -p tsconfig.build.json --watch --preserveWatchOutput",
|
|
65
65
|
"dev": "bun run build:watch",
|
|
66
66
|
"prepack": "bun run build",
|
|
67
67
|
"type:check": "tsc -p tsconfig.json --noEmit"
|