@axium/core 0.18.1 → 0.18.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.
- package/dist/api.d.ts +26 -0
- package/dist/api.js +2 -1
- package/dist/user.d.ts +15 -0
- package/dist/user.js +7 -0
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -462,6 +462,32 @@ declare const _API: {
|
|
|
462
462
|
isAdmin: z.ZodBoolean;
|
|
463
463
|
isSuspended: z.ZodBoolean;
|
|
464
464
|
}, z.core.$strip>>;
|
|
465
|
+
readonly PATCH: [z.ZodObject<{
|
|
466
|
+
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
467
|
+
debug: z.ZodDefault<z.ZodBoolean>;
|
|
468
|
+
}, z.core.$strip>>>;
|
|
469
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
470
|
+
id: z.ZodNonOptional<z.ZodOptional<z.ZodUUID>>;
|
|
471
|
+
name: z.ZodOptional<z.ZodString>;
|
|
472
|
+
image: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodURL>>>;
|
|
473
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
474
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
475
|
+
isSuspended: z.ZodOptional<z.ZodBoolean>;
|
|
476
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
477
|
+
id: z.ZodUUID;
|
|
478
|
+
name: z.ZodString;
|
|
479
|
+
email: z.ZodEmail;
|
|
480
|
+
emailVerified: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
481
|
+
image: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
482
|
+
preferences: z.ZodLazy<z.ZodObject<{
|
|
483
|
+
debug: z.ZodDefault<z.ZodBoolean>;
|
|
484
|
+
}, z.core.$strip>>;
|
|
485
|
+
roles: z.ZodArray<z.ZodString>;
|
|
486
|
+
tags: z.ZodArray<z.ZodString>;
|
|
487
|
+
registeredAt: z.ZodCoercedDate<unknown>;
|
|
488
|
+
isAdmin: z.ZodBoolean;
|
|
489
|
+
isSuspended: z.ZodBoolean;
|
|
490
|
+
}, z.core.$strip>];
|
|
465
491
|
readonly PUT: [z.ZodObject<{
|
|
466
492
|
name: z.ZodString;
|
|
467
493
|
email: z.ZodEmail;
|
package/dist/api.js
CHANGED
|
@@ -6,7 +6,7 @@ import { NewSessionResponse, Session, Verification, VerificationInternal } from
|
|
|
6
6
|
import { PackageVersionInfo } from './packages.js';
|
|
7
7
|
import { Passkey, PasskeyAuthOptions, PasskeyAuthResponse, PasskeyChangeable, PasskeyCreationOptions, PasskeyRegistration, } from './passkeys.js';
|
|
8
8
|
import { PluginInternal, PluginUpdate } from './plugins.js';
|
|
9
|
-
import { LogoutSessions, User, UserAuthOptions, UserChangeable, UserPublic, UserRegistration, UserRegistrationInit } from './user.js';
|
|
9
|
+
import { LogoutSessions, User, UserAdminChange, UserAuthOptions, UserChangeable, UserPublic, UserRegistration, UserRegistrationInit, } from './user.js';
|
|
10
10
|
export const AdminSummary = z.object({
|
|
11
11
|
users: z.int().nonnegative(),
|
|
12
12
|
passkeys: z.int().nonnegative(),
|
|
@@ -84,6 +84,7 @@ const _API = {
|
|
|
84
84
|
},
|
|
85
85
|
'admin/users': {
|
|
86
86
|
GET: User.array(),
|
|
87
|
+
PATCH: [UserAdminChange, User],
|
|
87
88
|
PUT: [z.object({ name: z.string(), email: z.email() }), z.object({ user: User, verification: VerificationInternal })],
|
|
88
89
|
},
|
|
89
90
|
'admin/config': {
|
package/dist/user.d.ts
CHANGED
|
@@ -50,6 +50,21 @@ export declare const UserChangeable: z.ZodObject<{
|
|
|
50
50
|
export interface UserChangeable extends z.infer<typeof UserChangeable> {
|
|
51
51
|
preferences?: Preferences;
|
|
52
52
|
}
|
|
53
|
+
export declare const UserAdminChange: z.ZodObject<{
|
|
54
|
+
preferences: z.ZodOptional<z.ZodLazy<z.ZodObject<{
|
|
55
|
+
debug: z.ZodDefault<z.ZodBoolean>;
|
|
56
|
+
}, z.core.$strip>>>;
|
|
57
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
58
|
+
id: z.ZodNonOptional<z.ZodOptional<z.ZodUUID>>;
|
|
59
|
+
name: z.ZodOptional<z.ZodString>;
|
|
60
|
+
image: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodURL>>>;
|
|
61
|
+
roles: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
63
|
+
isSuspended: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
export interface UserAdminChange extends z.infer<typeof UserAdminChange> {
|
|
66
|
+
preferences?: Preferences;
|
|
67
|
+
}
|
|
53
68
|
export declare function getUserImage(user: Partial<User>): string;
|
|
54
69
|
export declare const UserRegistrationInit: z.ZodObject<{
|
|
55
70
|
name: z.ZodOptional<z.ZodString>;
|
package/dist/user.js
CHANGED
|
@@ -35,6 +35,13 @@ export const UserChangeable = z
|
|
|
35
35
|
preferences: z.lazy(() => Preferences),
|
|
36
36
|
})
|
|
37
37
|
.partial();
|
|
38
|
+
export const UserAdminChange = z
|
|
39
|
+
.object({
|
|
40
|
+
...pick(User.shape, 'id', 'name', 'email', 'image', 'roles', 'tags', 'isSuspended'),
|
|
41
|
+
preferences: z.lazy(() => Preferences),
|
|
42
|
+
})
|
|
43
|
+
.partial()
|
|
44
|
+
.required({ id: true });
|
|
38
45
|
export function getUserImage(user) {
|
|
39
46
|
if (user.image)
|
|
40
47
|
return user.image;
|