@axium/core 0.18.0 → 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 +36 -10
- package/dist/api.js +8 -7
- package/dist/user.d.ts +15 -0
- package/dist/user.js +7 -0
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import * as z from 'zod';
|
|
|
2
2
|
import { Severity } from './audit.js';
|
|
3
3
|
import type { RequestMethod } from './requests.js';
|
|
4
4
|
export declare const AdminSummary: z.ZodObject<{
|
|
5
|
-
users: z.
|
|
6
|
-
passkeys: z.
|
|
7
|
-
sessions: z.
|
|
5
|
+
users: z.ZodInt;
|
|
6
|
+
passkeys: z.ZodInt;
|
|
7
|
+
sessions: z.ZodInt;
|
|
8
8
|
auditEvents: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
9
|
-
configFiles: z.
|
|
10
|
-
plugins: z.
|
|
9
|
+
configFiles: z.ZodInt;
|
|
10
|
+
plugins: z.ZodInt;
|
|
11
11
|
versions: z.ZodRecord<z.ZodLiteral<"client" | "server" | "core">, z.ZodObject<{
|
|
12
12
|
name: z.ZodString;
|
|
13
13
|
version: z.ZodString;
|
|
@@ -433,12 +433,12 @@ declare const _API: {
|
|
|
433
433
|
};
|
|
434
434
|
readonly 'admin/summary': {
|
|
435
435
|
readonly GET: z.ZodObject<{
|
|
436
|
-
users: z.
|
|
437
|
-
passkeys: z.
|
|
438
|
-
sessions: z.
|
|
436
|
+
users: z.ZodInt;
|
|
437
|
+
passkeys: z.ZodInt;
|
|
438
|
+
sessions: z.ZodInt;
|
|
439
439
|
auditEvents: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
440
|
-
configFiles: z.
|
|
441
|
-
plugins: z.
|
|
440
|
+
configFiles: z.ZodInt;
|
|
441
|
+
plugins: z.ZodInt;
|
|
442
442
|
versions: z.ZodRecord<z.ZodLiteral<"client" | "server" | "core">, z.ZodObject<{
|
|
443
443
|
name: z.ZodString;
|
|
444
444
|
version: z.ZodString;
|
|
@@ -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,14 +6,14 @@ 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
|
-
users: z.
|
|
12
|
-
passkeys: z.
|
|
13
|
-
sessions: z.
|
|
14
|
-
auditEvents: z.tuple(Array(Severity.Debug + 1).fill(z.
|
|
15
|
-
configFiles: z.
|
|
16
|
-
plugins: z.
|
|
11
|
+
users: z.int().nonnegative(),
|
|
12
|
+
passkeys: z.int().nonnegative(),
|
|
13
|
+
sessions: z.int().nonnegative(),
|
|
14
|
+
auditEvents: z.tuple(Array(Severity.Debug + 1).fill(z.int().nonnegative())),
|
|
15
|
+
configFiles: z.int().nonnegative(),
|
|
16
|
+
plugins: z.int().nonnegative(),
|
|
17
17
|
versions: z.record(z.literal(['core', 'server', 'client']), PackageVersionInfo),
|
|
18
18
|
});
|
|
19
19
|
/**
|
|
@@ -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;
|