@krak-stack/auth 0.2.0 → 0.2.2

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.
Files changed (38) hide show
  1. package/dist/access.d.ts +1 -3
  2. package/dist/access.js +1 -3
  3. package/dist/admin/api.group.d.ts +36 -36
  4. package/dist/admin/api.group.js +13 -13
  5. package/dist/api.d.ts +2109 -865
  6. package/dist/auth/api.group.d.ts +664 -106
  7. package/dist/auth/api.group.js +8 -8
  8. package/dist/auth/schema.d.ts +537 -70
  9. package/dist/auth/schema.js +26 -10
  10. package/dist/components/admin-organization-form.js +1 -0
  11. package/dist/components/admin-organizations.d.ts +4 -5
  12. package/dist/components/admin-organizations.js +34 -31
  13. package/dist/components/admin-users.d.ts +5 -6
  14. package/dist/components/admin-users.js +51 -50
  15. package/dist/components/api-key-edit-form.js +2 -1
  16. package/dist/components/auth-atoms.d.ts +213 -103
  17. package/dist/components/auth-client-api.d.ts +1412 -2371
  18. package/dist/components/auth-client-api.js +11 -7
  19. package/dist/components/auth-forms.js +6 -1
  20. package/dist/components/auth-provider.d.ts +13 -13
  21. package/dist/components/contact-fields.d.ts +40 -0
  22. package/dist/components/contact-fields.js +86 -0
  23. package/dist/components/member-required.js +2 -2
  24. package/dist/components/organization-switcher.js +101 -193
  25. package/dist/components/user-button.d.ts +73 -0
  26. package/dist/components/user-button.js +179 -29
  27. package/dist/extra/api.group.d.ts +19 -19
  28. package/dist/extra/api.group.js +3 -3
  29. package/dist/extra/schema.d.ts +1 -2
  30. package/dist/extra/schema.js +1 -2
  31. package/dist/query.js +5 -5
  32. package/dist/schema.d.ts +279 -12
  33. package/dist/schema.js +162 -42
  34. package/dist/server/api.group.d.ts +157 -29
  35. package/dist/server/api.group.js +12 -12
  36. package/dist/server/schema.d.ts +64 -0
  37. package/dist/service.d.ts +3380 -2446
  38. package/package.json +4 -4
@@ -1,64 +1,128 @@
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 metadata?: {
24
+ readonly emails?: readonly {
25
+ readonly email: string;
26
+ readonly translations: readonly {
27
+ readonly locale: "en" | "fr";
28
+ readonly label: string;
29
+ }[];
30
+ }[] | undefined;
31
+ readonly phones?: readonly {
32
+ readonly number: string;
33
+ readonly extension?: string | undefined;
34
+ readonly translations: readonly {
35
+ readonly locale: "en" | "fr";
36
+ readonly label: string;
37
+ }[];
38
+ }[] | undefined;
39
+ readonly websites?: readonly {
40
+ readonly url: string;
41
+ readonly translations: readonly {
42
+ readonly locale: "en" | "fr";
43
+ readonly label: string;
44
+ }[];
45
+ }[] | undefined;
46
+ readonly socials?: readonly {
47
+ readonly platform: "facebook" | "github" | "instagram" | "linkedin" | "tiktok" | "x" | "youtube";
48
+ readonly url: string;
49
+ readonly translations: readonly {
50
+ readonly locale: "en" | "fr";
51
+ readonly label: string;
52
+ }[];
53
+ }[] | undefined;
54
+ } | null | undefined;
55
+ readonly role: string | null;
56
+ readonly banned: boolean | null;
57
+ readonly banReason?: string | null | undefined;
58
+ readonly banExpires?: Date | null | undefined;
59
+ readonly twoFactorEnabled?: boolean | undefined;
60
+ readonly lastLoginMethod?: string | null | undefined;
61
+ readonly createdAt: Date;
62
+ readonly updatedAt: Date;
63
+ };
64
+ } | null, import("../auth/schema.js").AuthBadRequest>, Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
65
+ readonly session: {
66
+ readonly id: string;
67
+ readonly expiresAt: Date;
68
+ readonly token: string;
69
+ readonly createdAt: Date;
70
+ readonly updatedAt: Date;
71
+ readonly ipAddress?: string | null | undefined;
72
+ readonly userAgent?: string | null | undefined;
73
+ readonly userId: string;
74
+ readonly impersonatedBy?: string | null | undefined;
75
+ readonly impersonatedByOrganizationId?: string | null | undefined;
76
+ readonly activeOrganizationId?: string | null | undefined;
77
+ };
78
+ readonly user: {
79
+ readonly id: string;
80
+ readonly name: string;
81
+ readonly email: string;
82
+ readonly emailVerified: boolean;
83
+ readonly image: string | null;
84
+ readonly metadata?: {
85
+ readonly emails?: readonly {
86
+ readonly email: string;
87
+ readonly translations: readonly {
88
+ readonly locale: "en" | "fr";
89
+ readonly label: string;
90
+ }[];
91
+ }[] | undefined;
92
+ readonly phones?: readonly {
93
+ readonly number: string;
94
+ readonly extension?: string | undefined;
95
+ readonly translations: readonly {
96
+ readonly locale: "en" | "fr";
97
+ readonly label: string;
98
+ }[];
99
+ }[] | undefined;
100
+ readonly websites?: readonly {
101
+ readonly url: string;
102
+ readonly translations: readonly {
103
+ readonly locale: "en" | "fr";
104
+ readonly label: string;
105
+ }[];
106
+ }[] | undefined;
107
+ readonly socials?: readonly {
108
+ readonly platform: "facebook" | "github" | "instagram" | "linkedin" | "tiktok" | "x" | "youtube";
109
+ readonly url: string;
110
+ readonly translations: readonly {
111
+ readonly locale: "en" | "fr";
112
+ readonly label: string;
113
+ }[];
114
+ }[] | undefined;
115
+ } | null | undefined;
116
+ readonly role: string | null;
117
+ readonly banned: boolean | null;
118
+ readonly banReason?: string | null | undefined;
119
+ readonly banExpires?: Date | null | undefined;
120
+ readonly twoFactorEnabled?: boolean | undefined;
121
+ readonly lastLoginMethod?: string | null | undefined;
122
+ readonly createdAt: Date;
123
+ readonly updatedAt: Date;
124
+ };
125
+ } | null, import("../auth/schema.js").AuthBadRequest>, unknown>>>;
62
126
  export declare const authOrganizationsAtom: (arg: string | undefined) => Atom.Writable<import("effect/unstable/reactivity/AsyncResult").AsyncResult<readonly {
63
127
  readonly id: string;
64
128
  readonly name: string;
@@ -93,28 +157,51 @@ export declare const activeAuthOrganizationAtom: (arg: string | undefined) => (a
93
157
  readonly userId?: string | null | undefined;
94
158
  readonly parentId?: string | null | undefined;
95
159
  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">[];
160
+ readonly members: readonly {
161
+ readonly id: string;
162
+ readonly organizationId: string;
163
+ readonly userId: string;
164
+ readonly role: string;
165
+ readonly createdAt: Date;
166
+ readonly user: {
167
+ readonly id: string;
168
+ readonly name: string;
169
+ readonly email: string;
170
+ readonly image?: string | null | undefined;
171
+ readonly metadata?: {
172
+ readonly emails?: readonly {
173
+ readonly email: string;
174
+ readonly translations: readonly {
175
+ readonly locale: "en" | "fr";
176
+ readonly label: string;
177
+ }[];
178
+ }[] | undefined;
179
+ readonly phones?: readonly {
180
+ readonly number: string;
181
+ readonly extension?: string | undefined;
182
+ readonly translations: readonly {
183
+ readonly locale: "en" | "fr";
184
+ readonly label: string;
185
+ }[];
186
+ }[] | undefined;
187
+ readonly websites?: readonly {
188
+ readonly url: string;
189
+ readonly translations: readonly {
190
+ readonly locale: "en" | "fr";
191
+ readonly label: string;
192
+ }[];
193
+ }[] | undefined;
194
+ readonly socials?: readonly {
195
+ readonly platform: "facebook" | "github" | "instagram" | "linkedin" | "tiktok" | "x" | "youtube";
196
+ readonly url: string;
197
+ readonly translations: readonly {
198
+ readonly locale: "en" | "fr";
199
+ readonly label: string;
200
+ }[];
201
+ }[] | undefined;
202
+ } | null | undefined;
203
+ };
204
+ }[];
118
205
  readonly invitations: readonly {
119
206
  readonly id: string;
120
207
  readonly email: string;
@@ -138,28 +225,51 @@ export declare const activeAuthOrganizationAtom: (arg: string | undefined) => (a
138
225
  readonly userId?: string | null | undefined;
139
226
  readonly parentId?: string | null | undefined;
140
227
  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">[];
228
+ readonly members: readonly {
229
+ readonly id: string;
230
+ readonly organizationId: string;
231
+ readonly userId: string;
232
+ readonly role: string;
233
+ readonly createdAt: Date;
234
+ readonly user: {
235
+ readonly id: string;
236
+ readonly name: string;
237
+ readonly email: string;
238
+ readonly image?: string | null | undefined;
239
+ readonly metadata?: {
240
+ readonly emails?: readonly {
241
+ readonly email: string;
242
+ readonly translations: readonly {
243
+ readonly locale: "en" | "fr";
244
+ readonly label: string;
245
+ }[];
246
+ }[] | undefined;
247
+ readonly phones?: readonly {
248
+ readonly number: string;
249
+ readonly extension?: string | undefined;
250
+ readonly translations: readonly {
251
+ readonly locale: "en" | "fr";
252
+ readonly label: string;
253
+ }[];
254
+ }[] | undefined;
255
+ readonly websites?: readonly {
256
+ readonly url: string;
257
+ readonly translations: readonly {
258
+ readonly locale: "en" | "fr";
259
+ readonly label: string;
260
+ }[];
261
+ }[] | undefined;
262
+ readonly socials?: readonly {
263
+ readonly platform: "facebook" | "github" | "instagram" | "linkedin" | "tiktok" | "x" | "youtube";
264
+ readonly url: string;
265
+ readonly translations: readonly {
266
+ readonly locale: "en" | "fr";
267
+ readonly label: string;
268
+ }[];
269
+ }[] | undefined;
270
+ } | null | undefined;
271
+ };
272
+ }[];
163
273
  readonly invitations: readonly {
164
274
  readonly id: string;
165
275
  readonly email: string;