@krak-stack/auth 0.2.32 → 0.3.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/CHANGELOG.md +14 -0
- package/README.md +101 -5
- package/dist/access.d.ts +3 -1
- package/dist/admin/api.group.d.ts +41 -41
- package/dist/admin/schema.d.ts +23 -23
- package/dist/admin/schema.js +21 -19
- package/dist/api.d.ts +126 -77
- package/dist/auth/api.group.d.ts +18 -18
- package/dist/auth/schema.d.ts +49 -33
- package/dist/auth/schema.js +18 -18
- package/dist/components/admin-organization-form.js +2 -2
- package/dist/components/admin-organizations.js +6 -5
- package/dist/components/admin-users.js +6 -6
- package/dist/components/api-key-edit-form.js +19 -11
- package/dist/components/associated-projects-notice.d.ts +2 -1
- package/dist/components/associated-projects-notice.js +6 -2
- package/dist/components/auth-atoms.js +1 -2
- package/dist/components/auth-client-api.d.ts +61 -61
- package/dist/components/auth-forms.d.ts +1 -0
- package/dist/components/auth-forms.js +41 -56
- package/dist/components/auth-provider.d.ts +3 -1
- package/dist/components/hooks.d.ts +2 -0
- package/dist/components/hooks.js +13 -6
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +2 -0
- package/dist/components/member-required.js +3 -5
- package/dist/components/oauth-consent.d.ts +22 -0
- package/dist/components/oauth-consent.js +79 -0
- package/dist/components/organization-switcher.d.ts +1 -1
- package/dist/components/organization-switcher.js +83 -54
- package/dist/components/project-card-list.d.ts +6 -0
- package/dist/components/project-card-list.js +4 -0
- package/dist/components/user-button.js +115 -54
- package/dist/extra/schema.d.ts +3 -1
- package/dist/oauth/authorization.d.ts +3 -0
- package/dist/oauth/authorization.js +39 -0
- package/dist/oauth/schema.d.ts +24 -0
- package/dist/oauth/schema.js +12 -0
- package/dist/oauth/verify.d.ts +13 -0
- package/dist/oauth/verify.js +67 -0
- package/dist/schema.js +1 -1
- package/dist/server/actor.js +2 -4
- package/dist/server/api.group.d.ts +49 -0
- package/dist/server/api.group.js +10 -1
- package/dist/server/index.d.ts +3 -1
- package/dist/server/index.js +2 -1
- package/dist/server/mcp.d.ts +20 -0
- package/dist/server/mcp.js +66 -0
- package/dist/server/middleware.d.ts +5 -5
- package/dist/server/middleware.js +15 -5
- package/dist/server/schema.d.ts +51 -0
- package/dist/server/schema.js +7 -0
- package/dist/server/webhook-layer.js +8 -4
- package/dist/server/webhooks.d.ts +9 -3
- package/dist/service.d.ts +152 -46
- package/dist/service.js +56 -9
- package/package.json +2 -1
package/dist/auth/schema.d.ts
CHANGED
|
@@ -219,7 +219,9 @@ declare const AuthBadRequest_base: Schema.Class<AuthBadRequest, Schema.TaggedStr
|
|
|
219
219
|
error: Schema.optional<Schema.String>;
|
|
220
220
|
error_description: Schema.optional<Schema.String>;
|
|
221
221
|
_tag: Schema.withDecodingDefaultKey<Schema.tag<"AuthBadRequest">, never>;
|
|
222
|
-
}>, import("effect/Cause").YieldableError
|
|
222
|
+
}>, import("effect/Cause").YieldableError & {
|
|
223
|
+
readonly brand: unique symbol;
|
|
224
|
+
}>;
|
|
223
225
|
export declare class AuthBadRequest extends AuthBadRequest_base {
|
|
224
226
|
}
|
|
225
227
|
declare const AuthUnauthorized_base: Schema.Class<AuthUnauthorized, Schema.TaggedStruct<"AuthUnauthorized", {
|
|
@@ -228,7 +230,9 @@ declare const AuthUnauthorized_base: Schema.Class<AuthUnauthorized, Schema.Tagge
|
|
|
228
230
|
error: Schema.optional<Schema.String>;
|
|
229
231
|
error_description: Schema.optional<Schema.String>;
|
|
230
232
|
_tag: Schema.withDecodingDefaultKey<Schema.tag<"AuthUnauthorized">, never>;
|
|
231
|
-
}>, import("effect/Cause").YieldableError
|
|
233
|
+
}>, import("effect/Cause").YieldableError & {
|
|
234
|
+
readonly brand: unique symbol;
|
|
235
|
+
}>;
|
|
232
236
|
export declare class AuthUnauthorized extends AuthUnauthorized_base {
|
|
233
237
|
}
|
|
234
238
|
declare const AuthForbidden_base: Schema.Class<AuthForbidden, Schema.TaggedStruct<"AuthForbidden", {
|
|
@@ -237,7 +241,9 @@ declare const AuthForbidden_base: Schema.Class<AuthForbidden, Schema.TaggedStruc
|
|
|
237
241
|
error: Schema.optional<Schema.String>;
|
|
238
242
|
error_description: Schema.optional<Schema.String>;
|
|
239
243
|
_tag: Schema.withDecodingDefaultKey<Schema.tag<"AuthForbidden">, never>;
|
|
240
|
-
}>, import("effect/Cause").YieldableError
|
|
244
|
+
}>, import("effect/Cause").YieldableError & {
|
|
245
|
+
readonly brand: unique symbol;
|
|
246
|
+
}>;
|
|
241
247
|
export declare class AuthForbidden extends AuthForbidden_base {
|
|
242
248
|
}
|
|
243
249
|
declare const AuthNotFound_base: Schema.Class<AuthNotFound, Schema.TaggedStruct<"AuthNotFound", {
|
|
@@ -246,7 +252,9 @@ declare const AuthNotFound_base: Schema.Class<AuthNotFound, Schema.TaggedStruct<
|
|
|
246
252
|
error: Schema.optional<Schema.String>;
|
|
247
253
|
error_description: Schema.optional<Schema.String>;
|
|
248
254
|
_tag: Schema.withDecodingDefaultKey<Schema.tag<"AuthNotFound">, never>;
|
|
249
|
-
}>, import("effect/Cause").YieldableError
|
|
255
|
+
}>, import("effect/Cause").YieldableError & {
|
|
256
|
+
readonly brand: unique symbol;
|
|
257
|
+
}>;
|
|
250
258
|
export declare class AuthNotFound extends AuthNotFound_base {
|
|
251
259
|
}
|
|
252
260
|
declare const AuthConflict_base: Schema.Class<AuthConflict, Schema.TaggedStruct<"AuthConflict", {
|
|
@@ -255,7 +263,9 @@ declare const AuthConflict_base: Schema.Class<AuthConflict, Schema.TaggedStruct<
|
|
|
255
263
|
error: Schema.optional<Schema.String>;
|
|
256
264
|
error_description: Schema.optional<Schema.String>;
|
|
257
265
|
_tag: Schema.withDecodingDefaultKey<Schema.tag<"AuthConflict">, never>;
|
|
258
|
-
}>, import("effect/Cause").YieldableError
|
|
266
|
+
}>, import("effect/Cause").YieldableError & {
|
|
267
|
+
readonly brand: unique symbol;
|
|
268
|
+
}>;
|
|
259
269
|
export declare class AuthConflict extends AuthConflict_base {
|
|
260
270
|
}
|
|
261
271
|
declare const AuthExpectationFailed_base: Schema.Class<AuthExpectationFailed, Schema.TaggedStruct<"AuthExpectationFailed", {
|
|
@@ -264,7 +274,9 @@ declare const AuthExpectationFailed_base: Schema.Class<AuthExpectationFailed, Sc
|
|
|
264
274
|
error: Schema.optional<Schema.String>;
|
|
265
275
|
error_description: Schema.optional<Schema.String>;
|
|
266
276
|
_tag: Schema.withDecodingDefaultKey<Schema.tag<"AuthExpectationFailed">, never>;
|
|
267
|
-
}>, import("effect/Cause").YieldableError
|
|
277
|
+
}>, import("effect/Cause").YieldableError & {
|
|
278
|
+
readonly brand: unique symbol;
|
|
279
|
+
}>;
|
|
268
280
|
export declare class AuthExpectationFailed extends AuthExpectationFailed_base {
|
|
269
281
|
}
|
|
270
282
|
declare const AuthTooManyRequests_base: Schema.Class<AuthTooManyRequests, Schema.TaggedStruct<"AuthTooManyRequests", {
|
|
@@ -273,7 +285,9 @@ declare const AuthTooManyRequests_base: Schema.Class<AuthTooManyRequests, Schema
|
|
|
273
285
|
error: Schema.optional<Schema.String>;
|
|
274
286
|
error_description: Schema.optional<Schema.String>;
|
|
275
287
|
_tag: Schema.withDecodingDefaultKey<Schema.tag<"AuthTooManyRequests">, never>;
|
|
276
|
-
}>, import("effect/Cause").YieldableError
|
|
288
|
+
}>, import("effect/Cause").YieldableError & {
|
|
289
|
+
readonly brand: unique symbol;
|
|
290
|
+
}>;
|
|
277
291
|
export declare class AuthTooManyRequests extends AuthTooManyRequests_base {
|
|
278
292
|
}
|
|
279
293
|
declare const AuthInternalServerError_base: Schema.Class<AuthInternalServerError, Schema.TaggedStruct<"AuthInternalServerError", {
|
|
@@ -282,7 +296,9 @@ declare const AuthInternalServerError_base: Schema.Class<AuthInternalServerError
|
|
|
282
296
|
error: Schema.optional<Schema.String>;
|
|
283
297
|
error_description: Schema.optional<Schema.String>;
|
|
284
298
|
_tag: Schema.withDecodingDefaultKey<Schema.tag<"AuthInternalServerError">, never>;
|
|
285
|
-
}>, import("effect/Cause").YieldableError
|
|
299
|
+
}>, import("effect/Cause").YieldableError & {
|
|
300
|
+
readonly brand: unique symbol;
|
|
301
|
+
}>;
|
|
286
302
|
export declare class AuthInternalServerError extends AuthInternalServerError_base {
|
|
287
303
|
}
|
|
288
304
|
export declare const UpdateUserPayload: Schema.Struct<{
|
|
@@ -448,7 +464,7 @@ export declare const SocialIdToken: Schema.Struct<{
|
|
|
448
464
|
readonly nonce: Schema.optional<Schema.String>;
|
|
449
465
|
readonly accessToken: Schema.optional<Schema.String>;
|
|
450
466
|
readonly refreshToken: Schema.optional<Schema.String>;
|
|
451
|
-
readonly expiresAt: Schema.optional<Schema.
|
|
467
|
+
readonly expiresAt: Schema.optional<Schema.Finite>;
|
|
452
468
|
readonly user: Schema.optional<Schema.Struct<{
|
|
453
469
|
readonly name: Schema.optional<Schema.Struct<{
|
|
454
470
|
readonly firstName: Schema.optional<Schema.String>;
|
|
@@ -468,7 +484,7 @@ export declare const SignInSocialPayload: Schema.Struct<{
|
|
|
468
484
|
readonly nonce: Schema.optional<Schema.String>;
|
|
469
485
|
readonly accessToken: Schema.optional<Schema.String>;
|
|
470
486
|
readonly refreshToken: Schema.optional<Schema.String>;
|
|
471
|
-
readonly expiresAt: Schema.optional<Schema.
|
|
487
|
+
readonly expiresAt: Schema.optional<Schema.Finite>;
|
|
472
488
|
readonly user: Schema.optional<Schema.Struct<{
|
|
473
489
|
readonly name: Schema.optional<Schema.Struct<{
|
|
474
490
|
readonly firstName: Schema.optional<Schema.String>;
|
|
@@ -901,7 +917,7 @@ export declare const FullAuthOrganization: Schema.Struct<{
|
|
|
901
917
|
export declare const GetFullOrganizationQuery: Schema.Struct<{
|
|
902
918
|
readonly organizationId: Schema.optional<Schema.String>;
|
|
903
919
|
readonly organizationSlug: Schema.optional<Schema.String>;
|
|
904
|
-
readonly membersLimit: Schema.optional<Schema.
|
|
920
|
+
readonly membersLimit: Schema.optional<Schema.FiniteFromString>;
|
|
905
921
|
}>;
|
|
906
922
|
export declare const SetActiveOrganizationPayload: Schema.Struct<{
|
|
907
923
|
readonly organizationId: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
@@ -926,8 +942,8 @@ export declare const UpdateOrganizationPayload: Schema.Struct<{
|
|
|
926
942
|
}>;
|
|
927
943
|
}>;
|
|
928
944
|
export declare const OrganizationListMembersQuery: Schema.Struct<{
|
|
929
|
-
readonly limit: Schema.optional<Schema.
|
|
930
|
-
readonly offset: Schema.optional<Schema.
|
|
945
|
+
readonly limit: Schema.optional<Schema.FiniteFromString>;
|
|
946
|
+
readonly offset: Schema.optional<Schema.FiniteFromString>;
|
|
931
947
|
readonly sortBy: Schema.optional<Schema.String>;
|
|
932
948
|
readonly sortDirection: Schema.optional<Schema.Literals<readonly ["asc", "desc"]>>;
|
|
933
949
|
readonly filterField: Schema.optional<Schema.String>;
|
|
@@ -982,7 +998,7 @@ export declare const OrganizationListMembersResponse: Schema.Struct<{
|
|
|
982
998
|
}>, Schema.Unknown, never, never>>>;
|
|
983
999
|
}>;
|
|
984
1000
|
}>>;
|
|
985
|
-
readonly total: Schema.
|
|
1001
|
+
readonly total: Schema.Finite;
|
|
986
1002
|
}>;
|
|
987
1003
|
export declare const InviteMemberPayload: Schema.Struct<{
|
|
988
1004
|
readonly email: Schema.String;
|
|
@@ -1064,7 +1080,7 @@ export declare const OrganizationImpersonateUserPayload: Schema.Struct<{
|
|
|
1064
1080
|
readonly organizationId: Schema.NonEmptyString;
|
|
1065
1081
|
readonly actorUserId: Schema.NonEmptyString;
|
|
1066
1082
|
readonly targetUserId: Schema.NonEmptyString;
|
|
1067
|
-
readonly expiresInSeconds: Schema.optional<Schema.
|
|
1083
|
+
readonly expiresInSeconds: Schema.optional<Schema.Finite>;
|
|
1068
1084
|
}>;
|
|
1069
1085
|
export declare const OrganizationImpersonateUserResponse: Schema.Struct<{
|
|
1070
1086
|
readonly session: Schema.Struct<{
|
|
@@ -1137,15 +1153,15 @@ export declare const AuthApiKey: Schema.Struct<{
|
|
|
1137
1153
|
readonly userId: Schema.optional<Schema.String>;
|
|
1138
1154
|
readonly referenceId: Schema.String;
|
|
1139
1155
|
readonly configId: Schema.String;
|
|
1140
|
-
readonly refillInterval: Schema.NullOr<Schema.
|
|
1141
|
-
readonly refillAmount: Schema.NullOr<Schema.
|
|
1156
|
+
readonly refillInterval: Schema.NullOr<Schema.Finite>;
|
|
1157
|
+
readonly refillAmount: Schema.NullOr<Schema.Finite>;
|
|
1142
1158
|
readonly lastRefillAt: Schema.NullOr<Schema.DateFromString>;
|
|
1143
1159
|
readonly enabled: Schema.Boolean;
|
|
1144
1160
|
readonly rateLimitEnabled: Schema.Boolean;
|
|
1145
|
-
readonly rateLimitTimeWindow: Schema.NullOr<Schema.
|
|
1146
|
-
readonly rateLimitMax: Schema.NullOr<Schema.
|
|
1147
|
-
readonly requestCount: Schema.
|
|
1148
|
-
readonly remaining: Schema.NullOr<Schema.
|
|
1161
|
+
readonly rateLimitTimeWindow: Schema.NullOr<Schema.Finite>;
|
|
1162
|
+
readonly rateLimitMax: Schema.NullOr<Schema.Finite>;
|
|
1163
|
+
readonly requestCount: Schema.Finite;
|
|
1164
|
+
readonly remaining: Schema.NullOr<Schema.Finite>;
|
|
1149
1165
|
readonly lastRequest: Schema.NullOr<Schema.DateFromString>;
|
|
1150
1166
|
readonly expiresAt: Schema.NullOr<Schema.DateFromString>;
|
|
1151
1167
|
readonly createdAt: Schema.DateFromString;
|
|
@@ -1157,8 +1173,8 @@ export declare const AuthApiKey: Schema.Struct<{
|
|
|
1157
1173
|
export declare const ListApiKeysQuery: Schema.Struct<{
|
|
1158
1174
|
readonly configId: Schema.optional<Schema.String>;
|
|
1159
1175
|
readonly organizationId: Schema.optional<Schema.String>;
|
|
1160
|
-
readonly limit: Schema.optional<Schema.
|
|
1161
|
-
readonly offset: Schema.optional<Schema.
|
|
1176
|
+
readonly limit: Schema.optional<Schema.FiniteFromString>;
|
|
1177
|
+
readonly offset: Schema.optional<Schema.FiniteFromString>;
|
|
1162
1178
|
readonly sortBy: Schema.optional<Schema.String>;
|
|
1163
1179
|
readonly sortDirection: Schema.optional<Schema.Literals<readonly ["asc", "desc"]>>;
|
|
1164
1180
|
}>;
|
|
@@ -1171,15 +1187,15 @@ export declare const ListApiKeysResponse: Schema.Struct<{
|
|
|
1171
1187
|
readonly userId: Schema.optional<Schema.String>;
|
|
1172
1188
|
readonly referenceId: Schema.String;
|
|
1173
1189
|
readonly configId: Schema.String;
|
|
1174
|
-
readonly refillInterval: Schema.NullOr<Schema.
|
|
1175
|
-
readonly refillAmount: Schema.NullOr<Schema.
|
|
1190
|
+
readonly refillInterval: Schema.NullOr<Schema.Finite>;
|
|
1191
|
+
readonly refillAmount: Schema.NullOr<Schema.Finite>;
|
|
1176
1192
|
readonly lastRefillAt: Schema.NullOr<Schema.DateFromString>;
|
|
1177
1193
|
readonly enabled: Schema.Boolean;
|
|
1178
1194
|
readonly rateLimitEnabled: Schema.Boolean;
|
|
1179
|
-
readonly rateLimitTimeWindow: Schema.NullOr<Schema.
|
|
1180
|
-
readonly rateLimitMax: Schema.NullOr<Schema.
|
|
1181
|
-
readonly requestCount: Schema.
|
|
1182
|
-
readonly remaining: Schema.NullOr<Schema.
|
|
1195
|
+
readonly rateLimitTimeWindow: Schema.NullOr<Schema.Finite>;
|
|
1196
|
+
readonly rateLimitMax: Schema.NullOr<Schema.Finite>;
|
|
1197
|
+
readonly requestCount: Schema.Finite;
|
|
1198
|
+
readonly remaining: Schema.NullOr<Schema.Finite>;
|
|
1183
1199
|
readonly lastRequest: Schema.NullOr<Schema.DateFromString>;
|
|
1184
1200
|
readonly expiresAt: Schema.NullOr<Schema.DateFromString>;
|
|
1185
1201
|
readonly createdAt: Schema.DateFromString;
|
|
@@ -1188,9 +1204,9 @@ export declare const ListApiKeysResponse: Schema.Struct<{
|
|
|
1188
1204
|
readonly permissions: Schema.optional<Schema.NullOr<Schema.$Record<Schema.String, Schema.$Array<Schema.String>>>>;
|
|
1189
1205
|
readonly referrers: Schema.optional<Schema.NullOr<Schema.$Array<Schema.String>>>;
|
|
1190
1206
|
}>>;
|
|
1191
|
-
readonly total: Schema.
|
|
1192
|
-
readonly limit: Schema.optional<Schema.NullOr<Schema.
|
|
1193
|
-
readonly offset: Schema.optional<Schema.NullOr<Schema.
|
|
1207
|
+
readonly total: Schema.Finite;
|
|
1208
|
+
readonly limit: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
1209
|
+
readonly offset: Schema.optional<Schema.NullOr<Schema.Finite>>;
|
|
1194
1210
|
}>;
|
|
1195
1211
|
export declare const DeleteApiKeyPayload: Schema.Struct<{
|
|
1196
1212
|
readonly configId: Schema.optional<Schema.String>;
|
|
@@ -1203,7 +1219,7 @@ export declare const AdminStopImpersonatingPayload: Schema.Struct<{}>;
|
|
|
1203
1219
|
export declare const AdminBanUserPayload: Schema.Struct<{
|
|
1204
1220
|
readonly userId: Schema.String;
|
|
1205
1221
|
readonly banReason: Schema.optional<Schema.String>;
|
|
1206
|
-
readonly banExpiresIn: Schema.optional<Schema.
|
|
1222
|
+
readonly banExpiresIn: Schema.optional<Schema.Finite>;
|
|
1207
1223
|
}>;
|
|
1208
1224
|
export declare const AdminUserResponse: Schema.Struct<{
|
|
1209
1225
|
readonly user: Schema.Struct<{
|
package/dist/auth/schema.js
CHANGED
|
@@ -200,7 +200,7 @@ export const SocialIdToken = Schema.Struct({
|
|
|
200
200
|
nonce: Schema.optional(Schema.String),
|
|
201
201
|
accessToken: Schema.optional(Schema.String),
|
|
202
202
|
refreshToken: Schema.optional(Schema.String),
|
|
203
|
-
expiresAt: Schema.optional(Schema.
|
|
203
|
+
expiresAt: Schema.optional(Schema.Finite),
|
|
204
204
|
user: Schema.optional(Schema.Struct({
|
|
205
205
|
name: Schema.optional(Schema.Struct({
|
|
206
206
|
firstName: Schema.optional(Schema.String),
|
|
@@ -428,7 +428,7 @@ export const FullAuthOrganization = Schema.Struct({
|
|
|
428
428
|
export const GetFullOrganizationQuery = Schema.Struct({
|
|
429
429
|
organizationId: Schema.optional(Schema.String),
|
|
430
430
|
organizationSlug: Schema.optional(Schema.String),
|
|
431
|
-
membersLimit: Schema.optional(Schema.
|
|
431
|
+
membersLimit: Schema.optional(Schema.FiniteFromString),
|
|
432
432
|
}).annotate({
|
|
433
433
|
identifier: "GetFullOrganizationQuery",
|
|
434
434
|
title: "Get full organization query",
|
|
@@ -465,8 +465,8 @@ export const UpdateOrganizationPayload = Schema.Struct({
|
|
|
465
465
|
title: "Update organization payload",
|
|
466
466
|
});
|
|
467
467
|
export const OrganizationListMembersQuery = Schema.Struct({
|
|
468
|
-
limit: Schema.optional(Schema.
|
|
469
|
-
offset: Schema.optional(Schema.
|
|
468
|
+
limit: Schema.optional(Schema.FiniteFromString),
|
|
469
|
+
offset: Schema.optional(Schema.FiniteFromString),
|
|
470
470
|
sortBy: Schema.optional(Schema.String),
|
|
471
471
|
sortDirection: Schema.optional(Schema.Literals(["asc", "desc"])),
|
|
472
472
|
filterField: Schema.optional(Schema.String),
|
|
@@ -480,7 +480,7 @@ export const OrganizationListMembersQuery = Schema.Struct({
|
|
|
480
480
|
});
|
|
481
481
|
export const OrganizationListMembersResponse = Schema.Struct({
|
|
482
482
|
members: Schema.Array(AuthMember),
|
|
483
|
-
total: Schema.
|
|
483
|
+
total: Schema.Finite,
|
|
484
484
|
}).annotate({
|
|
485
485
|
identifier: "OrganizationListMembersResponse",
|
|
486
486
|
title: "List organization members response",
|
|
@@ -562,7 +562,7 @@ export const OrganizationImpersonateUserPayload = Schema.Struct({
|
|
|
562
562
|
organizationId: Schema.NonEmptyString,
|
|
563
563
|
actorUserId: Schema.NonEmptyString,
|
|
564
564
|
targetUserId: Schema.NonEmptyString,
|
|
565
|
-
expiresInSeconds: Schema.optional(Schema.
|
|
565
|
+
expiresInSeconds: Schema.optional(Schema.Finite),
|
|
566
566
|
}).annotate({
|
|
567
567
|
identifier: "OrganizationImpersonateUserPayload",
|
|
568
568
|
title: "Organization impersonate user payload",
|
|
@@ -580,15 +580,15 @@ export const AuthApiKey = Schema.Struct({
|
|
|
580
580
|
userId: Schema.optional(Schema.String),
|
|
581
581
|
referenceId: Schema.String,
|
|
582
582
|
configId: Schema.String,
|
|
583
|
-
refillInterval: Schema.NullOr(Schema.
|
|
584
|
-
refillAmount: Schema.NullOr(Schema.
|
|
583
|
+
refillInterval: Schema.NullOr(Schema.Finite),
|
|
584
|
+
refillAmount: Schema.NullOr(Schema.Finite),
|
|
585
585
|
lastRefillAt: Schema.NullOr(Schema.DateFromString),
|
|
586
586
|
enabled: Schema.Boolean,
|
|
587
587
|
rateLimitEnabled: Schema.Boolean,
|
|
588
|
-
rateLimitTimeWindow: Schema.NullOr(Schema.
|
|
589
|
-
rateLimitMax: Schema.NullOr(Schema.
|
|
590
|
-
requestCount: Schema.
|
|
591
|
-
remaining: Schema.NullOr(Schema.
|
|
588
|
+
rateLimitTimeWindow: Schema.NullOr(Schema.Finite),
|
|
589
|
+
rateLimitMax: Schema.NullOr(Schema.Finite),
|
|
590
|
+
requestCount: Schema.Finite,
|
|
591
|
+
remaining: Schema.NullOr(Schema.Finite),
|
|
592
592
|
lastRequest: Schema.NullOr(Schema.DateFromString),
|
|
593
593
|
expiresAt: Schema.NullOr(Schema.DateFromString),
|
|
594
594
|
createdAt: Schema.DateFromString,
|
|
@@ -600,16 +600,16 @@ export const AuthApiKey = Schema.Struct({
|
|
|
600
600
|
export const ListApiKeysQuery = Schema.Struct({
|
|
601
601
|
configId: Schema.optional(Schema.String),
|
|
602
602
|
organizationId: Schema.optional(Schema.String),
|
|
603
|
-
limit: Schema.optional(Schema.
|
|
604
|
-
offset: Schema.optional(Schema.
|
|
603
|
+
limit: Schema.optional(Schema.FiniteFromString),
|
|
604
|
+
offset: Schema.optional(Schema.FiniteFromString),
|
|
605
605
|
sortBy: Schema.optional(Schema.String),
|
|
606
606
|
sortDirection: Schema.optional(Schema.Literals(["asc", "desc"])),
|
|
607
607
|
}).annotate({ identifier: "ListApiKeysQuery", title: "List API keys query" });
|
|
608
608
|
export const ListApiKeysResponse = Schema.Struct({
|
|
609
609
|
apiKeys: Schema.Array(AuthApiKey),
|
|
610
|
-
total: Schema.
|
|
611
|
-
limit: Schema.optional(Schema.NullOr(Schema.
|
|
612
|
-
offset: Schema.optional(Schema.NullOr(Schema.
|
|
610
|
+
total: Schema.Finite,
|
|
611
|
+
limit: Schema.optional(Schema.NullOr(Schema.Finite)),
|
|
612
|
+
offset: Schema.optional(Schema.NullOr(Schema.Finite)),
|
|
613
613
|
}).annotate({
|
|
614
614
|
identifier: "ListApiKeysResponse",
|
|
615
615
|
title: "List API keys response",
|
|
@@ -634,7 +634,7 @@ export const AdminStopImpersonatingPayload = Schema.Struct({}).annotate({
|
|
|
634
634
|
export const AdminBanUserPayload = Schema.Struct({
|
|
635
635
|
userId: Schema.String,
|
|
636
636
|
banReason: Schema.optional(Schema.String),
|
|
637
|
-
banExpiresIn: Schema.optional(Schema.
|
|
637
|
+
banExpiresIn: Schema.optional(Schema.Finite),
|
|
638
638
|
}).annotate({ identifier: "AdminBanUserPayload", title: "Ban user payload" });
|
|
639
639
|
export const AdminUserResponse = Schema.Struct({ user: AuthUser }).annotate({
|
|
640
640
|
identifier: "AdminUserResponse",
|
|
@@ -90,9 +90,9 @@ const makeOrganizationForm = ({ baseUrl, organization, }) => FormReact.make(orga
|
|
|
90
90
|
slug: slugify(decoded.slug || decoded.name),
|
|
91
91
|
logo: logo ?? undefined,
|
|
92
92
|
};
|
|
93
|
-
const payload = Schema.
|
|
93
|
+
const payload = yield* Schema.decodeEffect(AdminCreateOrganizationPayload)(decoded.parentId === noParentOrganization
|
|
94
94
|
? input
|
|
95
|
-
: { ...input, parentId: decoded.parentId });
|
|
95
|
+
: { ...input, parentId: decoded.parentId }).pipe(Effect.orDie);
|
|
96
96
|
const saved = organization
|
|
97
97
|
? yield* http.admin.updateOrganization({
|
|
98
98
|
params: { id: organization.id },
|
|
@@ -13,6 +13,7 @@ import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent,
|
|
|
13
13
|
import { AdminListQuery } from "../admin/schema.js";
|
|
14
14
|
import { normalizeOrganizationRoles } from "../roles.js";
|
|
15
15
|
import { AdminOrganizationForm } from "./admin-organization-form.js";
|
|
16
|
+
import { ProjectCardList } from "./project-card-list.js";
|
|
16
17
|
import { deletionControlsEnabled } from "./deletion-visibility.js";
|
|
17
18
|
import { authClientApi, authHttpClient } from "./auth-client-api.js";
|
|
18
19
|
import { useKrakstackAuth } from "./auth-provider.js";
|
|
@@ -99,7 +100,7 @@ const organizationDisplay = (organization, locale, baseUrl) => {
|
|
|
99
100
|
};
|
|
100
101
|
const AdminOrganizationsFamilyKey = Schema.fromJsonString(Schema.Struct({
|
|
101
102
|
query: AdminListQuery,
|
|
102
|
-
reloadKey: Schema.
|
|
103
|
+
reloadKey: Schema.Finite,
|
|
103
104
|
})).annotate({ identifier: "AdminOrganizationsFamilyKey" });
|
|
104
105
|
const organizationsQuery = (search, projectId) => projectId ? { ...search, projectId } : search;
|
|
105
106
|
const adminOrganizationsFamilyKey = (search, projectId, reloadKey) => JSON.stringify({
|
|
@@ -107,7 +108,7 @@ const adminOrganizationsFamilyKey = (search, projectId, reloadKey) => JSON.strin
|
|
|
107
108
|
reloadKey,
|
|
108
109
|
});
|
|
109
110
|
const organizationsAtom = Atom.family((baseUrl) => Atom.family((key) => {
|
|
110
|
-
const { query, reloadKey } = Schema.
|
|
111
|
+
const { query, reloadKey } = Schema.decodeSync(AdminOrganizationsFamilyKey)(key);
|
|
111
112
|
return authClientApi(baseUrl).query("admin", "listOrganizations", {
|
|
112
113
|
query,
|
|
113
114
|
timeToLive: "1 minute",
|
|
@@ -166,7 +167,7 @@ export function AdminOrganizationsTable({ messages: messageOverrides, onSearchCh
|
|
|
166
167
|
projectId,
|
|
167
168
|
reloadKey,
|
|
168
169
|
refreshKey: 0,
|
|
169
|
-
search: search ?? Schema.
|
|
170
|
+
search: search ?? Schema.decodeSync(Query)({}),
|
|
170
171
|
}));
|
|
171
172
|
const setTableRequest = useAtomSet(tableAtoms.requestAtom);
|
|
172
173
|
const tableRequest = useAtomValue(tableAtoms.requestAtom);
|
|
@@ -226,7 +227,7 @@ export function AdminOrganizationsTable({ messages: messageOverrides, onSearchCh
|
|
|
226
227
|
],
|
|
227
228
|
},
|
|
228
229
|
}, state: tableRequest.search, onStateChange: ({ page, pageSize, globalFilter, sort, filters }) => {
|
|
229
|
-
const nextSearch = Schema.
|
|
230
|
+
const nextSearch = Schema.decodeSync(Query)({
|
|
230
231
|
page,
|
|
231
232
|
pageSize,
|
|
232
233
|
globalFilter,
|
|
@@ -357,7 +358,7 @@ function DeleteOrganizationDialog({ baseUrl, labels: m, organization, onClose, o
|
|
|
357
358
|
? Cause.squash(result.cause)
|
|
358
359
|
: undefined;
|
|
359
360
|
const isPending = !AsyncResult.isInitial(result) && result.waiting;
|
|
360
|
-
return (_jsx(AlertDialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: m.organization_delete_title }), _jsx(AlertDialogDescription, { children: m.organization_delete_description.replace("{name}", organization.name) })] }), error ? (_jsx(ErrorMessage, { text: error instanceof Error
|
|
361
|
+
return (_jsx(AlertDialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(AlertDialogContent, { className: "max-h-[85vh] overflow-y-auto sm:max-w-xl", children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: m.organization_delete_title }), _jsx(AlertDialogDescription, { children: m.organization_delete_description.replace("{name}", organization.name) })] }), organization.projects?.length ? (_jsxs("section", { className: "space-y-2", children: [_jsxs("h3", { className: "text-muted-foreground text-xs font-medium", children: [m.admin_column_projects, " ", _jsx("span", { className: "ml-1 tabular-nums", children: organization.projects.length })] }), _jsx(ProjectCardList, { projects: organization.projects })] })) : null, error ? (_jsx(ErrorMessage, { text: error instanceof Error
|
|
361
362
|
? error.message
|
|
362
363
|
: m.organization_delete_error })) : null, _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: isPending, children: m.organization_delete_cancel }), _jsx(AlertDialogAction, { disabled: isPending, onClick: (event) => {
|
|
363
364
|
event.preventDefault();
|
|
@@ -83,12 +83,12 @@ const initials = (name) => name
|
|
|
83
83
|
const text = (value, params) => Object.entries(params ?? {}).reduce((current, [key, replacement]) => current.replace(`{${key}}`, replacement), value);
|
|
84
84
|
const AdminUsersFamilyKey = Schema.fromJsonString(Schema.Struct({
|
|
85
85
|
query: AdminListQuery,
|
|
86
|
-
reloadKey: Schema.
|
|
86
|
+
reloadKey: Schema.Finite,
|
|
87
87
|
})).annotate({ identifier: "AdminUsersFamilyKey" });
|
|
88
88
|
const adminUsersQuery = (search, projectId) => projectId ? { ...search, projectId } : search;
|
|
89
89
|
const adminUsersFamilyKey = (search, projectId, reloadKey) => JSON.stringify({ query: adminUsersQuery(search, projectId), reloadKey });
|
|
90
90
|
const usersAtom = Atom.family((baseUrl) => Atom.family((key) => {
|
|
91
|
-
const { query, reloadKey } = Schema.
|
|
91
|
+
const { query, reloadKey } = Schema.decodeSync(AdminUsersFamilyKey)(key);
|
|
92
92
|
return authClientApi(baseUrl).query("admin", "listUsers", {
|
|
93
93
|
query,
|
|
94
94
|
timeToLive: "1 minute",
|
|
@@ -118,7 +118,7 @@ export function AdminUsersTable({ onSearchChange, reloadKey = 0, search, }) {
|
|
|
118
118
|
projectId,
|
|
119
119
|
reloadKey,
|
|
120
120
|
refreshKey: 0,
|
|
121
|
-
search: search ?? Schema.
|
|
121
|
+
search: search ?? Schema.decodeSync(Query)({}),
|
|
122
122
|
}));
|
|
123
123
|
const setTableRequest = useAtomSet(tableAtoms.requestAtom);
|
|
124
124
|
const tableRequest = useAtomValue(tableAtoms.requestAtom);
|
|
@@ -200,7 +200,7 @@ export function AdminUsersTable({ onSearchChange, reloadKey = 0, search, }) {
|
|
|
200
200
|
],
|
|
201
201
|
},
|
|
202
202
|
}, state: tableRequest.search, onStateChange: ({ page, pageSize, globalFilter, sort, filters }) => {
|
|
203
|
-
const nextSearch = Schema.
|
|
203
|
+
const nextSearch = Schema.decodeSync(Query)({
|
|
204
204
|
page,
|
|
205
205
|
pageSize,
|
|
206
206
|
globalFilter,
|
|
@@ -322,8 +322,8 @@ const userColumns = (m, baseUrl) => [
|
|
|
322
322
|
},
|
|
323
323
|
];
|
|
324
324
|
function BanUserDialog({ labels: m, baseUrl, user, onBanned, onClose, }) {
|
|
325
|
-
const [banUserAtom] = useState(() => authClientApi(baseUrl).runtime.fn((userId) => Effect.flatMap(authHttpClient(baseUrl), (client) => client.auth.adminBanUser({ payload: { userId } })).pipe(Effect.tap(() => Effect.sync(onBanned)), Effect.tap(() => Effect.sync(onClose)), Effect.catch((cause) => Effect.sync(() => setError(cause instanceof Error ? cause.message : m.admin_error_ban))))));
|
|
326
325
|
const [error, setError] = useState("");
|
|
326
|
+
const [banUserAtom] = useState(() => authClientApi(baseUrl).runtime.fn((userId) => Effect.flatMap(authHttpClient(baseUrl), (client) => client.auth.adminBanUser({ payload: { userId } })).pipe(Effect.tap(() => Effect.sync(onBanned)), Effect.tap(() => Effect.sync(onClose)), Effect.catch((cause) => Effect.sync(() => setError(cause instanceof Error ? cause.message : m.admin_error_ban))))));
|
|
327
327
|
const banUser = useAtomSet(banUserAtom);
|
|
328
328
|
const isPending = useAtomValue(banUserAtom).waiting;
|
|
329
329
|
return (_jsx(AlertDialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: m.admin_ban_title }), _jsx(AlertDialogDescription, { children: text(m.admin_ban_description, {
|
|
@@ -335,8 +335,8 @@ function BanUserDialog({ labels: m, baseUrl, user, onBanned, onClose, }) {
|
|
|
335
335
|
}, disabled: isPending, children: [isPending ? (_jsx(Loader2, { className: "animate-spin", "data-icon": "inline-start" })) : null, m.admin_action_ban] })] })] }) }));
|
|
336
336
|
}
|
|
337
337
|
function UnbanUserDialog({ labels: m, baseUrl, user, onUnbanned, onClose, }) {
|
|
338
|
-
const [unbanUserAtom] = useState(() => authClientApi(baseUrl).runtime.fn((userId) => Effect.flatMap(authHttpClient(baseUrl), (client) => client.auth.adminUnbanUser({ payload: { userId } })).pipe(Effect.tap(() => Effect.sync(onUnbanned)), Effect.tap(() => Effect.sync(onClose)), Effect.catch((cause) => Effect.sync(() => setError(cause instanceof Error ? cause.message : m.admin_error_unban))))));
|
|
339
338
|
const [error, setError] = useState("");
|
|
339
|
+
const [unbanUserAtom] = useState(() => authClientApi(baseUrl).runtime.fn((userId) => Effect.flatMap(authHttpClient(baseUrl), (client) => client.auth.adminUnbanUser({ payload: { userId } })).pipe(Effect.tap(() => Effect.sync(onUnbanned)), Effect.tap(() => Effect.sync(onClose)), Effect.catch((cause) => Effect.sync(() => setError(cause instanceof Error ? cause.message : m.admin_error_unban))))));
|
|
340
340
|
const unbanUser = useAtomSet(unbanUserAtom);
|
|
341
341
|
const isPending = useAtomValue(unbanUserAtom).waiting;
|
|
342
342
|
return (_jsx(AlertDialog, { open: true, onOpenChange: (open) => !open && onClose(), children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: m.admin_unban_title }), _jsx(AlertDialogDescription, { children: text(m.admin_unban_description, {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as Data from "effect/Data";
|
|
2
3
|
import { useAtomSet, useAtomValue } from "@effect/atom-react";
|
|
3
4
|
import { FormBuilder, FormReact } from "@lucas-barake/effect-form-react";
|
|
4
5
|
import { Effect, Schema } from "effect";
|
|
5
|
-
import {
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { useLatestAtom } from "./hooks.js";
|
|
6
8
|
import { CheckboxField, SubmitButton, SubmitError, TextAreaField, TextField, } from "@krak-stack/registry/effect-form";
|
|
7
9
|
import { parseApiKeyReferrers } from "./api-key.js";
|
|
8
10
|
import { authClientApi, authHttpClient } from "./auth-client-api.js";
|
|
9
11
|
import { ApiKeyPermissions } from "./api-key-permissions.js";
|
|
10
12
|
import { apiKeyReferrers } from "./api-key-referrers.js";
|
|
11
13
|
import { ExtraApiKeyPermissions } from "../extra/schema.js";
|
|
14
|
+
class ApiKeyEditError extends Data.TaggedError("ApiKeyEditError") {
|
|
15
|
+
}
|
|
12
16
|
const editApiKeyFormBuilder = FormBuilder.empty
|
|
13
17
|
.addField("name", Schema.NonEmptyString)
|
|
14
18
|
.addField("enabled", Schema.Boolean)
|
|
@@ -24,16 +28,14 @@ export const ApiKeyEditForm = ({ baseUrl, configId, keyData, messages, permissio
|
|
|
24
28
|
project,
|
|
25
29
|
action,
|
|
26
30
|
})));
|
|
27
|
-
const currentPermissions = Schema.
|
|
31
|
+
const currentPermissions = Schema.decodeOption(ExtraApiKeyPermissions)(keyData.permissions ?? {});
|
|
28
32
|
const currentGrant = currentPermissions._tag === "Some" ? currentPermissions.value : {};
|
|
29
33
|
const initialSelectedPermissions = Object.fromEntries(permissionOptions.map((option) => [
|
|
30
34
|
option.id,
|
|
31
35
|
currentGrant[option.project]?.includes(option.action) ?? false,
|
|
32
36
|
]));
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
permissionOptionsRef.current = permissionOptions;
|
|
36
|
-
permissionsRef.current = permissions;
|
|
37
|
+
const permissionOptionsAtom = useLatestAtom(permissionOptions);
|
|
38
|
+
const permissionsAtom = useLatestAtom(permissions);
|
|
37
39
|
const [form] = useState(() => FormReact.make(editApiKeyFormBuilder, {
|
|
38
40
|
runtime: authClientApi(baseUrl).runtime,
|
|
39
41
|
fields: {
|
|
@@ -43,16 +45,19 @@ export const ApiKeyEditForm = ({ baseUrl, configId, keyData, messages, permissio
|
|
|
43
45
|
permissions: ApiKeyPermissionsField,
|
|
44
46
|
},
|
|
45
47
|
mode: { validation: "onSubmit" },
|
|
46
|
-
onSubmit: (_, { decoded }) => Effect.gen(function* () {
|
|
48
|
+
onSubmit: (_, { decoded, get }) => Effect.gen(function* () {
|
|
47
49
|
const referrers = yield* Effect.try({
|
|
48
50
|
try: () => parseApiKeyReferrers(decoded.referrers, messages.referrersError),
|
|
49
|
-
catch: (cause) =>
|
|
51
|
+
catch: (cause) => new ApiKeyEditError({
|
|
52
|
+
message: cause instanceof Error ? cause.message : messages.updateError,
|
|
53
|
+
cause: cause,
|
|
54
|
+
}),
|
|
50
55
|
});
|
|
51
56
|
const selectedGrant = {};
|
|
52
|
-
for (const project of Object.keys(
|
|
57
|
+
for (const project of Object.keys(get(permissionsAtom))) {
|
|
53
58
|
selectedGrant[project] = [];
|
|
54
59
|
}
|
|
55
|
-
for (const option of
|
|
60
|
+
for (const option of get(permissionOptionsAtom)) {
|
|
56
61
|
if (!decoded.permissions[option.id])
|
|
57
62
|
continue;
|
|
58
63
|
selectedGrant[option.project] = [
|
|
@@ -73,7 +78,10 @@ export const ApiKeyEditForm = ({ baseUrl, configId, keyData, messages, permissio
|
|
|
73
78
|
});
|
|
74
79
|
yield* Effect.sync(onSaved);
|
|
75
80
|
return updated;
|
|
76
|
-
}).pipe(Effect.mapError((cause) =>
|
|
81
|
+
}).pipe(Effect.mapError((cause) => new ApiKeyEditError({
|
|
82
|
+
message: cause instanceof Error ? cause.message : messages.updateError,
|
|
83
|
+
cause: cause,
|
|
84
|
+
}))),
|
|
77
85
|
}));
|
|
78
86
|
const submit = useAtomSet(form.submit);
|
|
79
87
|
const submitResult = useAtomValue(form.submit);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare const AssociatedProjectsNotice: ({ baseUrl, getSummary, organizationId, viewLabel, }: {
|
|
1
|
+
export declare const AssociatedProjectsNotice: ({ baseUrl, expanded, getSummary, organizationId, viewLabel, }: {
|
|
2
2
|
baseUrl?: string | undefined;
|
|
3
|
+
expanded?: boolean;
|
|
3
4
|
getSummary: (count: number) => string;
|
|
4
5
|
organizationId?: string | null;
|
|
5
6
|
viewLabel: string;
|
|
@@ -3,6 +3,7 @@ import { useAtomValue } from "@effect/atom-react";
|
|
|
3
3
|
import { AsyncResult, Atom } from "effect/reactivity";
|
|
4
4
|
import { Badge } from "@/components/ui/badge";
|
|
5
5
|
import { authClientApi } from "./auth-client-api.js";
|
|
6
|
+
import { ProjectCardList } from "./project-card-list.js";
|
|
6
7
|
const associatedProjectsAtom = Atom.family((baseUrl) => Atom.family((organizationId) => authClientApi(baseUrl).query("authExtra", "listAssociatedProjects", {
|
|
7
8
|
query: organizationId ? { organizationId } : {},
|
|
8
9
|
timeToLive: "1 minute",
|
|
@@ -11,14 +12,17 @@ const associatedProjectsAtom = Atom.family((baseUrl) => Atom.family((organizatio
|
|
|
11
12
|
organizationId ? `organization:${organizationId}` : "current-user",
|
|
12
13
|
],
|
|
13
14
|
})));
|
|
14
|
-
export const AssociatedProjectsNotice = ({ baseUrl, getSummary, organizationId = null, viewLabel, }) => {
|
|
15
|
+
export const AssociatedProjectsNotice = ({ baseUrl, expanded = false, getSummary, organizationId = null, viewLabel, }) => {
|
|
15
16
|
const result = useAtomValue(associatedProjectsAtom(baseUrl)(organizationId));
|
|
16
17
|
const projects = AsyncResult.match(result, {
|
|
17
18
|
onInitial: () => [],
|
|
18
19
|
onFailure: () => [],
|
|
19
20
|
onSuccess: ({ value }) => Array.from(value),
|
|
20
21
|
});
|
|
21
|
-
if (projects.length
|
|
22
|
+
if (projects.length < (expanded ? 1 : 2))
|
|
22
23
|
return null;
|
|
24
|
+
if (expanded) {
|
|
25
|
+
return (_jsxs("section", { className: "space-y-2", children: [_jsx("h3", { className: "text-muted-foreground text-xs font-medium", children: getSummary(projects.length) }), _jsx(ProjectCardList, { projects: projects })] }));
|
|
26
|
+
}
|
|
23
27
|
return (_jsx("div", { className: "px-1 py-2", children: _jsxs("details", { className: "border-primary/60 text-muted-foreground border-l-2 pl-3 text-sm", children: [_jsxs("summary", { className: "cursor-pointer list-none [&::-webkit-details-marker]:hidden", children: [getSummary(projects.length), " ", _jsx("span", { className: "text-foreground underline underline-offset-4", children: viewLabel })] }), _jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: projects.map((project) => (_jsx(Badge, { variant: "secondary", children: project.name }, project.id))) })] }) }));
|
|
24
28
|
};
|
|
@@ -29,8 +29,7 @@ const authSessionQueryAtom = Atom.family((baseUrl) => authClientApi(baseUrl)
|
|
|
29
29
|
return unauthorized && !result.waiting
|
|
30
30
|
? AsyncResult.success(null)
|
|
31
31
|
: result;
|
|
32
|
-
}))
|
|
33
|
-
.pipe(refreshOnAuthChange));
|
|
32
|
+
}), refreshOnAuthChange));
|
|
34
33
|
export const authSessionAtom = Atom.family((baseUrl) => Atom.optimistic(authSessionQueryAtom(baseUrl)));
|
|
35
34
|
export const refreshAuthSession = Effect.fn("refreshAuthSession")(function* (registry, baseUrl) {
|
|
36
35
|
const query = authSessionQueryAtom(baseUrl);
|