@mano8/astro-auth-m8 1.5.0 → 2.1.0
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 +151 -0
- package/README.md +81 -3
- package/dist/src/runtime/api/apiKeys.d.ts +3 -1
- package/dist/src/runtime/api/apiKeys.d.ts.map +1 -1
- package/dist/src/runtime/api/apiKeys.js +9 -1
- package/dist/src/runtime/api/apiKeys.js.map +1 -1
- package/dist/src/runtime/api/index.d.ts +1 -0
- package/dist/src/runtime/api/index.d.ts.map +1 -1
- package/dist/src/runtime/api/index.js +1 -0
- package/dist/src/runtime/api/index.js.map +1 -1
- package/dist/src/runtime/api/ops.d.ts +2 -1
- package/dist/src/runtime/api/ops.d.ts.map +1 -1
- package/dist/src/runtime/api/ops.js +6 -1
- package/dist/src/runtime/api/ops.js.map +1 -1
- package/dist/src/runtime/api/security.d.ts +8 -0
- package/dist/src/runtime/api/security.d.ts.map +1 -0
- package/dist/src/runtime/api/security.js +23 -0
- package/dist/src/runtime/api/security.js.map +1 -0
- package/dist/src/runtime/api/users.d.ts +2 -2
- package/dist/src/runtime/api/users.d.ts.map +1 -1
- package/dist/src/runtime/api/users.js +2 -2
- package/dist/src/runtime/api/users.js.map +1 -1
- package/dist/src/runtime/authEvents.d.ts +25 -0
- package/dist/src/runtime/authEvents.d.ts.map +1 -0
- package/dist/src/runtime/authEvents.js +26 -0
- package/dist/src/runtime/authEvents.js.map +1 -0
- package/dist/src/runtime/authorization.d.ts +80 -0
- package/dist/src/runtime/authorization.d.ts.map +1 -0
- package/dist/src/runtime/authorization.js +109 -0
- package/dist/src/runtime/authorization.js.map +1 -0
- package/dist/src/runtime/browserAdapter.d.ts.map +1 -1
- package/dist/src/runtime/browserAdapter.js +23 -0
- package/dist/src/runtime/browserAdapter.js.map +1 -1
- package/dist/src/runtime/compatibility.d.ts +6 -6
- package/dist/src/runtime/compatibility.d.ts.map +1 -1
- package/dist/src/runtime/compatibility.js +35 -5
- package/dist/src/runtime/compatibility.js.map +1 -1
- package/dist/src/runtime/errors.d.ts +39 -0
- package/dist/src/runtime/errors.d.ts.map +1 -1
- package/dist/src/runtime/errors.js +79 -0
- package/dist/src/runtime/errors.js.map +1 -1
- package/dist/src/runtime/hooks/index.d.ts +1 -0
- package/dist/src/runtime/hooks/index.d.ts.map +1 -1
- package/dist/src/runtime/hooks/index.js +1 -0
- package/dist/src/runtime/hooks/index.js.map +1 -1
- package/dist/src/runtime/hooks/useApiKeys.d.ts +69 -0
- package/dist/src/runtime/hooks/useApiKeys.d.ts.map +1 -1
- package/dist/src/runtime/hooks/useApiKeys.js +38 -1
- package/dist/src/runtime/hooks/useApiKeys.js.map +1 -1
- package/dist/src/runtime/hooks/useSecurity.d.ts +70 -0
- package/dist/src/runtime/hooks/useSecurity.d.ts.map +1 -0
- package/dist/src/runtime/hooks/useSecurity.js +60 -0
- package/dist/src/runtime/hooks/useSecurity.js.map +1 -0
- package/dist/src/runtime/hooks/useUsers.d.ts +4 -15
- package/dist/src/runtime/hooks/useUsers.d.ts.map +1 -1
- package/dist/src/runtime/hooks/useUsers.js +18 -4
- package/dist/src/runtime/hooks/useUsers.js.map +1 -1
- package/dist/src/runtime/queryKeys.d.ts +2 -0
- package/dist/src/runtime/queryKeys.d.ts.map +1 -1
- package/dist/src/runtime/queryKeys.js +3 -1
- package/dist/src/runtime/queryKeys.js.map +1 -1
- package/dist/src/runtime/react/AuthProvider.d.ts.map +1 -1
- package/dist/src/runtime/react/AuthProvider.js +24 -0
- package/dist/src/runtime/react/AuthProvider.js.map +1 -1
- package/dist/src/runtime/react/RequireRole.d.ts +39 -2
- package/dist/src/runtime/react/RequireRole.d.ts.map +1 -1
- package/dist/src/runtime/react/RequireRole.js +19 -3
- package/dist/src/runtime/react/RequireRole.js.map +1 -1
- package/dist/src/runtime/react/index.d.ts +2 -0
- package/dist/src/runtime/react/index.d.ts.map +1 -1
- package/dist/src/runtime/react/index.js +11 -0
- package/dist/src/runtime/react/index.js.map +1 -1
- package/dist/src/runtime/schemas.d.ts +186 -1
- package/dist/src/runtime/schemas.d.ts.map +1 -1
- package/dist/src/runtime/schemas.js +74 -3
- package/dist/src/runtime/schemas.js.map +1 -1
- package/package.json +8 -5
- package/registry/r/account-crud.json +1 -1
- package/registry/r/account-dashboard.json +1 -1
- package/registry/r/admin-users-panel.json +1 -1
- package/registry/r/api-keys-panel.json +1 -1
- package/registry/r/registry.json +6 -0
- package/registry/r/security-panel.json +27 -0
- package/registry/r/sessions-panel.json +1 -1
- package/registry.json +22 -0
|
@@ -49,6 +49,31 @@ export declare const UserPublicSchema: z.ZodObject<{
|
|
|
49
49
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
50
50
|
}, z.core.$strict>;
|
|
51
51
|
export type UserPublic = z.infer<typeof UserPublicSchema>;
|
|
52
|
+
export declare const UserAuthorizationUpdateSchema: z.ZodObject<{
|
|
53
|
+
id: z.ZodString;
|
|
54
|
+
provider: z.ZodDefault<z.ZodEnum<{
|
|
55
|
+
password: "password";
|
|
56
|
+
google: "google";
|
|
57
|
+
}>>;
|
|
58
|
+
email: z.ZodString;
|
|
59
|
+
full_name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
60
|
+
avatar: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
61
|
+
is_active: z.ZodDefault<z.ZodBoolean>;
|
|
62
|
+
email_verified: z.ZodDefault<z.ZodBoolean>;
|
|
63
|
+
is_superuser: z.ZodDefault<z.ZodBoolean>;
|
|
64
|
+
role: z.ZodDefault<z.ZodEnum<{
|
|
65
|
+
superadmin: "superadmin";
|
|
66
|
+
admin: "admin";
|
|
67
|
+
writer: "writer";
|
|
68
|
+
reader: "reader";
|
|
69
|
+
user: "user";
|
|
70
|
+
}>>;
|
|
71
|
+
created_at: z.ZodOptional<z.ZodString>;
|
|
72
|
+
updated_at: z.ZodOptional<z.ZodString>;
|
|
73
|
+
auth_generation: z.ZodNumber;
|
|
74
|
+
revocation_enqueued: z.ZodBoolean;
|
|
75
|
+
}, z.core.$strict>;
|
|
76
|
+
export type UserAuthorizationUpdate = z.infer<typeof UserAuthorizationUpdateSchema>;
|
|
52
77
|
export declare const ResponseUserSchema: z.ZodObject<{
|
|
53
78
|
success: z.ZodBoolean;
|
|
54
79
|
user: z.ZodObject<{
|
|
@@ -117,7 +142,6 @@ export declare const UserCreateSchema: z.ZodObject<{
|
|
|
117
142
|
avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
118
143
|
is_active: z.ZodOptional<z.ZodBoolean>;
|
|
119
144
|
email_verified: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
-
is_superuser: z.ZodOptional<z.ZodBoolean>;
|
|
121
145
|
role: z.ZodOptional<z.ZodEnum<{
|
|
122
146
|
superadmin: "superadmin";
|
|
123
147
|
admin: "admin";
|
|
@@ -142,6 +166,7 @@ export declare const UserUpdateSchema: z.ZodObject<{
|
|
|
142
166
|
reader: "reader";
|
|
143
167
|
user: "user";
|
|
144
168
|
}>>>;
|
|
169
|
+
is_active: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
145
170
|
provider: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
146
171
|
password: "password";
|
|
147
172
|
google: "google";
|
|
@@ -159,6 +184,11 @@ export declare const UpdatePasswordSchema: z.ZodObject<{
|
|
|
159
184
|
new_password: z.ZodString;
|
|
160
185
|
}, z.core.$strict>;
|
|
161
186
|
export type UpdatePassword = z.infer<typeof UpdatePasswordSchema>;
|
|
187
|
+
export declare const ApiKeyAccessModeSchema: z.ZodEnum<{
|
|
188
|
+
read_only: "read_only";
|
|
189
|
+
read_write: "read_write";
|
|
190
|
+
}>;
|
|
191
|
+
export type ApiKeyAccessMode = z.infer<typeof ApiKeyAccessModeSchema>;
|
|
162
192
|
export declare const ApiKeyPublicSchema: z.ZodObject<{
|
|
163
193
|
id: z.ZodString;
|
|
164
194
|
name: z.ZodString;
|
|
@@ -167,11 +197,21 @@ export declare const ApiKeyPublicSchema: z.ZodObject<{
|
|
|
167
197
|
last_used_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
168
198
|
created_at: z.ZodOptional<z.ZodString>;
|
|
169
199
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
200
|
+
access_mode: z.ZodDefault<z.ZodEnum<{
|
|
201
|
+
read_only: "read_only";
|
|
202
|
+
read_write: "read_write";
|
|
203
|
+
}>>;
|
|
204
|
+
audiences: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
170
205
|
}, z.core.$strict>;
|
|
171
206
|
export type ApiKeyPublic = z.infer<typeof ApiKeyPublicSchema>;
|
|
172
207
|
export declare const ApiKeyCreateSchema: z.ZodObject<{
|
|
173
208
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
174
209
|
ttl_hours: z.ZodDefault<z.ZodNumber>;
|
|
210
|
+
access_mode: z.ZodDefault<z.ZodEnum<{
|
|
211
|
+
read_only: "read_only";
|
|
212
|
+
read_write: "read_write";
|
|
213
|
+
}>>;
|
|
214
|
+
audiences: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
175
215
|
}, z.core.$strict>;
|
|
176
216
|
export type ApiKeyCreate = z.infer<typeof ApiKeyCreateSchema>;
|
|
177
217
|
export declare const ApiKeyCreatedSchema: z.ZodObject<{
|
|
@@ -182,9 +222,143 @@ export declare const ApiKeyCreatedSchema: z.ZodObject<{
|
|
|
182
222
|
last_used_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
183
223
|
created_at: z.ZodOptional<z.ZodString>;
|
|
184
224
|
updated_at: z.ZodOptional<z.ZodString>;
|
|
225
|
+
access_mode: z.ZodDefault<z.ZodEnum<{
|
|
226
|
+
read_only: "read_only";
|
|
227
|
+
read_write: "read_write";
|
|
228
|
+
}>>;
|
|
229
|
+
audiences: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
185
230
|
plaintext: z.ZodString;
|
|
186
231
|
}, z.core.$strict>;
|
|
187
232
|
export type ApiKeyCreated = z.infer<typeof ApiKeyCreatedSchema>;
|
|
233
|
+
export declare const ApiKeyAdminStatusSchema: z.ZodEnum<{
|
|
234
|
+
revoked: "revoked";
|
|
235
|
+
active: "active";
|
|
236
|
+
expired: "expired";
|
|
237
|
+
}>;
|
|
238
|
+
export type ApiKeyAdminStatus = z.infer<typeof ApiKeyAdminStatusSchema>;
|
|
239
|
+
export declare const ApiKeyAdminPublicSchema: z.ZodObject<{
|
|
240
|
+
id: z.ZodString;
|
|
241
|
+
name: z.ZodNullable<z.ZodString>;
|
|
242
|
+
user_id: z.ZodString;
|
|
243
|
+
revoked: z.ZodBoolean;
|
|
244
|
+
expires_at: z.ZodNullable<z.ZodString>;
|
|
245
|
+
last_used_at: z.ZodNullable<z.ZodString>;
|
|
246
|
+
created_at: z.ZodString;
|
|
247
|
+
access_mode: z.ZodEnum<{
|
|
248
|
+
read_only: "read_only";
|
|
249
|
+
read_write: "read_write";
|
|
250
|
+
}>;
|
|
251
|
+
status: z.ZodEnum<{
|
|
252
|
+
revoked: "revoked";
|
|
253
|
+
active: "active";
|
|
254
|
+
expired: "expired";
|
|
255
|
+
}>;
|
|
256
|
+
audiences: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
257
|
+
}, z.core.$strict>;
|
|
258
|
+
export type ApiKeyAdminPublic = z.infer<typeof ApiKeyAdminPublicSchema>;
|
|
259
|
+
export declare const ApiKeysAdminPublicSchema: z.ZodObject<{
|
|
260
|
+
data: z.ZodArray<z.ZodObject<{
|
|
261
|
+
id: z.ZodString;
|
|
262
|
+
name: z.ZodNullable<z.ZodString>;
|
|
263
|
+
user_id: z.ZodString;
|
|
264
|
+
revoked: z.ZodBoolean;
|
|
265
|
+
expires_at: z.ZodNullable<z.ZodString>;
|
|
266
|
+
last_used_at: z.ZodNullable<z.ZodString>;
|
|
267
|
+
created_at: z.ZodString;
|
|
268
|
+
access_mode: z.ZodEnum<{
|
|
269
|
+
read_only: "read_only";
|
|
270
|
+
read_write: "read_write";
|
|
271
|
+
}>;
|
|
272
|
+
status: z.ZodEnum<{
|
|
273
|
+
revoked: "revoked";
|
|
274
|
+
active: "active";
|
|
275
|
+
expired: "expired";
|
|
276
|
+
}>;
|
|
277
|
+
audiences: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
278
|
+
}, z.core.$strict>>;
|
|
279
|
+
count: z.ZodNumber;
|
|
280
|
+
}, z.core.$strict>;
|
|
281
|
+
export type ApiKeysAdminPublic = z.infer<typeof ApiKeysAdminPublicSchema>;
|
|
282
|
+
export declare const RetentionWindowSchema: z.ZodEnum<{
|
|
283
|
+
"1w": "1w";
|
|
284
|
+
"1m": "1m";
|
|
285
|
+
"3m": "3m";
|
|
286
|
+
"6m": "6m";
|
|
287
|
+
"1y": "1y";
|
|
288
|
+
}>;
|
|
289
|
+
export type RetentionWindow = z.infer<typeof RetentionWindowSchema>;
|
|
290
|
+
export declare const PurgeRequestSchema: z.ZodObject<{
|
|
291
|
+
window: z.ZodEnum<{
|
|
292
|
+
"1w": "1w";
|
|
293
|
+
"1m": "1m";
|
|
294
|
+
"3m": "3m";
|
|
295
|
+
"6m": "6m";
|
|
296
|
+
"1y": "1y";
|
|
297
|
+
}>;
|
|
298
|
+
}, z.core.$strict>;
|
|
299
|
+
export type PurgeRequest = z.infer<typeof PurgeRequestSchema>;
|
|
300
|
+
export declare const PurgeResponseSchema: z.ZodObject<{
|
|
301
|
+
window: z.ZodEnum<{
|
|
302
|
+
"1w": "1w";
|
|
303
|
+
"1m": "1m";
|
|
304
|
+
"3m": "3m";
|
|
305
|
+
"6m": "6m";
|
|
306
|
+
"1y": "1y";
|
|
307
|
+
}>;
|
|
308
|
+
removed: z.ZodNumber;
|
|
309
|
+
}, z.core.$strict>;
|
|
310
|
+
export type PurgeResponse = z.infer<typeof PurgeResponseSchema>;
|
|
311
|
+
export declare const AuditActionSchema: z.ZodEnum<{
|
|
312
|
+
add: "add";
|
|
313
|
+
edit: "edit";
|
|
314
|
+
delete: "delete";
|
|
315
|
+
}>;
|
|
316
|
+
export type AuditAction = z.infer<typeof AuditActionSchema>;
|
|
317
|
+
export declare const PrivilegedActionAuditPublicSchema: z.ZodObject<{
|
|
318
|
+
id: z.ZodString;
|
|
319
|
+
created_at: z.ZodString;
|
|
320
|
+
actor_user_id: z.ZodString;
|
|
321
|
+
actor_role: z.ZodEnum<{
|
|
322
|
+
superadmin: "superadmin";
|
|
323
|
+
admin: "admin";
|
|
324
|
+
writer: "writer";
|
|
325
|
+
reader: "reader";
|
|
326
|
+
user: "user";
|
|
327
|
+
}>;
|
|
328
|
+
action: z.ZodEnum<{
|
|
329
|
+
add: "add";
|
|
330
|
+
edit: "edit";
|
|
331
|
+
delete: "delete";
|
|
332
|
+
}>;
|
|
333
|
+
table_name: z.ZodString;
|
|
334
|
+
row_pk: z.ZodString;
|
|
335
|
+
target_owner_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
336
|
+
}, z.core.$strict>;
|
|
337
|
+
export type PrivilegedActionAuditPublic = z.infer<typeof PrivilegedActionAuditPublicSchema>;
|
|
338
|
+
export declare const PrivilegedActionAuditsPublicSchema: z.ZodObject<{
|
|
339
|
+
data: z.ZodArray<z.ZodObject<{
|
|
340
|
+
id: z.ZodString;
|
|
341
|
+
created_at: z.ZodString;
|
|
342
|
+
actor_user_id: z.ZodString;
|
|
343
|
+
actor_role: z.ZodEnum<{
|
|
344
|
+
superadmin: "superadmin";
|
|
345
|
+
admin: "admin";
|
|
346
|
+
writer: "writer";
|
|
347
|
+
reader: "reader";
|
|
348
|
+
user: "user";
|
|
349
|
+
}>;
|
|
350
|
+
action: z.ZodEnum<{
|
|
351
|
+
add: "add";
|
|
352
|
+
edit: "edit";
|
|
353
|
+
delete: "delete";
|
|
354
|
+
}>;
|
|
355
|
+
table_name: z.ZodString;
|
|
356
|
+
row_pk: z.ZodString;
|
|
357
|
+
target_owner_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
358
|
+
}, z.core.$strict>>;
|
|
359
|
+
count: z.ZodNumber;
|
|
360
|
+
}, z.core.$strict>;
|
|
361
|
+
export type PrivilegedActionAuditsPublic = z.infer<typeof PrivilegedActionAuditsPublicSchema>;
|
|
188
362
|
export declare const ClientSessionPublicSchema: z.ZodObject<{
|
|
189
363
|
id: z.ZodString;
|
|
190
364
|
provider: z.ZodEnum<{
|
|
@@ -266,6 +440,17 @@ export declare const HealthSchema: z.ZodObject<{
|
|
|
266
440
|
degradation_modes: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
267
441
|
}, z.core.$loose>;
|
|
268
442
|
export type Health = z.infer<typeof HealthSchema>;
|
|
443
|
+
export declare const ServiceMetaSchema: z.ZodObject<{
|
|
444
|
+
service: z.ZodString;
|
|
445
|
+
version: z.ZodString;
|
|
446
|
+
api_version: z.ZodString;
|
|
447
|
+
contract: z.ZodObject<{
|
|
448
|
+
name: z.ZodString;
|
|
449
|
+
version: z.ZodString;
|
|
450
|
+
range: z.ZodString;
|
|
451
|
+
}, z.core.$loose>;
|
|
452
|
+
}, z.core.$loose>;
|
|
453
|
+
export type ServiceMeta = z.infer<typeof ServiceMetaSchema>;
|
|
269
454
|
export declare const JwkSchema: z.ZodObject<{
|
|
270
455
|
kty: z.ZodString;
|
|
271
456
|
}, z.core.$loose>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/runtime/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/runtime/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,cAAc;;;;;;EAA8D,CAAC;AAC1F,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAA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AAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,eAAe;;;kBAGjB,CAAC;AACZ,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
// Declared from highest to lowest privilege: `runtime/authorization.ts` reads
|
|
3
|
+
// this order as the canonical role hierarchy. Do not reorder.
|
|
2
4
|
export const RoleTypeSchema = z.enum(["superadmin", "admin", "writer", "reader", "user"]);
|
|
3
5
|
export const AuthProviderTypeSchema = z.enum(["password", "google"]);
|
|
4
6
|
const isoDate = z.string();
|
|
@@ -27,6 +29,10 @@ export const UserPublicSchema = z.object({
|
|
|
27
29
|
created_at: isoDate.optional(),
|
|
28
30
|
updated_at: isoDate.optional()
|
|
29
31
|
}).strict();
|
|
32
|
+
export const UserAuthorizationUpdateSchema = UserPublicSchema.extend({
|
|
33
|
+
auth_generation: z.number().int(),
|
|
34
|
+
revocation_enqueued: z.boolean()
|
|
35
|
+
}).strict();
|
|
30
36
|
export const ResponseUserSchema = z.object({
|
|
31
37
|
success: z.boolean(),
|
|
32
38
|
user: UserPublicSchema
|
|
@@ -47,7 +53,6 @@ const userCreateBase = z.object({
|
|
|
47
53
|
avatar: z.string().max(255).url().nullable().optional(),
|
|
48
54
|
is_active: z.boolean().optional(),
|
|
49
55
|
email_verified: z.boolean().optional(),
|
|
50
|
-
is_superuser: z.boolean().optional(),
|
|
51
56
|
role: RoleTypeSchema.optional(),
|
|
52
57
|
password: z.string().min(8).max(128).nullable().optional(),
|
|
53
58
|
oauth_user_id: z.string().max(256).nullable().optional()
|
|
@@ -77,6 +82,7 @@ export const UserUpdateSchema = z.object({
|
|
|
77
82
|
password: z.string().min(8).max(128).nullable().optional(),
|
|
78
83
|
oauth_user_id: z.string().max(256).nullable().optional(),
|
|
79
84
|
role: RoleTypeSchema.nullable().optional(),
|
|
85
|
+
is_active: z.boolean().nullable().optional(),
|
|
80
86
|
provider: AuthProviderTypeSchema.nullable().optional()
|
|
81
87
|
}).strict().superRefine((value, ctx) => {
|
|
82
88
|
if (value.provider === "password" && value.oauth_user_id != null) {
|
|
@@ -95,6 +101,9 @@ export const UpdatePasswordSchema = z.object({
|
|
|
95
101
|
current_password: z.string().min(8).max(128),
|
|
96
102
|
new_password: z.string().min(8).max(128)
|
|
97
103
|
}).strict();
|
|
104
|
+
// Immutable operation-category cap chosen at issuance (APIKEY-MODE-01); never
|
|
105
|
+
// changed afterward - issuing a replacement key is the only way to widen it.
|
|
106
|
+
export const ApiKeyAccessModeSchema = z.enum(["read_only", "read_write"]);
|
|
98
107
|
export const ApiKeyPublicSchema = z.object({
|
|
99
108
|
id: z.string().uuid(),
|
|
100
109
|
name: z.string().min(3).max(100),
|
|
@@ -102,15 +111,64 @@ export const ApiKeyPublicSchema = z.object({
|
|
|
102
111
|
revoked: z.boolean().default(false),
|
|
103
112
|
last_used_at: nullableIsoDate.default(null),
|
|
104
113
|
created_at: isoDate.optional(),
|
|
105
|
-
updated_at: isoDate.optional()
|
|
114
|
+
updated_at: isoDate.optional(),
|
|
115
|
+
access_mode: ApiKeyAccessModeSchema.default("read_only"),
|
|
116
|
+
audiences: z.array(z.string()).default([])
|
|
106
117
|
}).strict();
|
|
107
118
|
export const ApiKeyCreateSchema = z.object({
|
|
108
119
|
name: z.string().min(3).max(100).nullable().optional(),
|
|
109
|
-
ttl_hours: z.number().int().positive().default(24)
|
|
120
|
+
ttl_hours: z.number().int().positive().default(24),
|
|
121
|
+
access_mode: ApiKeyAccessModeSchema.default("read_only"),
|
|
122
|
+
audiences: z.array(z.string()).nullable().optional()
|
|
110
123
|
}).strict();
|
|
111
124
|
export const ApiKeyCreatedSchema = ApiKeyPublicSchema.extend({
|
|
112
125
|
plaintext: z.string()
|
|
113
126
|
}).strict();
|
|
127
|
+
// Superadmin-only metadata view of another user's key (AA-17). Deliberately a
|
|
128
|
+
// distinct shape from ApiKeyPublicSchema — adds `user_id` + a server-derived
|
|
129
|
+
// `status`, omits `updated_at` — never reuse the owner schema here.
|
|
130
|
+
export const ApiKeyAdminStatusSchema = z.enum(["active", "revoked", "expired"]);
|
|
131
|
+
export const ApiKeyAdminPublicSchema = z.object({
|
|
132
|
+
id: z.string().uuid(),
|
|
133
|
+
name: z.string().nullable(),
|
|
134
|
+
user_id: z.string().uuid(),
|
|
135
|
+
revoked: z.boolean(),
|
|
136
|
+
expires_at: nullableIsoDate,
|
|
137
|
+
last_used_at: nullableIsoDate,
|
|
138
|
+
created_at: isoDate,
|
|
139
|
+
access_mode: ApiKeyAccessModeSchema,
|
|
140
|
+
status: ApiKeyAdminStatusSchema,
|
|
141
|
+
audiences: z.array(z.string()).default([])
|
|
142
|
+
}).strict();
|
|
143
|
+
export const ApiKeysAdminPublicSchema = z.object({
|
|
144
|
+
data: z.array(ApiKeyAdminPublicSchema),
|
|
145
|
+
count: z.number().int().nonnegative()
|
|
146
|
+
}).strict();
|
|
147
|
+
// Closed retention-window enum shared by both purge maintenance actions
|
|
148
|
+
// (AA-19) — never free text or a date.
|
|
149
|
+
export const RetentionWindowSchema = z.enum(["1w", "1m", "3m", "6m", "1y"]);
|
|
150
|
+
export const PurgeRequestSchema = z.object({
|
|
151
|
+
window: RetentionWindowSchema
|
|
152
|
+
}).strict();
|
|
153
|
+
export const PurgeResponseSchema = z.object({
|
|
154
|
+
window: RetentionWindowSchema,
|
|
155
|
+
removed: z.number().int().nonnegative()
|
|
156
|
+
}).strict();
|
|
157
|
+
export const AuditActionSchema = z.enum(["add", "edit", "delete"]);
|
|
158
|
+
export const PrivilegedActionAuditPublicSchema = z.object({
|
|
159
|
+
id: z.string().uuid(),
|
|
160
|
+
created_at: isoDate,
|
|
161
|
+
actor_user_id: z.string().uuid(),
|
|
162
|
+
actor_role: RoleTypeSchema,
|
|
163
|
+
action: AuditActionSchema,
|
|
164
|
+
table_name: z.string(),
|
|
165
|
+
row_pk: z.string(),
|
|
166
|
+
target_owner_id: z.string().nullable().optional()
|
|
167
|
+
}).strict();
|
|
168
|
+
export const PrivilegedActionAuditsPublicSchema = z.object({
|
|
169
|
+
data: z.array(PrivilegedActionAuditPublicSchema),
|
|
170
|
+
count: z.number().int().nonnegative()
|
|
171
|
+
}).strict();
|
|
114
172
|
export const ClientSessionPublicSchema = z.object({
|
|
115
173
|
id: z.string(),
|
|
116
174
|
provider: AuthProviderTypeSchema,
|
|
@@ -157,6 +215,19 @@ export const HealthSchema = z.object({
|
|
|
157
215
|
degraded_since: z.string().nullable(),
|
|
158
216
|
degradation_modes: z.record(z.string(), z.string())
|
|
159
217
|
}).passthrough();
|
|
218
|
+
// GET /meta (public, in OpenAPI). Mirrors auth_sdk_m8's ServiceMeta — the
|
|
219
|
+
// nested `contract` object is what compatibility.ts's getFaAuthM8Compatibility
|
|
220
|
+
// reads. `passthrough` so an added backend field never breaks the preflight.
|
|
221
|
+
export const ServiceMetaSchema = z.object({
|
|
222
|
+
service: z.string(),
|
|
223
|
+
version: z.string(),
|
|
224
|
+
api_version: z.string(),
|
|
225
|
+
contract: z.object({
|
|
226
|
+
name: z.string(),
|
|
227
|
+
version: z.string(),
|
|
228
|
+
range: z.string()
|
|
229
|
+
}).passthrough()
|
|
230
|
+
}).passthrough();
|
|
160
231
|
export const JwkSchema = z.object({
|
|
161
232
|
kty: z.string()
|
|
162
233
|
}).passthrough();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/runtime/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAG1F,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC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AC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;KAC/C,CAAC,CAAC,MAAM,EAAE;CACZ,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IAC5B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CAC5B,CAAC,CAAC,MAAM,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mano8/astro-auth-m8",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Astro integration and headless client for fa-auth-m8.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"registry.json",
|
|
25
25
|
"registry/r",
|
|
26
26
|
"README.md",
|
|
27
|
+
"CHANGELOG.md",
|
|
27
28
|
"LICENSE"
|
|
28
29
|
],
|
|
29
30
|
"bin": {
|
|
@@ -32,9 +33,11 @@
|
|
|
32
33
|
"exports": {
|
|
33
34
|
".": "./dist/src/integration.js",
|
|
34
35
|
"./api": "./dist/src/runtime/api/index.js",
|
|
36
|
+
"./authorization": "./dist/src/runtime/authorization.js",
|
|
35
37
|
"./client": "./dist/src/runtime/client.js",
|
|
36
38
|
"./browser-adapter": "./dist/src/runtime/browserAdapter.js",
|
|
37
39
|
"./schemas": "./dist/src/runtime/schemas.js",
|
|
40
|
+
"./errors": "./dist/src/runtime/errors.js",
|
|
38
41
|
"./hooks": "./dist/src/runtime/hooks/index.js",
|
|
39
42
|
"./list-params": "./dist/src/runtime/listParams.js",
|
|
40
43
|
"./react": "./dist/src/runtime/react/index.js",
|
|
@@ -59,7 +62,7 @@
|
|
|
59
62
|
"test:unit": "vitest run"
|
|
60
63
|
},
|
|
61
64
|
"dependencies": {
|
|
62
|
-
"@mano8/astro-ui-m8": "^1.4.
|
|
65
|
+
"@mano8/astro-ui-m8": "^1.4.2"
|
|
63
66
|
},
|
|
64
67
|
"peerDependencies": {
|
|
65
68
|
"@astrojs/react": "^6.0.1",
|
|
@@ -95,8 +98,8 @@
|
|
|
95
98
|
"esbuild": "^0.28.1"
|
|
96
99
|
},
|
|
97
100
|
"faAuthM8": {
|
|
98
|
-
"contract": "fa-auth-m8@
|
|
99
|
-
"testedServiceVersion": "
|
|
100
|
-
"serviceVersionRange": ">=
|
|
101
|
+
"contract": "fa-auth-m8@2.0",
|
|
102
|
+
"testedServiceVersion": "2.0.0",
|
|
103
|
+
"serviceVersionRange": ">=2.0.0 <3.0.0"
|
|
101
104
|
}
|
|
102
105
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"files": [
|
|
18
18
|
{
|
|
19
19
|
"path": "registry/blocks/account/account-crud.tsx",
|
|
20
|
-
"content": "\"use client\";\n\n// Shared skin helpers for the fa-auth account management panels (API keys +\n// admin users). Composes the canonical @mano8/astro-ui-m8 data-table and toast\n// blocks (copied into `@/components/m8-ui/*`) into the CRUD idioms the panels\n// share: a client-side controller for the server data-table, a popup form\n// dialog, a delete confirmation alert, the fixed row-actions cell, and the\n// bottom-right toast host. Copied into the consumer via the @fa-m8-auth\n// registry — edit freely per app.\nimport * as React from \"react\";\nimport { Pencil, Trash2 } from \"lucide-react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"@/components/ui/dialog\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"@/components/ui/alert-dialog\";\nimport type { DataTableSortDirection } from \"@/components/m8-ui/data-table\";\nimport {\n ToastNotificationHost,\n toastNotification,\n} from \"@/components/m8-ui/toast-notification\";\n\n// Bottom-right toast host + helpers for every account surface. Mount the host\n// once in the account shell; call `accountToast.success/error/info` from\n// mutation callbacks.\nexport function AccountToastHost() {\n return <ToastNotificationHost position=\"bottom-right\" />;\n}\nexport const accountToast = toastNotification;\n\n// --- client-side controller for the canonical (server-shaped) data-table -----\n// The shared data-table is a controlled/server component; this hook drives it\n// entirely client-side (search + sort + paginate over an in-memory array) so\n// the account panels get the page-size selector, orderable columns, and column\n// visibility for free without a server list endpoint.\nexport interface ClientTableController<TData> {\n data: TData[];\n rowCount: number;\n page: number;\n pageSize: number;\n onPageChange: (page: number) => void;\n onPageSizeChange: (pageSize: number) => void;\n sortBy?: string;\n sortDir?: DataTableSortDirection;\n onSortChange: (sortBy?: string, sortDir?: DataTableSortDirection) => void;\n q: string;\n onSearchChange: (q: string) => void;\n}\n\nexport interface UseClientTableOptions<TData> {\n search?: (row: TData) => string;\n sorters?: Record<string, (row: TData) => string | number>;\n initialSortBy?: string;\n initialSortDir?: DataTableSortDirection;\n initialPageSize?: number;\n}\n\nfunction compareValues(a: string | number, b: string | number): number {\n if (typeof a === \"number\" && typeof b === \"number\") return a - b;\n return String(a).localeCompare(String(b), undefined, {\n numeric: true,\n sensitivity: \"base\",\n });\n}\n\nexport function useClientTable<TData>(\n rows: TData[],\n options: UseClientTableOptions<TData> = {},\n): ClientTableController<TData> {\n const {\n search,\n sorters,\n initialSortBy,\n initialSortDir = \"asc\",\n initialPageSize = 10,\n } = options;\n const [page, setPage] = React.useState(1);\n const [pageSize, setPageSize] = React.useState(initialPageSize);\n const [sortBy, setSortBy] = React.useState<string | undefined>(initialSortBy);\n const [sortDir, setSortDir] = React.useState<DataTableSortDirection | undefined>(\n initialSortBy ? initialSortDir : undefined,\n );\n const [q, setQ] = React.useState(\"\");\n\n const normalizedQuery = q.trim().toLocaleLowerCase();\n const filtered = React.useMemo(() => {\n if (!normalizedQuery || !search) return rows;\n return rows.filter((row) =>\n search(row).toLocaleLowerCase().includes(normalizedQuery),\n );\n }, [rows, normalizedQuery, search]);\n\n const sorted = React.useMemo(() => {\n const sorter = sortBy && sorters ? sorters[sortBy] : undefined;\n if (!sorter || !sortDir) return filtered;\n const direction = sortDir === \"asc\" ? 1 : -1;\n return [...filtered].sort(\n (a, b) => compareValues(sorter(a), sorter(b)) * direction,\n );\n }, [filtered, sortBy, sortDir, sorters]);\n\n const rowCount = sorted.length;\n const pageCount = Math.max(1, Math.ceil(rowCount / Math.max(1, pageSize)));\n const currentPage = Math.min(page, pageCount);\n const pageRows = React.useMemo(\n () => sorted.slice((currentPage - 1) * pageSize, currentPage * pageSize),\n [sorted, currentPage, pageSize],\n );\n\n return {\n data: pageRows,\n rowCount,\n page: currentPage,\n pageSize,\n onPageChange: setPage,\n onPageSizeChange: (next) => {\n setPageSize(next);\n setPage(1);\n },\n sortBy,\n sortDir,\n onSortChange: (nextBy, nextDir) => {\n setSortBy(nextBy);\n setSortDir(nextDir);\n setPage(1);\n },\n q,\n onSearchChange: (next) => {\n setQ(next);\n setPage(1);\n },\n };\n}\n\n// --- fixed row-actions cell (rendered as the 2nd column) --------------------\nexport function RowActions({\n editLabel,\n deleteLabel,\n onEdit,\n onDelete,\n disabled,\n}: {\n editLabel: string;\n deleteLabel: string;\n onEdit: () => void;\n onDelete: () => void;\n disabled?: boolean;\n}) {\n return (\n <div className=\"flex items-center gap-2\" data-account-row-actions=\"\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={disabled}\n onClick={onEdit}\n data-account-action=\"edit\"\n >\n <Pencil className=\"size-3.5\" />\n <span className=\"sr-only lg:not-sr-only\">{editLabel}</span>\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"destructive\"\n disabled={disabled}\n onClick={onDelete}\n data-account-action=\"delete\"\n >\n <Trash2 className=\"size-3.5\" />\n <span className=\"sr-only lg:not-sr-only\">{deleteLabel}</span>\n </Button>\n </div>\n );\n}\n\n// --- popup form dialog ------------------------------------------------------\nexport function EntityFormDialog({\n open,\n onOpenChange,\n title,\n description,\n children,\n}: {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: string;\n description?: string;\n children: React.ReactNode;\n}) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"sm:max-w-lg\">\n <DialogHeader>\n <DialogTitle>{title}</DialogTitle>\n {description ? (\n <DialogDescription>{description}</DialogDescription>\n ) : null}\n </DialogHeader>\n {children}\n </DialogContent>\n </Dialog>\n );\n}\n\n// --- delete confirmation alert ----------------------------------------------\nexport function ConfirmDeleteDialog({\n open,\n onOpenChange,\n title,\n description,\n confirmLabel,\n cancelLabel,\n pending,\n onConfirm,\n}: {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: string;\n description: string;\n confirmLabel: string;\n cancelLabel: string;\n pending?: boolean;\n onConfirm: () => void;\n}) {\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{title}</AlertDialogTitle>\n <AlertDialogDescription>{description}</AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel disabled={pending}>{cancelLabel}</AlertDialogCancel>\n <AlertDialogAction\n variant=\"destructive\"\n disabled={pending}\n onClick={(event) => {\n event.preventDefault();\n onConfirm();\n }}\n >\n {confirmLabel}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n}\n\nexport function errorMessage(error: unknown, fallback: string):
|
|
20
|
+
"content": "\"use client\";\n\n// Shared skin helpers for the fa-auth account management panels (API keys +\n// admin users). Composes the canonical @mano8/astro-ui-m8 data-table and toast\n// blocks (copied into `@/components/m8-ui/*`) into the CRUD idioms the panels\n// share: a client-side controller for the server data-table, a popup form\n// dialog, a delete confirmation alert, the fixed row-actions cell, and the\n// bottom-right toast host. Copied into the consumer via the @fa-m8-auth\n// registry — edit freely per app.\nimport * as React from \"react\";\nimport { Pencil, Trash2 } from \"lucide-react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"@/components/ui/dialog\";\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"@/components/ui/alert-dialog\";\nimport type { DataTableSortDirection } from \"@/components/m8-ui/data-table\";\nimport {\n ToastNotificationHost,\n toastNotification,\n type ToastNotification,\n} from \"@/components/m8-ui/toast-notification\";\nimport { describeApiError } from \"@mano8/astro-auth-m8/errors\";\n\n// Bottom-right toast host + helpers for every account surface. Mount the host\n// once in the account shell; call `accountToast.success/error/info` from\n// mutation callbacks.\nexport function AccountToastHost() {\n return <ToastNotificationHost position=\"bottom-right\" />;\n}\nexport const accountToast = toastNotification;\n\n// --- client-side controller for the canonical (server-shaped) data-table -----\n// The shared data-table is a controlled/server component; this hook drives it\n// entirely client-side (search + sort + paginate over an in-memory array) so\n// the account panels get the page-size selector, orderable columns, and column\n// visibility for free without a server list endpoint.\nexport interface ClientTableController<TData> {\n data: TData[];\n rowCount: number;\n page: number;\n pageSize: number;\n onPageChange: (page: number) => void;\n onPageSizeChange: (pageSize: number) => void;\n sortBy?: string;\n sortDir?: DataTableSortDirection;\n onSortChange: (sortBy?: string, sortDir?: DataTableSortDirection) => void;\n q: string;\n onSearchChange: (q: string) => void;\n}\n\nexport interface UseClientTableOptions<TData> {\n search?: (row: TData) => string;\n sorters?: Record<string, (row: TData) => string | number>;\n initialSortBy?: string;\n initialSortDir?: DataTableSortDirection;\n initialPageSize?: number;\n}\n\nfunction compareValues(a: string | number, b: string | number): number {\n if (typeof a === \"number\" && typeof b === \"number\") return a - b;\n return String(a).localeCompare(String(b), undefined, {\n numeric: true,\n sensitivity: \"base\",\n });\n}\n\nexport function useClientTable<TData>(\n rows: TData[],\n options: UseClientTableOptions<TData> = {},\n): ClientTableController<TData> {\n const {\n search,\n sorters,\n initialSortBy,\n initialSortDir = \"asc\",\n initialPageSize = 10,\n } = options;\n const [page, setPage] = React.useState(1);\n const [pageSize, setPageSize] = React.useState(initialPageSize);\n const [sortBy, setSortBy] = React.useState<string | undefined>(initialSortBy);\n const [sortDir, setSortDir] = React.useState<DataTableSortDirection | undefined>(\n initialSortBy ? initialSortDir : undefined,\n );\n const [q, setQ] = React.useState(\"\");\n\n const normalizedQuery = q.trim().toLocaleLowerCase();\n const filtered = React.useMemo(() => {\n if (!normalizedQuery || !search) return rows;\n return rows.filter((row) =>\n search(row).toLocaleLowerCase().includes(normalizedQuery),\n );\n }, [rows, normalizedQuery, search]);\n\n const sorted = React.useMemo(() => {\n const sorter = sortBy && sorters ? sorters[sortBy] : undefined;\n if (!sorter || !sortDir) return filtered;\n const direction = sortDir === \"asc\" ? 1 : -1;\n return [...filtered].sort(\n (a, b) => compareValues(sorter(a), sorter(b)) * direction,\n );\n }, [filtered, sortBy, sortDir, sorters]);\n\n const rowCount = sorted.length;\n const pageCount = Math.max(1, Math.ceil(rowCount / Math.max(1, pageSize)));\n const currentPage = Math.min(page, pageCount);\n const pageRows = React.useMemo(\n () => sorted.slice((currentPage - 1) * pageSize, currentPage * pageSize),\n [sorted, currentPage, pageSize],\n );\n\n return {\n data: pageRows,\n rowCount,\n page: currentPage,\n pageSize,\n onPageChange: setPage,\n onPageSizeChange: (next) => {\n setPageSize(next);\n setPage(1);\n },\n sortBy,\n sortDir,\n onSortChange: (nextBy, nextDir) => {\n setSortBy(nextBy);\n setSortDir(nextDir);\n setPage(1);\n },\n q,\n onSearchChange: (next) => {\n setQ(next);\n setPage(1);\n },\n };\n}\n\n// --- fixed row-actions cell (rendered as the 2nd column) --------------------\nexport function RowActions({\n editLabel,\n deleteLabel,\n onEdit,\n onDelete,\n disabled,\n}: {\n editLabel: string;\n deleteLabel: string;\n onEdit: () => void;\n onDelete: () => void;\n disabled?: boolean;\n}) {\n return (\n <div className=\"flex items-center gap-2\" data-account-row-actions=\"\">\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"outline\"\n disabled={disabled}\n onClick={onEdit}\n data-account-action=\"edit\"\n >\n <Pencil className=\"size-3.5\" />\n <span className=\"sr-only lg:not-sr-only\">{editLabel}</span>\n </Button>\n <Button\n type=\"button\"\n size=\"sm\"\n variant=\"destructive\"\n disabled={disabled}\n onClick={onDelete}\n data-account-action=\"delete\"\n >\n <Trash2 className=\"size-3.5\" />\n <span className=\"sr-only lg:not-sr-only\">{deleteLabel}</span>\n </Button>\n </div>\n );\n}\n\n// --- popup form dialog ------------------------------------------------------\nexport function EntityFormDialog({\n open,\n onOpenChange,\n title,\n description,\n children,\n}: {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: string;\n description?: string;\n children: React.ReactNode;\n}) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"sm:max-w-lg\">\n <DialogHeader>\n <DialogTitle>{title}</DialogTitle>\n {description ? (\n <DialogDescription>{description}</DialogDescription>\n ) : null}\n </DialogHeader>\n {children}\n </DialogContent>\n </Dialog>\n );\n}\n\n// --- delete confirmation alert ----------------------------------------------\nexport function ConfirmDeleteDialog({\n open,\n onOpenChange,\n title,\n description,\n confirmLabel,\n cancelLabel,\n pending,\n onConfirm,\n}: {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: string;\n description: string;\n confirmLabel: string;\n cancelLabel: string;\n pending?: boolean;\n onConfirm: () => void;\n}) {\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>{title}</AlertDialogTitle>\n <AlertDialogDescription>{description}</AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel disabled={pending}>{cancelLabel}</AlertDialogCancel>\n <AlertDialogAction\n variant=\"destructive\"\n disabled={pending}\n onClick={(event) => {\n event.preventDefault();\n onConfirm();\n }}\n >\n {confirmLabel}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n}\n\nexport function errorMessage(error: unknown, fallback: string): ToastNotification {\n return describeApiError(error, fallback);\n}\n",
|
|
21
21
|
"type": "registry:component",
|
|
22
22
|
"target": "components/fa-auth/account-crud.tsx"
|
|
23
23
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
{
|
|
15
15
|
"path": "registry/blocks/account/account-dashboard.tsx",
|
|
16
|
-
"content": "\"use client\";\n\n// fa-auth account view whose FIRST/landing tab is the activity dashboard.\n// Headless auth state comes from the package (@mano8/astro-auth-m8/react); this\n// file is only the shadcn skin and is copied into the consumer via the\n// @fa-m8-auth registry. Secondary tabs (profile/sessions/api-keys/admin) are\n// passed in by the consumer via `extraTabs`, so locale + app-specific panels\n// stay owned by the app. Edit freely per app.\nimport * as React from \"react\";\nimport { LayoutDashboard, LogOut } from \"lucide-react\";\nimport {\n AuthProvider,\n useAuth,\n type AuthContextValue,\n} from \"@mano8/astro-auth-m8/react\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\";\nimport {\n DashboardOverview,\n type DashboardOverviewLabels,\n} from \"@/components/fa-auth/dashboard-overview\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface AccountTab {\n id: string;\n label: string;\n icon?: React.ComponentType<{ className?: string }>;\n content: React.ReactNode;\n /** Only render this tab when the signed-in user is a superuser. */\n superuserOnly?: boolean;\n}\n\nexport interface AccountDashboardLabels {\n dashboardTab: string;\n signOut: string;\n signInRequired: string;\n dashboard: Partial<DashboardOverviewLabels>;\n}\n\nconst DEFAULT_LABELS: AccountDashboardLabels = {\n dashboardTab: \"Dashboard\",\n signOut: \"Sign out\",\n signInRequired: \"Please sign in to view your account.\",\n dashboard: {},\n};\n\nexport interface AccountDashboardProps {\n /** Auth API base path; defaults to PUBLIC_FA_AUTH_API_BASE or \"/user\". */\n apiBase?: string;\n /** Dashboard scope: \"me\" (default) or \"global\" for superuser fleet stats. */\n scope?: \"me\" | \"global\";\n extraTabs?: AccountTab[];\n labels?: Partial<AccountDashboardLabels>;\n /** Rendered when the user is not authenticated. */\n signIn?: React.ReactNode;\n}\n\nfunction AccountShell({\n scope,\n extraTabs,\n labels,\n signIn,\n}: Required<Pick<AccountDashboardProps, \"scope\" | \"extraTabs\">> & {\n labels: AccountDashboardLabels;\n signIn?: React.ReactNode;\n}) {\n const { user, loading, logout }: AuthContextValue = useAuth();\n\n if (loading) {\n return (\n <div className=\"not-content mx-auto w-full max-w-6xl space-y-4\" aria-busy=\"true\">\n <Skeleton className=\"h-10 w-64\" />\n <Skeleton className=\"h-9 w-full max-w-md\" />\n <Skeleton className=\"h-72 w-full\" />\n </div>\n );\n }\n\n if (!user) {\n return (\n <div className=\"not-content mx-auto w-full max-w-md py-10 text-center text-sm text-muted-foreground\">\n {signIn ?? labels.signInRequired}\n </div>\n );\n }\n\n const visibleTabs = extraTabs.filter(\n (tab)
|
|
16
|
+
"content": "\"use client\";\n\n// fa-auth account view whose FIRST/landing tab is the activity dashboard.\n// Headless auth state comes from the package (@mano8/astro-auth-m8/react); this\n// file is only the shadcn skin and is copied into the consumer via the\n// @fa-m8-auth registry. Secondary tabs (profile/sessions/api-keys/admin) are\n// passed in by the consumer via `extraTabs`, so locale + app-specific panels\n// stay owned by the app. Edit freely per app.\nimport * as React from \"react\";\nimport { LayoutDashboard, LogOut } from \"lucide-react\";\nimport {\n AuthProvider,\n useAuth,\n type AuthContextValue,\n} from \"@mano8/astro-auth-m8/react\";\nimport {\n hasMinimumRole,\n hasSuperuserPrivileges,\n} from \"@mano8/astro-auth-m8/authorization\";\nimport type { RoleType } from \"@mano8/astro-auth-m8/schemas\";\n\nimport { Button } from \"@/components/ui/button\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport {\n NavigationMenu,\n NavigationMenuItem,\n NavigationMenuList,\n} from \"@/components/ui/navigation-menu\";\nimport {\n DashboardOverview,\n type DashboardOverviewLabels,\n} from \"@/components/fa-auth/dashboard-overview\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface AccountTab {\n id: string;\n label: string;\n icon?: React.ComponentType<{ className?: string }>;\n content: React.ReactNode;\n /** Only render this tab when the signed-in user is a superuser. */\n superuserOnly?: boolean;\n /**\n * Only render this tab when the signed-in user holds at least this role.\n * Uses the ordered hierarchy, so `minRole: \"admin\"` also admits a superadmin.\n * This is the admin tier: `fa-auth-m8` 2.0.0 authorizes the audit-log read\n * from the role hierarchy alone, so gating it with `superuserOnly` would hide\n * an admin's own surface from them.\n */\n minRole?: RoleType;\n}\n\nexport interface AccountDashboardLabels {\n dashboardTab: string;\n signOut: string;\n signInRequired: string;\n dashboard: Partial<DashboardOverviewLabels>;\n}\n\nconst DEFAULT_LABELS: AccountDashboardLabels = {\n dashboardTab: \"Dashboard\",\n signOut: \"Sign out\",\n signInRequired: \"Please sign in to view your account.\",\n dashboard: {},\n};\n\nexport interface AccountDashboardProps {\n /** Auth API base path; defaults to PUBLIC_FA_AUTH_API_BASE or \"/user\". */\n apiBase?: string;\n /** Dashboard scope: \"me\" (default) or \"global\" for superuser fleet stats. */\n scope?: \"me\" | \"global\";\n extraTabs?: AccountTab[];\n labels?: Partial<AccountDashboardLabels>;\n /** Rendered when the user is not authenticated. */\n signIn?: React.ReactNode;\n}\n\nfunction AccountShell({\n scope,\n extraTabs,\n labels,\n signIn,\n}: Required<Pick<AccountDashboardProps, \"scope\" | \"extraTabs\">> & {\n labels: AccountDashboardLabels;\n signIn?: React.ReactNode;\n}) {\n const { user, loading, logout }: AuthContextValue = useAuth();\n\n if (loading) {\n return (\n <div className=\"not-content mx-auto w-full max-w-6xl space-y-4\" aria-busy=\"true\">\n <Skeleton className=\"h-10 w-64\" />\n <Skeleton className=\"h-9 w-full max-w-md\" />\n <Skeleton className=\"h-72 w-full\" />\n </div>\n );\n }\n\n if (!user) {\n return (\n <div className=\"not-content mx-auto w-full max-w-md py-10 text-center text-sm text-muted-foreground\">\n {signIn ?? labels.signInRequired}\n </div>\n );\n }\n\n // Two deliberately different predicates: `superuserOnly` needs dual evidence\n // (role + is_superuser), `minRole` is the role hierarchy alone - the same\n // split the backend makes between its superuser and admin dependencies.\n // Each is only a display gate; every panel still self-gates and the service\n // stays the authority.\n const visibleTabs = extraTabs.filter(\n (tab) =>\n (!tab.superuserOnly ||\n hasSuperuserPrivileges(user.role, user.is_superuser)) &&\n (!tab.minRole || hasMinimumRole(user.role, tab.minRole)),\n );\n const [activeTab, setActiveTab] = React.useState<string>(\"dashboard\");\n const navItems = [\n {\n id: \"dashboard\",\n label: labels.dashboardTab,\n icon: LayoutDashboard,\n content: <DashboardOverview scope={scope} labels={labels.dashboard} />,\n },\n ...visibleTabs,\n ];\n const columnClass = navItems.length >= 5 ? \"lg:grid-cols-5\" : \"lg:grid-cols-4\";\n\n return (\n <div className=\"not-content mx-auto flex w-full max-w-6xl flex-col gap-6\">\n <div className=\"flex flex-col gap-4 border-b pb-5 lg:flex-row lg:items-end lg:justify-between\">\n <div className=\"min-w-0 space-y-2\">\n <h1 className=\"text-2xl font-semibold tracking-tight md:text-3xl\">\n {user.email}\n </h1>\n <div className=\"flex flex-wrap items-center gap-2 text-sm text-muted-foreground\">\n <span className=\"rounded-md border px-2 py-0.5 text-xs uppercase tracking-wide\">\n {user.role}\n </span>\n {user.is_superuser ? (\n <span className=\"rounded-md border px-2 py-0.5 text-xs uppercase tracking-wide\">\n superuser\n </span>\n ) : null}\n </div>\n </div>\n <Button\n variant=\"outline\"\n onClick={() => void logout()}\n className=\"w-full justify-center gap-2 sm:w-auto\"\n >\n <LogOut className=\"size-4\" />\n {labels.signOut}\n </Button>\n </div>\n\n <div className=\"space-y-4\">\n <NavigationMenu viewport={false} className=\"w-full max-w-none justify-stretch\">\n <NavigationMenuList\n className={cn(\n \"grid h-auto w-full grid-cols-1 items-stretch justify-stretch rounded-lg border border-border bg-muted/40 p-1 sm:grid-cols-2\",\n columnClass,\n )}\n >\n {navItems.map((tab) => {\n const Icon = tab.icon;\n const active = activeTab === tab.id;\n return (\n <NavigationMenuItem key={tab.id}>\n <button\n type=\"button\"\n aria-current={active ? \"page\" : undefined}\n className=\"inline-flex h-9 w-full min-w-0 items-center justify-center gap-2 rounded-md px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none select-none hover:bg-background hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 data-[active=true]:bg-background data-[active=true]:text-foreground data-[active=true]:shadow-xs\"\n data-active={active}\n onClick={() => setActiveTab(tab.id)}\n >\n {Icon ? <Icon className=\"size-4 shrink-0\" /> : null}\n <span className=\"truncate\">{tab.label}</span>\n </button>\n </NavigationMenuItem>\n );\n })}\n </NavigationMenuList>\n </NavigationMenu>\n\n {navItems.map((tab) =>\n activeTab === tab.id ? <React.Fragment key={tab.id}>{tab.content}</React.Fragment> : null,\n )}\n </div>\n </div>\n );\n}\n\nexport default function AccountDashboard({\n apiBase,\n scope = \"me\",\n extraTabs = [],\n labels,\n signIn,\n}: AccountDashboardProps) {\n const resolved: AccountDashboardLabels = {\n ...DEFAULT_LABELS,\n ...labels,\n dashboard: { ...DEFAULT_LABELS.dashboard, ...labels?.dashboard },\n };\n const config = apiBase ? { apiBase } : undefined;\n return (\n <AuthProvider config={config}>\n <AccountShell\n scope={scope}\n extraTabs={extraTabs}\n labels={resolved}\n signIn={signIn}\n />\n </AuthProvider>\n );\n}\n",
|
|
17
17
|
"type": "registry:component",
|
|
18
18
|
"target": "components/fa-auth/account-dashboard.tsx"
|
|
19
19
|
}
|