@axium/core 0.2.0 → 0.3.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/dist/api.d.ts CHANGED
@@ -1,13 +1,14 @@
1
1
  import type { AuthenticatorTransportFuture, CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
2
2
  import type z from 'zod/v4';
3
3
  import type { RequestMethod } from './requests.js';
4
- import type { APIUserRegistration, PasskeyAuthenticationResponse, PasskeyChangeable, PasskeyRegistration, UserAuthOptions } from './schemas.js';
4
+ import type { APIUserRegistration, LogoutSessions, PasskeyAuthenticationResponse, PasskeyChangeable, PasskeyRegistration, UserAuthOptions } from './schemas.js';
5
5
  import type { User, UserChangeable, UserPublic } from './user.js';
6
6
  export interface Session {
7
7
  id: string;
8
8
  userId: string;
9
9
  expires: Date;
10
10
  created: Date;
11
+ elevated: boolean;
11
12
  }
12
13
  export interface Verification {
13
14
  userId: string;
@@ -70,7 +71,7 @@ export interface _apiTypes {
70
71
  };
71
72
  'users/:id/sessions': {
72
73
  GET: Session[];
73
- DELETE: [string, Session[]];
74
+ DELETE: [z.input<typeof LogoutSessions>, Session[]];
74
75
  };
75
76
  'users/:id/passkeys': {
76
77
  OPTIONS: PublicKeyCredentialCreationOptionsJSON;
@@ -78,6 +79,9 @@ export interface _apiTypes {
78
79
  PUT: [z.input<typeof PasskeyRegistration>, Passkey];
79
80
  };
80
81
  'users/:id/verify_email': {
82
+ OPTIONS: {
83
+ enabled: boolean;
84
+ };
81
85
  GET: Verification;
82
86
  POST: [{
83
87
  token: string;
package/dist/schemas.d.ts CHANGED
@@ -73,6 +73,10 @@ export declare const PasskeyChangeable: z.ZodObject<{
73
73
  name: z.ZodOptional<z.ZodString>;
74
74
  }, z.core.$strip>;
75
75
  export declare const UserAuthOptions: z.ZodObject<{
76
- type: z.ZodLiteral<"action" | "login">;
76
+ type: z.ZodLiteral<"login" | "action">;
77
77
  }, z.core.$strip>;
78
78
  export type UserAuthOptions = z.infer<typeof UserAuthOptions>;
79
+ export declare const LogoutSessions: z.ZodObject<{
80
+ id: z.ZodOptional<z.ZodArray<z.ZodUUID>>;
81
+ confirm_all: z.ZodOptional<z.ZodBoolean>;
82
+ }, z.core.$strip>;
package/dist/schemas.js CHANGED
@@ -46,3 +46,7 @@ export const APIUserRegistration = z.object({
46
46
  });
47
47
  export const PasskeyChangeable = z.object({ name: z.string() }).partial();
48
48
  export const UserAuthOptions = z.object({ type: z.literal(['login', 'action']) });
49
+ export const LogoutSessions = z.object({
50
+ id: z.array(z.uuid()).optional(),
51
+ confirm_all: z.boolean().optional(),
52
+ });
package/dist/user.d.ts CHANGED
@@ -21,9 +21,9 @@ export interface UserPublic extends Pick<User, UserPublicField> {
21
21
  }
22
22
  export declare const userProtectedFields: ["email", "emailVerified", "preferences"];
23
23
  export declare const UserChangeable: z.ZodObject<{
24
+ email: z.ZodOptional<z.ZodEmail>;
24
25
  name: z.ZodOptional<z.ZodString>;
25
26
  image: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodURL>>>;
26
- email: z.ZodOptional<z.ZodEmail>;
27
27
  }, z.core.$strip>;
28
28
  export type UserChangeable = z.infer<typeof UserChangeable>;
29
29
  export declare function getUserImage(user: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axium/core",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "author": "James Prevett <axium@jamespre.dev> (https://jamespre.dev)",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -27,8 +27,10 @@
27
27
  "scripts": {
28
28
  "build": "tsc"
29
29
  },
30
- "dependencies": {
31
- "@simplewebauthn/types": "^12.0.0",
30
+ "peerDependencies": {
32
31
  "zod": "^3.25.61"
32
+ },
33
+ "dependencies": {
34
+ "@simplewebauthn/types": "^12.0.0"
33
35
  }
34
36
  }