@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.
@@ -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<import("effect/Schema").Struct.ReadonlySide<{
4
- readonly session: import("effect/Schema").Struct<{
5
- readonly id: import("effect/Schema").String;
6
- readonly expiresAt: import("effect/Schema").DateFromString;
7
- readonly token: import("effect/Schema").String;
8
- readonly createdAt: import("effect/Schema").DateFromString;
9
- readonly updatedAt: import("effect/Schema").DateFromString;
10
- readonly ipAddress: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
11
- readonly userAgent: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
12
- readonly userId: import("effect/Schema").String;
13
- readonly impersonatedBy: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
14
- readonly impersonatedByOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
15
- readonly activeOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
16
- }>;
17
- readonly user: import("effect/Schema").Struct<{
18
- readonly id: import("effect/Schema").String;
19
- readonly name: import("effect/Schema").String;
20
- readonly email: import("effect/Schema").String;
21
- readonly emailVerified: import("effect/Schema").Boolean;
22
- readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
23
- readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
24
- readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
25
- readonly banReason: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
26
- readonly banExpires: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").DateFromString>>;
27
- readonly twoFactorEnabled: import("effect/Schema").optional<import("effect/Schema").Boolean>;
28
- readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
29
- readonly createdAt: import("effect/Schema").DateFromString;
30
- readonly updatedAt: import("effect/Schema").DateFromString;
31
- }>;
32
- }, "Type"> | null, import("../auth/schema.js").AuthBadRequest>, Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<import("effect/unstable/reactivity/AsyncResult").AsyncResult<import("effect/Schema").Struct.ReadonlySide<{
33
- readonly session: import("effect/Schema").Struct<{
34
- readonly id: import("effect/Schema").String;
35
- readonly expiresAt: import("effect/Schema").DateFromString;
36
- readonly token: import("effect/Schema").String;
37
- readonly createdAt: import("effect/Schema").DateFromString;
38
- readonly updatedAt: import("effect/Schema").DateFromString;
39
- readonly ipAddress: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
40
- readonly userAgent: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
41
- readonly userId: import("effect/Schema").String;
42
- readonly impersonatedBy: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
43
- readonly impersonatedByOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
44
- readonly activeOrganizationId: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
45
- }>;
46
- readonly user: import("effect/Schema").Struct<{
47
- readonly id: import("effect/Schema").String;
48
- readonly name: import("effect/Schema").String;
49
- readonly email: import("effect/Schema").String;
50
- readonly emailVerified: import("effect/Schema").Boolean;
51
- readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
52
- readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
53
- readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
54
- readonly banReason: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
55
- readonly banExpires: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").DateFromString>>;
56
- readonly twoFactorEnabled: import("effect/Schema").optional<import("effect/Schema").Boolean>;
57
- readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
58
- readonly createdAt: import("effect/Schema").DateFromString;
59
- readonly updatedAt: import("effect/Schema").DateFromString;
60
- }>;
61
- }, "Type"> | null, import("../auth/schema.js").AuthBadRequest>, unknown>>>;
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 import("effect/Schema").Struct.ReadonlySide<{
97
- readonly id: import("effect/Schema").String;
98
- readonly organizationId: import("effect/Schema").String;
99
- readonly userId: import("effect/Schema").String;
100
- readonly role: import("effect/Schema").String;
101
- readonly createdAt: import("effect/Schema").DateFromString;
102
- readonly user: import("effect/Schema").Struct<{
103
- readonly id: import("effect/Schema").String;
104
- readonly name: import("effect/Schema").String;
105
- readonly email: import("effect/Schema").String;
106
- readonly emailVerified: import("effect/Schema").Boolean;
107
- readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
108
- readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
109
- readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
110
- readonly banReason: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
111
- readonly banExpires: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").DateFromString>>;
112
- readonly twoFactorEnabled: import("effect/Schema").optional<import("effect/Schema").Boolean>;
113
- readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
114
- readonly createdAt: import("effect/Schema").DateFromString;
115
- readonly updatedAt: import("effect/Schema").DateFromString;
116
- }>;
117
- }, "Type">[];
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 import("effect/Schema").Struct.ReadonlySide<{
142
- readonly id: import("effect/Schema").String;
143
- readonly organizationId: import("effect/Schema").String;
144
- readonly userId: import("effect/Schema").String;
145
- readonly role: import("effect/Schema").String;
146
- readonly createdAt: import("effect/Schema").DateFromString;
147
- readonly user: import("effect/Schema").Struct<{
148
- readonly id: import("effect/Schema").String;
149
- readonly name: import("effect/Schema").String;
150
- readonly email: import("effect/Schema").String;
151
- readonly emailVerified: import("effect/Schema").Boolean;
152
- readonly image: import("effect/Schema").NullOr<import("effect/Schema").String>;
153
- readonly role: import("effect/Schema").NullOr<import("effect/Schema").String>;
154
- readonly banned: import("effect/Schema").NullOr<import("effect/Schema").Boolean>;
155
- readonly banReason: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
156
- readonly banExpires: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").DateFromString>>;
157
- readonly twoFactorEnabled: import("effect/Schema").optional<import("effect/Schema").Boolean>;
158
- readonly lastLoginMethod: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").String>>;
159
- readonly createdAt: import("effect/Schema").DateFromString;
160
- readonly updatedAt: import("effect/Schema").DateFromString;
161
- }>;
162
- }, "Type">[];
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;