prostgles-client 4.0.155 → 4.0.157

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/Auth.d.ts CHANGED
@@ -5,24 +5,24 @@ type Args = {
5
5
  onReload: VoidFunction | undefined;
6
6
  };
7
7
  type WithProviderLogin = Partial<Record<IdentityProvider, VoidFunction>>;
8
- type SignupResult = {
8
+ export type AuthResult = {
9
9
  success: true;
10
10
  } | {
11
11
  success: false;
12
12
  error: string;
13
13
  };
14
- export type PasswordAuth = (params: {
14
+ export type PasswordLoginData = {
15
15
  username: string;
16
16
  password: string;
17
17
  remember_me?: boolean;
18
18
  totp_token?: string;
19
19
  totp_recovery_code?: string;
20
- }) => Promise<SignupResult>;
21
- export type MagicLinkAuth = (params: {
22
- username: string;
23
- }) => Promise<SignupResult>;
24
- type EmailAuth = {
25
- withPassword?: PasswordAuth;
20
+ };
21
+ export type PasswordRegisterData = Pick<PasswordLoginData, "username" | "password">;
22
+ export type PasswordAuth<T> = (params: T) => Promise<AuthResult>;
23
+ export type MagicLinkAuth = (params: Pick<PasswordLoginData, "username">) => Promise<AuthResult>;
24
+ export type EmailAuth<T> = {
25
+ withPassword?: PasswordAuth<T>;
26
26
  withMagicLink?: undefined;
27
27
  } | {
28
28
  withPassword?: undefined;
@@ -32,8 +32,8 @@ type LoginSignupOptions = {
32
32
  prefferedLogin: string;
33
33
  login: undefined | {
34
34
  withProvider?: WithProviderLogin;
35
- } & EmailAuth;
36
- register: undefined | EmailAuth;
35
+ } & EmailAuth<PasswordLoginData>;
36
+ register: undefined | EmailAuth<PasswordRegisterData>;
37
37
  providers: AuthSocketSchema["providers"];
38
38
  };
39
39
  type AuthStateLoggedOut = LoginSignupOptions & {
@@ -1 +1 @@
1
- {"version":3,"file":"Auth.d.ts","sourceRoot":"","sources":["../lib/Auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA0D,KAAK,gBAAgB,EAAY,KAAK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,CAAC;AAEpB,eAAO,MAAM,SAAS,+CAAgD,IAAI,KAAG,WAoE5E,CAAA;AAED,eAAO,MAAM,IAAI,SAAgB,MAAM,QAAQ,MAAM,iBAmBpD,CAAA"}
package/lib/Auth.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type AnyObject, type AuthGuardLocation, type AuthGuardLocationResponse, type AuthSocketSchema, CHANNELS, type IdentityProvider, type EmailAuthType, isEmpty } from "prostgles-types";
1
+ import { type AnyObject, type AuthGuardLocation, type AuthGuardLocationResponse, type AuthSocketSchema, CHANNELS, type IdentityProvider, isEmpty } from "prostgles-types";
2
2
  import { hasWnd } from "./prostgles";
3
3
 
4
4
  type Args = {
@@ -9,16 +9,18 @@ type Args = {
9
9
 
10
10
  type WithProviderLogin = Partial<Record<IdentityProvider, VoidFunction>>;
11
11
 
12
- type SignupResult =
12
+ export type AuthResult =
13
13
  | { success: true; }
14
14
  | { success: false; error: string; }
15
15
 
16
- export type PasswordAuth = (params: { username: string; password: string; remember_me?: boolean; totp_token?: string; totp_recovery_code?: string; }) => Promise<SignupResult>;
17
- export type MagicLinkAuth = (params: { username: string; }) => Promise<SignupResult>;
16
+ export type PasswordLoginData = { username: string; password: string; remember_me?: boolean; totp_token?: string; totp_recovery_code?: string; };
17
+ export type PasswordRegisterData = Pick<PasswordLoginData, "username" | "password">
18
+ export type PasswordAuth<T> = (params: T) => Promise<AuthResult>;
19
+ export type MagicLinkAuth = (params: Pick<PasswordLoginData, "username">) => Promise<AuthResult>;
18
20
 
19
- type EmailAuth =
21
+ export type EmailAuth<T> =
20
22
  | {
21
- withPassword?: PasswordAuth
23
+ withPassword?: PasswordAuth<T>
22
24
  withMagicLink?: undefined;
23
25
  }
24
26
  | {
@@ -30,8 +32,8 @@ type LoginSignupOptions = {
30
32
  prefferedLogin: string;
31
33
  login: undefined | {
32
34
  withProvider?: WithProviderLogin;
33
- } & EmailAuth;
34
- register: undefined | EmailAuth;
35
+ } & EmailAuth<PasswordLoginData>;
36
+ register: undefined | EmailAuth<PasswordRegisterData>;
35
37
  providers: AuthSocketSchema["providers"];
36
38
  }
37
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prostgles-client",
3
- "version": "4.0.155",
3
+ "version": "4.0.157",
4
4
  "description": "Reactive client for Postgres",
5
5
  "main": "dist/prostgles-full.js",
6
6
  "types": "dist/prostgles-full.d.ts",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "..": {
19
19
  "name": "prostgles-client",
20
- "version": "4.0.154",
20
+ "version": "4.0.156",
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
23
  "prostgles-types": "^4.0.107"
@@ -17,7 +17,6 @@
17
17
  "noImplicitAny": false,
18
18
  "declaration": true,
19
19
  "declarationMap": true,
20
- "keyofStringsOnly": true,
21
20
  "ignoreDeprecations": "5.0",
22
21
  "skipLibCheck": true,
23
22
  "noUncheckedIndexedAccess": false