@sparkstudio/authentication-ui 1.0.2 → 1.0.3

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/index.d.cts CHANGED
@@ -12,4 +12,92 @@ interface AuthenticatorProviderProps {
12
12
  */
13
13
  declare const AuthenticatorProvider: React.FC<AuthenticatorProviderProps>;
14
14
 
15
- export { AuthenticatorProvider, type AuthenticatorProviderProps, UserInfoCard };
15
+ interface LoginButtonProps {
16
+ onSuccess?: (tokenResponse: any) => void;
17
+ }
18
+ declare const LoginButton: React.FC<LoginButtonProps>;
19
+
20
+ /**
21
+ * Represents an Auto-generated model for UserDTO.
22
+ */
23
+ interface IUserDTO {
24
+ Sub?: string;
25
+ Name?: string;
26
+ Email?: string;
27
+ ProfilePicture?: string;
28
+ }
29
+ type UserDTOInit = Partial<IUserDTO>;
30
+ declare class UserDTO implements IUserDTO {
31
+ Sub?: string;
32
+ Name?: string;
33
+ Email?: string;
34
+ ProfilePicture?: string;
35
+ constructor(init: UserDTOInit);
36
+ }
37
+
38
+ interface UserContextType {
39
+ user: UserDTO | null;
40
+ setUser: (user: UserDTO | null) => void;
41
+ logout: () => Promise<void>;
42
+ }
43
+ declare const UserProvider: React.FC<{
44
+ children: React.ReactNode;
45
+ }>;
46
+ declare const useUser: () => UserContextType;
47
+
48
+ type Guid = string;
49
+ declare const EMPTY_GUID: Guid;
50
+
51
+ /**
52
+ * Represents an Auto-generated model for TokenRequest.
53
+ */
54
+ interface ITokenRequest {
55
+ Token?: string;
56
+ }
57
+ type TokenRequestInit = Partial<ITokenRequest>;
58
+ declare class TokenRequest implements ITokenRequest {
59
+ Token?: string;
60
+ constructor(init: TokenRequestInit);
61
+ }
62
+
63
+ /**
64
+ * Represents an Auto-generated model for AuthResponse.
65
+ */
66
+ interface IAuthResponse {
67
+ User: UserDTO;
68
+ }
69
+ type AuthResponseInit = Partial<IAuthResponse> & Pick<IAuthResponse, "User">;
70
+ declare class AuthResponse implements IAuthResponse {
71
+ User: UserDTO;
72
+ constructor(init: AuthResponseInit);
73
+ }
74
+
75
+ /**
76
+ * Auto-generated client for the Auth controller.
77
+ */
78
+ declare class Auth {
79
+ private baseUrl;
80
+ constructor(baseUrl: string);
81
+ Logout(): Promise<UserDTO>;
82
+ GetCurrentUser(): Promise<UserDTO>;
83
+ SignIn(tokenRequest: TokenRequest): Promise<AuthResponse>;
84
+ }
85
+
86
+ /**
87
+ * Auto-generated client for the Home controller.
88
+ */
89
+ declare class Home {
90
+ private baseUrl;
91
+ constructor(baseUrl: string);
92
+ }
93
+
94
+ /**
95
+ * Auto-generated API client.
96
+ */
97
+ declare class SparkStudioAuthenticationSDK {
98
+ auth: Auth;
99
+ home: Home;
100
+ constructor(baseUrl: string);
101
+ }
102
+
103
+ export { AuthenticatorProvider, type AuthenticatorProviderProps, EMPTY_GUID, type Guid, LoginButton, SparkStudioAuthenticationSDK, UserInfoCard, UserProvider, useUser };
package/dist/index.d.ts CHANGED
@@ -12,4 +12,92 @@ interface AuthenticatorProviderProps {
12
12
  */
13
13
  declare const AuthenticatorProvider: React.FC<AuthenticatorProviderProps>;
14
14
 
15
- export { AuthenticatorProvider, type AuthenticatorProviderProps, UserInfoCard };
15
+ interface LoginButtonProps {
16
+ onSuccess?: (tokenResponse: any) => void;
17
+ }
18
+ declare const LoginButton: React.FC<LoginButtonProps>;
19
+
20
+ /**
21
+ * Represents an Auto-generated model for UserDTO.
22
+ */
23
+ interface IUserDTO {
24
+ Sub?: string;
25
+ Name?: string;
26
+ Email?: string;
27
+ ProfilePicture?: string;
28
+ }
29
+ type UserDTOInit = Partial<IUserDTO>;
30
+ declare class UserDTO implements IUserDTO {
31
+ Sub?: string;
32
+ Name?: string;
33
+ Email?: string;
34
+ ProfilePicture?: string;
35
+ constructor(init: UserDTOInit);
36
+ }
37
+
38
+ interface UserContextType {
39
+ user: UserDTO | null;
40
+ setUser: (user: UserDTO | null) => void;
41
+ logout: () => Promise<void>;
42
+ }
43
+ declare const UserProvider: React.FC<{
44
+ children: React.ReactNode;
45
+ }>;
46
+ declare const useUser: () => UserContextType;
47
+
48
+ type Guid = string;
49
+ declare const EMPTY_GUID: Guid;
50
+
51
+ /**
52
+ * Represents an Auto-generated model for TokenRequest.
53
+ */
54
+ interface ITokenRequest {
55
+ Token?: string;
56
+ }
57
+ type TokenRequestInit = Partial<ITokenRequest>;
58
+ declare class TokenRequest implements ITokenRequest {
59
+ Token?: string;
60
+ constructor(init: TokenRequestInit);
61
+ }
62
+
63
+ /**
64
+ * Represents an Auto-generated model for AuthResponse.
65
+ */
66
+ interface IAuthResponse {
67
+ User: UserDTO;
68
+ }
69
+ type AuthResponseInit = Partial<IAuthResponse> & Pick<IAuthResponse, "User">;
70
+ declare class AuthResponse implements IAuthResponse {
71
+ User: UserDTO;
72
+ constructor(init: AuthResponseInit);
73
+ }
74
+
75
+ /**
76
+ * Auto-generated client for the Auth controller.
77
+ */
78
+ declare class Auth {
79
+ private baseUrl;
80
+ constructor(baseUrl: string);
81
+ Logout(): Promise<UserDTO>;
82
+ GetCurrentUser(): Promise<UserDTO>;
83
+ SignIn(tokenRequest: TokenRequest): Promise<AuthResponse>;
84
+ }
85
+
86
+ /**
87
+ * Auto-generated client for the Home controller.
88
+ */
89
+ declare class Home {
90
+ private baseUrl;
91
+ constructor(baseUrl: string);
92
+ }
93
+
94
+ /**
95
+ * Auto-generated API client.
96
+ */
97
+ declare class SparkStudioAuthenticationSDK {
98
+ auth: Auth;
99
+ home: Home;
100
+ constructor(baseUrl: string);
101
+ }
102
+
103
+ export { AuthenticatorProvider, type AuthenticatorProviderProps, EMPTY_GUID, type Guid, LoginButton, SparkStudioAuthenticationSDK, UserInfoCard, UserProvider, useUser };
package/dist/index.js CHANGED
@@ -3234,13 +3234,8 @@ var useUser = () => {
3234
3234
  // src/components/Buttons/LoginButton.tsx
3235
3235
  var import_react2 = __toESM(require_react(), 1);
3236
3236
  import { useGoogleLogin } from "@react-oauth/google";
3237
- import { Button } from "@sparkstudio/common-ui";
3238
-
3239
- // src/assets/icons/google_icon.webp
3240
- var google_icon_default = "./google_icon-IHKY4ITL.webp";
3241
-
3242
- // src/components/Buttons/LoginButton.tsx
3243
3237
  var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
3238
+ import { Button } from "@sparkstudio/common-ui";
3244
3239
  var LoginButton = ({ onSuccess }) => {
3245
3240
  const { setUser } = useUser();
3246
3241
  const resolveRef = (0, import_react2.useRef)(null);
@@ -3285,7 +3280,7 @@ var LoginButton = ({ onSuccess }) => {
3285
3280
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
3286
3281
  "img",
3287
3282
  {
3288
- src: google_icon_default,
3283
+ src: "../../assets/icons/google_icon.webp",
3289
3284
  alt: "Google",
3290
3285
  style: { width: "21px", height: "21px", margin: 0, padding: 0 }
3291
3286
  }
@@ -3354,9 +3349,17 @@ var AuthenticatorProvider = ({
3354
3349
  }) => {
3355
3350
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GoogleOAuthProvider, { clientId: googleClientId, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(UserProvider, { children }) });
3356
3351
  };
3352
+
3353
+ // src/types/Guid.ts
3354
+ var EMPTY_GUID = "00000000-0000-0000-0000-000000000000";
3357
3355
  export {
3358
3356
  AuthenticatorProvider,
3359
- UserInfoCard
3357
+ EMPTY_GUID,
3358
+ LoginButton,
3359
+ SparkStudioAuthenticationSDK,
3360
+ UserInfoCard,
3361
+ UserProvider,
3362
+ useUser
3360
3363
  };
3361
3364
  /*! Bundled license information:
3362
3365