@howone/sdk 0.1.1 → 0.1.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.mts CHANGED
@@ -159,9 +159,6 @@ declare class UnifiedAuthService {
159
159
  valid: boolean;
160
160
  user?: any;
161
161
  }>;
162
- /**
163
- * 从本地存储获取认证数据
164
- */
165
162
  private getSavedAuthData;
166
163
  /**
167
164
  * 保存认证数据到本地存储
@@ -385,6 +382,12 @@ declare function createClient(opts?: {
385
382
  setVisibility(id: string, visibility: string): Promise<void>;
386
383
  delete(id: string): Promise<void>;
387
384
  };
385
+ me: () => Promise<{
386
+ id: string;
387
+ email: string;
388
+ name: string;
389
+ avatar: string;
390
+ } | null>;
388
391
  auth: {
389
392
  setToken: (t: string | null) => void;
390
393
  getToken: () => string | null;
@@ -401,25 +404,10 @@ interface LoginFormProps {
401
404
  }
402
405
  declare const LoginForm: React.FC<LoginFormProps>;
403
406
 
404
- interface AuthGuardProps {
405
- children: React.ReactNode;
406
- fallback?: React.ReactNode;
407
- redirectTo?: string;
408
- requireAuth?: boolean;
409
- roles?: string[];
410
- permissions?: string[];
411
- }
412
- declare const AuthGuard: React.FC<AuthGuardProps>;
413
-
414
- declare const AuthRedirector: React.FC<{
415
- fallback?: React.ReactNode;
416
- }>;
417
-
418
407
  type AuthContextValue = {
419
408
  user: ReturnType<typeof parseUserFromToken> | null;
420
409
  token: string | null;
421
410
  isAuthenticated: boolean;
422
- isLoading: boolean;
423
411
  logout: () => void;
424
412
  };
425
413
  declare const AuthProvider: React.FC<{
@@ -494,8 +482,6 @@ declare const DefaultErrorFallback: React.FC<ErrorFallbackProps>;
494
482
 
495
483
  declare function useIsMobile(): boolean;
496
484
 
497
- declare function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((val: T) => T)) => void, () => void];
498
-
499
485
  declare function useDebounce<T>(value: T, delay: number): T;
500
486
 
501
487
  /**
@@ -507,4 +493,4 @@ declare function useDebounce<T>(value: T, delay: number): T;
507
493
  */
508
494
  declare function injectEarlyErrorHandler(): void;
509
495
 
510
- export { type AIWorkflowClientOptions, type AIWorkflowResponse, AUTH_ROOT, AUTH_TOKEN_KEY, type AccessContext, type Artifact, type ArtifactCreateInput, type ArtifactListQuery, AuthGuard, AuthProvider, AuthRedirector, AuthRedirector as AuthRedirectorDefault, type AxiosAIWorkflowOptions, DefaultErrorFallback, type EmailLoginRequest, type EmailLoginResponse, ErrorBoundary, FloatingButton, Loading, LoadingSpinner, LoginForm, type SendCodeRequest, type SendCodeResponse, type Visibility, aiRequest, aiWorkflow, canAccessArtifact, createAIWorkflowClient, createAIWorkflowClientAxios, createArtifactsClient, createClient, getAuthRoot, getCodeStatus, getDefaultProjectId, getToken, howone, injectEarlyErrorHandler, isTokenValid, loginWithEmailCode, onAuthStateChanged, parseUserFromToken, request, sendEmailVerificationCode, setAuthRoot, setDefaultProjectId, setToken, unifiedAuth, unifiedOAuth, useAuth, useAuthContext, useDebounce, useIsMobile, useLocalStorage, workflowRequest };
496
+ export { type AIWorkflowClientOptions, type AIWorkflowResponse, AUTH_ROOT, AUTH_TOKEN_KEY, type AccessContext, type Artifact, type ArtifactCreateInput, type ArtifactListQuery, AuthProvider, type AxiosAIWorkflowOptions, DefaultErrorFallback, type EmailLoginRequest, type EmailLoginResponse, ErrorBoundary, FloatingButton, Loading, LoadingSpinner, LoginForm, type SendCodeRequest, type SendCodeResponse, type Visibility, aiRequest, aiWorkflow, canAccessArtifact, createAIWorkflowClient, createAIWorkflowClientAxios, createArtifactsClient, createClient, getAuthRoot, getCodeStatus, getDefaultProjectId, getToken, howone, injectEarlyErrorHandler, isTokenValid, loginWithEmailCode, onAuthStateChanged, parseUserFromToken, request, sendEmailVerificationCode, setAuthRoot, setDefaultProjectId, setToken, unifiedAuth, unifiedOAuth, useAuth, useAuthContext, useDebounce, useIsMobile, workflowRequest };
package/dist/index.d.ts CHANGED
@@ -159,9 +159,6 @@ declare class UnifiedAuthService {
159
159
  valid: boolean;
160
160
  user?: any;
161
161
  }>;
162
- /**
163
- * 从本地存储获取认证数据
164
- */
165
162
  private getSavedAuthData;
166
163
  /**
167
164
  * 保存认证数据到本地存储
@@ -385,6 +382,12 @@ declare function createClient(opts?: {
385
382
  setVisibility(id: string, visibility: string): Promise<void>;
386
383
  delete(id: string): Promise<void>;
387
384
  };
385
+ me: () => Promise<{
386
+ id: string;
387
+ email: string;
388
+ name: string;
389
+ avatar: string;
390
+ } | null>;
388
391
  auth: {
389
392
  setToken: (t: string | null) => void;
390
393
  getToken: () => string | null;
@@ -401,25 +404,10 @@ interface LoginFormProps {
401
404
  }
402
405
  declare const LoginForm: React.FC<LoginFormProps>;
403
406
 
404
- interface AuthGuardProps {
405
- children: React.ReactNode;
406
- fallback?: React.ReactNode;
407
- redirectTo?: string;
408
- requireAuth?: boolean;
409
- roles?: string[];
410
- permissions?: string[];
411
- }
412
- declare const AuthGuard: React.FC<AuthGuardProps>;
413
-
414
- declare const AuthRedirector: React.FC<{
415
- fallback?: React.ReactNode;
416
- }>;
417
-
418
407
  type AuthContextValue = {
419
408
  user: ReturnType<typeof parseUserFromToken> | null;
420
409
  token: string | null;
421
410
  isAuthenticated: boolean;
422
- isLoading: boolean;
423
411
  logout: () => void;
424
412
  };
425
413
  declare const AuthProvider: React.FC<{
@@ -494,8 +482,6 @@ declare const DefaultErrorFallback: React.FC<ErrorFallbackProps>;
494
482
 
495
483
  declare function useIsMobile(): boolean;
496
484
 
497
- declare function useLocalStorage<T>(key: string, initialValue: T): readonly [T, (value: T | ((val: T) => T)) => void, () => void];
498
-
499
485
  declare function useDebounce<T>(value: T, delay: number): T;
500
486
 
501
487
  /**
@@ -507,4 +493,4 @@ declare function useDebounce<T>(value: T, delay: number): T;
507
493
  */
508
494
  declare function injectEarlyErrorHandler(): void;
509
495
 
510
- export { type AIWorkflowClientOptions, type AIWorkflowResponse, AUTH_ROOT, AUTH_TOKEN_KEY, type AccessContext, type Artifact, type ArtifactCreateInput, type ArtifactListQuery, AuthGuard, AuthProvider, AuthRedirector, AuthRedirector as AuthRedirectorDefault, type AxiosAIWorkflowOptions, DefaultErrorFallback, type EmailLoginRequest, type EmailLoginResponse, ErrorBoundary, FloatingButton, Loading, LoadingSpinner, LoginForm, type SendCodeRequest, type SendCodeResponse, type Visibility, aiRequest, aiWorkflow, canAccessArtifact, createAIWorkflowClient, createAIWorkflowClientAxios, createArtifactsClient, createClient, getAuthRoot, getCodeStatus, getDefaultProjectId, getToken, howone, injectEarlyErrorHandler, isTokenValid, loginWithEmailCode, onAuthStateChanged, parseUserFromToken, request, sendEmailVerificationCode, setAuthRoot, setDefaultProjectId, setToken, unifiedAuth, unifiedOAuth, useAuth, useAuthContext, useDebounce, useIsMobile, useLocalStorage, workflowRequest };
496
+ export { type AIWorkflowClientOptions, type AIWorkflowResponse, AUTH_ROOT, AUTH_TOKEN_KEY, type AccessContext, type Artifact, type ArtifactCreateInput, type ArtifactListQuery, AuthProvider, type AxiosAIWorkflowOptions, DefaultErrorFallback, type EmailLoginRequest, type EmailLoginResponse, ErrorBoundary, FloatingButton, Loading, LoadingSpinner, LoginForm, type SendCodeRequest, type SendCodeResponse, type Visibility, aiRequest, aiWorkflow, canAccessArtifact, createAIWorkflowClient, createAIWorkflowClientAxios, createArtifactsClient, createClient, getAuthRoot, getCodeStatus, getDefaultProjectId, getToken, howone, injectEarlyErrorHandler, isTokenValid, loginWithEmailCode, onAuthStateChanged, parseUserFromToken, request, sendEmailVerificationCode, setAuthRoot, setDefaultProjectId, setToken, unifiedAuth, unifiedOAuth, useAuth, useAuthContext, useDebounce, useIsMobile, workflowRequest };