@howone/sdk 0.3.26 → 0.5.1

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
@@ -1007,12 +1007,6 @@ declare function createClient(opts: {
1007
1007
  email: string;
1008
1008
  name: string;
1009
1009
  avatar: string;
1010
- } | {
1011
- id: string;
1012
- email: string;
1013
- name: string;
1014
- avatar: string;
1015
- isGuest: boolean;
1016
1010
  } | null>;
1017
1011
  auth: {
1018
1012
  setToken: (t: string | null) => void;
@@ -1039,13 +1033,12 @@ type HowoneContextValue = {
1039
1033
  user: ReturnType<typeof parseUserFromToken> | null;
1040
1034
  token: string | null;
1041
1035
  isAuthenticated: boolean;
1042
- isGuest: boolean;
1043
1036
  logout: () => void;
1044
1037
  };
1045
1038
  interface HowOneProviderProps {
1046
1039
  children: React$1.ReactNode;
1047
1040
  autoRedirect?: boolean;
1048
- showFloatingButton?: boolean;
1041
+ showHowOneFlag?: boolean;
1049
1042
  projectId?: string;
1050
1043
  defaultTheme?: Theme$1;
1051
1044
  themeStorageKey?: string;
@@ -1066,7 +1059,7 @@ interface HowOneProviderProps {
1066
1059
  * <HowOneProvider
1067
1060
  * defaultTheme="dark"
1068
1061
  * themeStorageKey="my-app-theme"
1069
- * showFloatingButton={true}
1062
+ * showHowOneFlag={true}
1070
1063
  * redirectOnUnauthenticated={true}
1071
1064
  * >
1072
1065
  * <App />
@@ -1148,16 +1141,7 @@ interface ClayxButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElemen
1148
1141
  }
1149
1142
  declare const ClayxButton: React$1.FC<ClayxButtonProps>;
1150
1143
 
1151
- type ToastVariant = 'purple' | 'blue';
1152
- declare function showPremiumActionToast(message: string, onAction: () => void, buttonText?: string, title?: string, variant?: ToastVariant): void;
1153
- /**
1154
- * @deprecated Use showPremiumActionToast instead
1155
- */
1156
- declare function showLimitUpgradeToast(message: string, onUpgrade: () => void, buttonText?: string, title?: string): void;
1157
- /**
1158
- * Specifically for sign in required scenarios
1159
- */
1160
- declare function showSignInRequiredToast(message: string, onSignIn: () => void, buttonText?: string, title?: string): void;
1144
+ declare function showLimitUpgradeToast(message: string, onUpgrade: () => void): void;
1161
1145
 
1162
1146
  type Theme = "dark" | "light" | "system";
1163
1147
  type ThemeProviderProps = {
@@ -1364,22 +1348,4 @@ declare const elementSelector: {
1364
1348
  isActive: () => boolean;
1365
1349
  };
1366
1350
 
1367
- /**
1368
- * Guest Session 工具模块
1369
- * 为未登录用户生成和管理 Session ID
1370
- */
1371
- /**
1372
- * 获取或生成游客 Session ID
1373
- * 存储在 localStorage,同设备同浏览器可复用
1374
- */
1375
- declare function getGuestSessionId(): string | null;
1376
- /**
1377
- * 清除游客 Session(用于"注销"或"清除数据")
1378
- */
1379
- declare function clearGuestSession(): void;
1380
- /**
1381
- * 判断是否是游客模式(无 auth token 但有 session)
1382
- */
1383
- declare function isGuestMode(): boolean;
1384
-
1385
- export { type AIWorkflowClientOptions, type AIWorkflowResponse, AUTH_TOKEN_KEY, type AccessContext, type Artifact, type ArtifactCreateInput, type ArtifactListQuery, type AxiosAIWorkflowOptions, type BatchUploadOptions, type BatchUploadResponse, ClayxButton, ClayxToast, type CostUpdate, DefaultErrorFallback, type ElementSelectionData, ElementSelector, ElementSelectorProvider, type EmailLoginRequest, type EmailLoginResponse, type Environment, ErrorBoundary, type ExecutionResult, FloatingButton, type GenerateImageOptions, type GenerateImageResponse, GlobalToastContainer, HowOneProvider, type HowOneProviderProps, Loading, LoadingSpinner, LoginForm, type NodeExecution, type SSEClient, type SSEClientConfig, type SSEEventPayload, type SSEExecutionOptions, type SSERequest, type SSESession, type SSEStreamConfig, type SSEWorkflowOptions, type SSEWorkflowRequestInit, type SendCodeRequest, type SendCodeResponse, type SourceLocation, ThemeProvider, ThemeToggle, type UploadOptions, type UploadResponse, type UseElementSelectorReturn, type UseWorkflowStreamState, type Visibility, aiWorkflow, canAccessArtifact, clearGuestSession, createAIWorkflowClient, createAIWorkflowClientAxios, createArtifactsClient, createClient, createSSEClient, createSSERequest, createUploadClient, elementSelector, type envs, executeSSEWorkflow, getCodeStatus, getDefaultProjectId, getEnvironment, getEnvs, getGlobalEnvironment, getGuestSessionId, getToken, howone, iframeNavigation, initIframeNavigation, isGuestMode, isTokenValid, loginWithEmailCode, onAuthStateChanged, parseUserFromToken, sendElementSelectionToParent, sendEmailVerificationCode, setDefaultProjectId, setEnvironment, setToken, showLimitUpgradeToast, showPremiumActionToast, showSignInRequiredToast, unifiedAuth, unifiedOAuth, useAuth, useDebounce, useElementSelector, useHowoneContext, useIsMobile, useTheme, useWorkflowStream };
1351
+ export { type AIWorkflowClientOptions, type AIWorkflowResponse, AUTH_TOKEN_KEY, type AccessContext, type Artifact, type ArtifactCreateInput, type ArtifactListQuery, type AxiosAIWorkflowOptions, type BatchUploadOptions, type BatchUploadResponse, ClayxButton, ClayxToast, type CostUpdate, DefaultErrorFallback, type ElementSelectionData, ElementSelector, ElementSelectorProvider, type EmailLoginRequest, type EmailLoginResponse, type Environment, ErrorBoundary, type ExecutionResult, FloatingButton, type GenerateImageOptions, type GenerateImageResponse, GlobalToastContainer, HowOneProvider, type HowOneProviderProps, Loading, LoadingSpinner, LoginForm, type NodeExecution, type SSEClient, type SSEClientConfig, type SSEEventPayload, type SSEExecutionOptions, type SSERequest, type SSESession, type SSEStreamConfig, type SSEWorkflowOptions, type SSEWorkflowRequestInit, type SendCodeRequest, type SendCodeResponse, type SourceLocation, ThemeProvider, ThemeToggle, type UploadOptions, type UploadResponse, type UseElementSelectorReturn, type UseWorkflowStreamState, type Visibility, aiWorkflow, canAccessArtifact, createAIWorkflowClient, createAIWorkflowClientAxios, createArtifactsClient, createClient, createSSEClient, createSSERequest, createUploadClient, elementSelector, type envs, executeSSEWorkflow, getCodeStatus, getDefaultProjectId, getEnvironment, getEnvs, getGlobalEnvironment, getToken, howone, iframeNavigation, initIframeNavigation, isTokenValid, loginWithEmailCode, onAuthStateChanged, parseUserFromToken, sendElementSelectionToParent, sendEmailVerificationCode, setDefaultProjectId, setEnvironment, setToken, showLimitUpgradeToast, unifiedAuth, unifiedOAuth, useAuth, useDebounce, useElementSelector, useHowoneContext, useIsMobile, useTheme, useWorkflowStream };
package/dist/index.d.ts CHANGED
@@ -1007,12 +1007,6 @@ declare function createClient(opts: {
1007
1007
  email: string;
1008
1008
  name: string;
1009
1009
  avatar: string;
1010
- } | {
1011
- id: string;
1012
- email: string;
1013
- name: string;
1014
- avatar: string;
1015
- isGuest: boolean;
1016
1010
  } | null>;
1017
1011
  auth: {
1018
1012
  setToken: (t: string | null) => void;
@@ -1039,13 +1033,12 @@ type HowoneContextValue = {
1039
1033
  user: ReturnType<typeof parseUserFromToken> | null;
1040
1034
  token: string | null;
1041
1035
  isAuthenticated: boolean;
1042
- isGuest: boolean;
1043
1036
  logout: () => void;
1044
1037
  };
1045
1038
  interface HowOneProviderProps {
1046
1039
  children: React$1.ReactNode;
1047
1040
  autoRedirect?: boolean;
1048
- showFloatingButton?: boolean;
1041
+ showHowOneFlag?: boolean;
1049
1042
  projectId?: string;
1050
1043
  defaultTheme?: Theme$1;
1051
1044
  themeStorageKey?: string;
@@ -1066,7 +1059,7 @@ interface HowOneProviderProps {
1066
1059
  * <HowOneProvider
1067
1060
  * defaultTheme="dark"
1068
1061
  * themeStorageKey="my-app-theme"
1069
- * showFloatingButton={true}
1062
+ * showHowOneFlag={true}
1070
1063
  * redirectOnUnauthenticated={true}
1071
1064
  * >
1072
1065
  * <App />
@@ -1148,16 +1141,7 @@ interface ClayxButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElemen
1148
1141
  }
1149
1142
  declare const ClayxButton: React$1.FC<ClayxButtonProps>;
1150
1143
 
1151
- type ToastVariant = 'purple' | 'blue';
1152
- declare function showPremiumActionToast(message: string, onAction: () => void, buttonText?: string, title?: string, variant?: ToastVariant): void;
1153
- /**
1154
- * @deprecated Use showPremiumActionToast instead
1155
- */
1156
- declare function showLimitUpgradeToast(message: string, onUpgrade: () => void, buttonText?: string, title?: string): void;
1157
- /**
1158
- * Specifically for sign in required scenarios
1159
- */
1160
- declare function showSignInRequiredToast(message: string, onSignIn: () => void, buttonText?: string, title?: string): void;
1144
+ declare function showLimitUpgradeToast(message: string, onUpgrade: () => void): void;
1161
1145
 
1162
1146
  type Theme = "dark" | "light" | "system";
1163
1147
  type ThemeProviderProps = {
@@ -1364,22 +1348,4 @@ declare const elementSelector: {
1364
1348
  isActive: () => boolean;
1365
1349
  };
1366
1350
 
1367
- /**
1368
- * Guest Session 工具模块
1369
- * 为未登录用户生成和管理 Session ID
1370
- */
1371
- /**
1372
- * 获取或生成游客 Session ID
1373
- * 存储在 localStorage,同设备同浏览器可复用
1374
- */
1375
- declare function getGuestSessionId(): string | null;
1376
- /**
1377
- * 清除游客 Session(用于"注销"或"清除数据")
1378
- */
1379
- declare function clearGuestSession(): void;
1380
- /**
1381
- * 判断是否是游客模式(无 auth token 但有 session)
1382
- */
1383
- declare function isGuestMode(): boolean;
1384
-
1385
- export { type AIWorkflowClientOptions, type AIWorkflowResponse, AUTH_TOKEN_KEY, type AccessContext, type Artifact, type ArtifactCreateInput, type ArtifactListQuery, type AxiosAIWorkflowOptions, type BatchUploadOptions, type BatchUploadResponse, ClayxButton, ClayxToast, type CostUpdate, DefaultErrorFallback, type ElementSelectionData, ElementSelector, ElementSelectorProvider, type EmailLoginRequest, type EmailLoginResponse, type Environment, ErrorBoundary, type ExecutionResult, FloatingButton, type GenerateImageOptions, type GenerateImageResponse, GlobalToastContainer, HowOneProvider, type HowOneProviderProps, Loading, LoadingSpinner, LoginForm, type NodeExecution, type SSEClient, type SSEClientConfig, type SSEEventPayload, type SSEExecutionOptions, type SSERequest, type SSESession, type SSEStreamConfig, type SSEWorkflowOptions, type SSEWorkflowRequestInit, type SendCodeRequest, type SendCodeResponse, type SourceLocation, ThemeProvider, ThemeToggle, type UploadOptions, type UploadResponse, type UseElementSelectorReturn, type UseWorkflowStreamState, type Visibility, aiWorkflow, canAccessArtifact, clearGuestSession, createAIWorkflowClient, createAIWorkflowClientAxios, createArtifactsClient, createClient, createSSEClient, createSSERequest, createUploadClient, elementSelector, type envs, executeSSEWorkflow, getCodeStatus, getDefaultProjectId, getEnvironment, getEnvs, getGlobalEnvironment, getGuestSessionId, getToken, howone, iframeNavigation, initIframeNavigation, isGuestMode, isTokenValid, loginWithEmailCode, onAuthStateChanged, parseUserFromToken, sendElementSelectionToParent, sendEmailVerificationCode, setDefaultProjectId, setEnvironment, setToken, showLimitUpgradeToast, showPremiumActionToast, showSignInRequiredToast, unifiedAuth, unifiedOAuth, useAuth, useDebounce, useElementSelector, useHowoneContext, useIsMobile, useTheme, useWorkflowStream };
1351
+ export { type AIWorkflowClientOptions, type AIWorkflowResponse, AUTH_TOKEN_KEY, type AccessContext, type Artifact, type ArtifactCreateInput, type ArtifactListQuery, type AxiosAIWorkflowOptions, type BatchUploadOptions, type BatchUploadResponse, ClayxButton, ClayxToast, type CostUpdate, DefaultErrorFallback, type ElementSelectionData, ElementSelector, ElementSelectorProvider, type EmailLoginRequest, type EmailLoginResponse, type Environment, ErrorBoundary, type ExecutionResult, FloatingButton, type GenerateImageOptions, type GenerateImageResponse, GlobalToastContainer, HowOneProvider, type HowOneProviderProps, Loading, LoadingSpinner, LoginForm, type NodeExecution, type SSEClient, type SSEClientConfig, type SSEEventPayload, type SSEExecutionOptions, type SSERequest, type SSESession, type SSEStreamConfig, type SSEWorkflowOptions, type SSEWorkflowRequestInit, type SendCodeRequest, type SendCodeResponse, type SourceLocation, ThemeProvider, ThemeToggle, type UploadOptions, type UploadResponse, type UseElementSelectorReturn, type UseWorkflowStreamState, type Visibility, aiWorkflow, canAccessArtifact, createAIWorkflowClient, createAIWorkflowClientAxios, createArtifactsClient, createClient, createSSEClient, createSSERequest, createUploadClient, elementSelector, type envs, executeSSEWorkflow, getCodeStatus, getDefaultProjectId, getEnvironment, getEnvs, getGlobalEnvironment, getToken, howone, iframeNavigation, initIframeNavigation, isTokenValid, loginWithEmailCode, onAuthStateChanged, parseUserFromToken, sendElementSelectionToParent, sendEmailVerificationCode, setDefaultProjectId, setEnvironment, setToken, showLimitUpgradeToast, unifiedAuth, unifiedOAuth, useAuth, useDebounce, useElementSelector, useHowoneContext, useIsMobile, useTheme, useWorkflowStream };