@krak-stack/auth 0.2.0 → 0.2.1
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/access.d.ts +1 -3
- package/dist/access.js +1 -3
- package/dist/admin/api.group.d.ts +36 -36
- package/dist/admin/api.group.js +13 -13
- package/dist/api.d.ts +837 -837
- package/dist/auth/api.group.d.ts +86 -86
- package/dist/auth/api.group.js +8 -8
- package/dist/auth/schema.d.ts +48 -40
- package/dist/auth/schema.js +12 -9
- package/dist/components/admin-organization-form.js +1 -0
- package/dist/components/admin-organizations.d.ts +4 -5
- package/dist/components/admin-organizations.js +34 -31
- package/dist/components/admin-users.d.ts +5 -6
- package/dist/components/admin-users.js +51 -50
- package/dist/components/api-key-edit-form.js +2 -1
- package/dist/components/auth-atoms.d.ts +103 -103
- package/dist/components/auth-client-api.d.ts +834 -2351
- package/dist/components/auth-client-api.js +11 -7
- package/dist/components/auth-forms.js +6 -1
- package/dist/components/auth-provider.d.ts +13 -13
- package/dist/components/member-required.js +2 -2
- package/dist/components/organization-switcher.js +72 -69
- package/dist/components/user-button.js +31 -26
- package/dist/extra/api.group.d.ts +19 -19
- package/dist/extra/api.group.js +3 -3
- package/dist/extra/schema.d.ts +1 -2
- package/dist/extra/schema.js +1 -2
- package/dist/query.js +5 -5
- package/dist/server/api.group.d.ts +29 -29
- package/dist/server/api.group.js +12 -12
- package/dist/service.d.ts +1513 -1951
- package/package.json +4 -4
|
@@ -5,7 +5,7 @@ import { Effect, Schema } from "effect";
|
|
|
5
5
|
import { useRef, useState } from "react";
|
|
6
6
|
import { CheckboxField, SubmitButton, SubmitError, TextAreaField, TextField, } from "@krak-stack/registry/effect-form";
|
|
7
7
|
import { parseApiKeyReferrers } from "./api-key.js";
|
|
8
|
-
import { authHttpClient } from "./auth-client-api.js";
|
|
8
|
+
import { authClientApi, authHttpClient } from "./auth-client-api.js";
|
|
9
9
|
import { ApiKeyPermissions } from "./api-key-permissions.js";
|
|
10
10
|
import { apiKeyReferrers } from "./api-key-referrers.js";
|
|
11
11
|
import { ExtraApiKeyPermissions } from "../extra/schema.js";
|
|
@@ -32,6 +32,7 @@ export const ApiKeyEditForm = ({ baseUrl, configId, keyData, messages, permissio
|
|
|
32
32
|
permissionOptionsRef.current = permissionOptions;
|
|
33
33
|
permissionsRef.current = permissions;
|
|
34
34
|
const [form] = useState(() => FormReact.make(editApiKeyFormBuilder, {
|
|
35
|
+
runtime: authClientApi(baseUrl).runtime,
|
|
35
36
|
fields: {
|
|
36
37
|
name: TextField,
|
|
37
38
|
enabled: CheckboxField,
|
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
import { Atom } from "effect/unstable/reactivity";
|
|
2
2
|
export declare const AUTH_CLIENT_CHANGE_EVENT = "krakstack-auth:change";
|
|
3
|
-
export declare const authSessionAtom: (arg: string | undefined) => Atom.Writable<import("effect/unstable/reactivity/AsyncResult").AsyncResult<
|
|
4
|
-
readonly session:
|
|
5
|
-
readonly id:
|
|
6
|
-
readonly expiresAt:
|
|
7
|
-
readonly token:
|
|
8
|
-
readonly createdAt:
|
|
9
|
-
readonly updatedAt:
|
|
10
|
-
readonly ipAddress
|
|
11
|
-
readonly userAgent
|
|
12
|
-
readonly userId:
|
|
13
|
-
readonly impersonatedBy
|
|
14
|
-
readonly impersonatedByOrganizationId
|
|
15
|
-
readonly activeOrganizationId
|
|
16
|
-
}
|
|
17
|
-
readonly user:
|
|
18
|
-
readonly id:
|
|
19
|
-
readonly name:
|
|
20
|
-
readonly email:
|
|
21
|
-
readonly emailVerified:
|
|
22
|
-
readonly image:
|
|
23
|
-
readonly role:
|
|
24
|
-
readonly banned:
|
|
25
|
-
readonly banReason
|
|
26
|
-
readonly banExpires
|
|
27
|
-
readonly twoFactorEnabled
|
|
28
|
-
readonly lastLoginMethod
|
|
29
|
-
readonly createdAt:
|
|
30
|
-
readonly updatedAt:
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
readonly session:
|
|
34
|
-
readonly id:
|
|
35
|
-
readonly expiresAt:
|
|
36
|
-
readonly token:
|
|
37
|
-
readonly createdAt:
|
|
38
|
-
readonly updatedAt:
|
|
39
|
-
readonly ipAddress
|
|
40
|
-
readonly userAgent
|
|
41
|
-
readonly userId:
|
|
42
|
-
readonly impersonatedBy
|
|
43
|
-
readonly impersonatedByOrganizationId
|
|
44
|
-
readonly activeOrganizationId
|
|
45
|
-
}
|
|
46
|
-
readonly user:
|
|
47
|
-
readonly id:
|
|
48
|
-
readonly name:
|
|
49
|
-
readonly email:
|
|
50
|
-
readonly emailVerified:
|
|
51
|
-
readonly image:
|
|
52
|
-
readonly role:
|
|
53
|
-
readonly banned:
|
|
54
|
-
readonly banReason
|
|
55
|
-
readonly banExpires
|
|
56
|
-
readonly twoFactorEnabled
|
|
57
|
-
readonly lastLoginMethod
|
|
58
|
-
readonly createdAt:
|
|
59
|
-
readonly updatedAt:
|
|
60
|
-
}
|
|
61
|
-
}
|
|
3
|
+
export declare const authSessionAtom: (arg: string | undefined) => Atom.Writable<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
4
|
+
readonly session: {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly expiresAt: Date;
|
|
7
|
+
readonly token: string;
|
|
8
|
+
readonly createdAt: Date;
|
|
9
|
+
readonly updatedAt: Date;
|
|
10
|
+
readonly ipAddress?: string | null | undefined;
|
|
11
|
+
readonly userAgent?: string | null | undefined;
|
|
12
|
+
readonly userId: string;
|
|
13
|
+
readonly impersonatedBy?: string | null | undefined;
|
|
14
|
+
readonly impersonatedByOrganizationId?: string | null | undefined;
|
|
15
|
+
readonly activeOrganizationId?: string | null | undefined;
|
|
16
|
+
};
|
|
17
|
+
readonly user: {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly email: string;
|
|
21
|
+
readonly emailVerified: boolean;
|
|
22
|
+
readonly image: string | null;
|
|
23
|
+
readonly role: string | null;
|
|
24
|
+
readonly banned: boolean | null;
|
|
25
|
+
readonly banReason?: string | null | undefined;
|
|
26
|
+
readonly banExpires?: Date | null | undefined;
|
|
27
|
+
readonly twoFactorEnabled?: boolean | undefined;
|
|
28
|
+
readonly lastLoginMethod?: string | null | undefined;
|
|
29
|
+
readonly createdAt: Date;
|
|
30
|
+
readonly updatedAt: Date;
|
|
31
|
+
};
|
|
32
|
+
} | null, import("../auth/schema.js").AuthBadRequest>, Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
|
|
33
|
+
readonly session: {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly expiresAt: Date;
|
|
36
|
+
readonly token: string;
|
|
37
|
+
readonly createdAt: Date;
|
|
38
|
+
readonly updatedAt: Date;
|
|
39
|
+
readonly ipAddress?: string | null | undefined;
|
|
40
|
+
readonly userAgent?: string | null | undefined;
|
|
41
|
+
readonly userId: string;
|
|
42
|
+
readonly impersonatedBy?: string | null | undefined;
|
|
43
|
+
readonly impersonatedByOrganizationId?: string | null | undefined;
|
|
44
|
+
readonly activeOrganizationId?: string | null | undefined;
|
|
45
|
+
};
|
|
46
|
+
readonly user: {
|
|
47
|
+
readonly id: string;
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly email: string;
|
|
50
|
+
readonly emailVerified: boolean;
|
|
51
|
+
readonly image: string | null;
|
|
52
|
+
readonly role: string | null;
|
|
53
|
+
readonly banned: boolean | null;
|
|
54
|
+
readonly banReason?: string | null | undefined;
|
|
55
|
+
readonly banExpires?: Date | null | undefined;
|
|
56
|
+
readonly twoFactorEnabled?: boolean | undefined;
|
|
57
|
+
readonly lastLoginMethod?: string | null | undefined;
|
|
58
|
+
readonly createdAt: Date;
|
|
59
|
+
readonly updatedAt: Date;
|
|
60
|
+
};
|
|
61
|
+
} | null, import("../auth/schema.js").AuthBadRequest>, unknown>>>;
|
|
62
62
|
export declare const authOrganizationsAtom: (arg: string | undefined) => Atom.Writable<import("effect/unstable/reactivity/AsyncResult").AsyncResult<readonly {
|
|
63
63
|
readonly id: string;
|
|
64
64
|
readonly name: string;
|
|
@@ -93,28 +93,28 @@ export declare const activeAuthOrganizationAtom: (arg: string | undefined) => (a
|
|
|
93
93
|
readonly userId?: string | null | undefined;
|
|
94
94
|
readonly parentId?: string | null | undefined;
|
|
95
95
|
readonly createdAt: Date;
|
|
96
|
-
readonly members: readonly
|
|
97
|
-
readonly id:
|
|
98
|
-
readonly organizationId:
|
|
99
|
-
readonly userId:
|
|
100
|
-
readonly role:
|
|
101
|
-
readonly createdAt:
|
|
102
|
-
readonly user:
|
|
103
|
-
readonly id:
|
|
104
|
-
readonly name:
|
|
105
|
-
readonly email:
|
|
106
|
-
readonly emailVerified:
|
|
107
|
-
readonly image:
|
|
108
|
-
readonly role:
|
|
109
|
-
readonly banned:
|
|
110
|
-
readonly banReason
|
|
111
|
-
readonly banExpires
|
|
112
|
-
readonly twoFactorEnabled
|
|
113
|
-
readonly lastLoginMethod
|
|
114
|
-
readonly createdAt:
|
|
115
|
-
readonly updatedAt:
|
|
116
|
-
}
|
|
117
|
-
}
|
|
96
|
+
readonly members: readonly {
|
|
97
|
+
readonly id: string;
|
|
98
|
+
readonly organizationId: string;
|
|
99
|
+
readonly userId: string;
|
|
100
|
+
readonly role: string;
|
|
101
|
+
readonly createdAt: Date;
|
|
102
|
+
readonly user: {
|
|
103
|
+
readonly id: string;
|
|
104
|
+
readonly name: string;
|
|
105
|
+
readonly email: string;
|
|
106
|
+
readonly emailVerified: boolean;
|
|
107
|
+
readonly image: string | null;
|
|
108
|
+
readonly role: string | null;
|
|
109
|
+
readonly banned: boolean | null;
|
|
110
|
+
readonly banReason?: string | null | undefined;
|
|
111
|
+
readonly banExpires?: Date | null | undefined;
|
|
112
|
+
readonly twoFactorEnabled?: boolean | undefined;
|
|
113
|
+
readonly lastLoginMethod?: string | null | undefined;
|
|
114
|
+
readonly createdAt: Date;
|
|
115
|
+
readonly updatedAt: Date;
|
|
116
|
+
};
|
|
117
|
+
}[];
|
|
118
118
|
readonly invitations: readonly {
|
|
119
119
|
readonly id: string;
|
|
120
120
|
readonly email: string;
|
|
@@ -138,28 +138,28 @@ export declare const activeAuthOrganizationAtom: (arg: string | undefined) => (a
|
|
|
138
138
|
readonly userId?: string | null | undefined;
|
|
139
139
|
readonly parentId?: string | null | undefined;
|
|
140
140
|
readonly createdAt: Date;
|
|
141
|
-
readonly members: readonly
|
|
142
|
-
readonly id:
|
|
143
|
-
readonly organizationId:
|
|
144
|
-
readonly userId:
|
|
145
|
-
readonly role:
|
|
146
|
-
readonly createdAt:
|
|
147
|
-
readonly user:
|
|
148
|
-
readonly id:
|
|
149
|
-
readonly name:
|
|
150
|
-
readonly email:
|
|
151
|
-
readonly emailVerified:
|
|
152
|
-
readonly image:
|
|
153
|
-
readonly role:
|
|
154
|
-
readonly banned:
|
|
155
|
-
readonly banReason
|
|
156
|
-
readonly banExpires
|
|
157
|
-
readonly twoFactorEnabled
|
|
158
|
-
readonly lastLoginMethod
|
|
159
|
-
readonly createdAt:
|
|
160
|
-
readonly updatedAt:
|
|
161
|
-
}
|
|
162
|
-
}
|
|
141
|
+
readonly members: readonly {
|
|
142
|
+
readonly id: string;
|
|
143
|
+
readonly organizationId: string;
|
|
144
|
+
readonly userId: string;
|
|
145
|
+
readonly role: string;
|
|
146
|
+
readonly createdAt: Date;
|
|
147
|
+
readonly user: {
|
|
148
|
+
readonly id: string;
|
|
149
|
+
readonly name: string;
|
|
150
|
+
readonly email: string;
|
|
151
|
+
readonly emailVerified: boolean;
|
|
152
|
+
readonly image: string | null;
|
|
153
|
+
readonly role: string | null;
|
|
154
|
+
readonly banned: boolean | null;
|
|
155
|
+
readonly banReason?: string | null | undefined;
|
|
156
|
+
readonly banExpires?: Date | null | undefined;
|
|
157
|
+
readonly twoFactorEnabled?: boolean | undefined;
|
|
158
|
+
readonly lastLoginMethod?: string | null | undefined;
|
|
159
|
+
readonly createdAt: Date;
|
|
160
|
+
readonly updatedAt: Date;
|
|
161
|
+
};
|
|
162
|
+
}[];
|
|
163
163
|
readonly invitations: readonly {
|
|
164
164
|
readonly id: string;
|
|
165
165
|
readonly email: string;
|