@howone/sdk 0.3.22 → 0.3.23
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 +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +1020 -794
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +997 -776
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1033,6 +1033,7 @@ type HowoneContextValue = {
|
|
|
1033
1033
|
user: ReturnType<typeof parseUserFromToken> | null;
|
|
1034
1034
|
token: string | null;
|
|
1035
1035
|
isAuthenticated: boolean;
|
|
1036
|
+
isGuest: boolean;
|
|
1036
1037
|
logout: () => void;
|
|
1037
1038
|
};
|
|
1038
1039
|
interface HowOneProviderProps {
|
|
@@ -1141,7 +1142,16 @@ interface ClayxButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
1141
1142
|
}
|
|
1142
1143
|
declare const ClayxButton: React$1.FC<ClayxButtonProps>;
|
|
1143
1144
|
|
|
1144
|
-
|
|
1145
|
+
type ToastVariant = 'purple' | 'blue';
|
|
1146
|
+
declare function showPremiumActionToast(message: string, onAction: () => void, buttonText?: string, title?: string, variant?: ToastVariant): void;
|
|
1147
|
+
/**
|
|
1148
|
+
* @deprecated Use showPremiumActionToast instead
|
|
1149
|
+
*/
|
|
1150
|
+
declare function showLimitUpgradeToast(message: string, onUpgrade: () => void, buttonText?: string, title?: string): void;
|
|
1151
|
+
/**
|
|
1152
|
+
* Specifically for sign in required scenarios
|
|
1153
|
+
*/
|
|
1154
|
+
declare function showSignInRequiredToast(message: string, onSignIn: () => void, buttonText?: string, title?: string): void;
|
|
1145
1155
|
|
|
1146
1156
|
type Theme = "dark" | "light" | "system";
|
|
1147
1157
|
type ThemeProviderProps = {
|
|
@@ -1348,4 +1358,22 @@ declare const elementSelector: {
|
|
|
1348
1358
|
isActive: () => boolean;
|
|
1349
1359
|
};
|
|
1350
1360
|
|
|
1351
|
-
|
|
1361
|
+
/**
|
|
1362
|
+
* Guest Session 工具模块
|
|
1363
|
+
* 为未登录用户生成和管理 Session ID
|
|
1364
|
+
*/
|
|
1365
|
+
/**
|
|
1366
|
+
* 获取或生成游客 Session ID
|
|
1367
|
+
* 存储在 localStorage,同设备同浏览器可复用
|
|
1368
|
+
*/
|
|
1369
|
+
declare function getGuestSessionId(): string | null;
|
|
1370
|
+
/**
|
|
1371
|
+
* 清除游客 Session(用于"注销"或"清除数据")
|
|
1372
|
+
*/
|
|
1373
|
+
declare function clearGuestSession(): void;
|
|
1374
|
+
/**
|
|
1375
|
+
* 判断是否是游客模式(无 auth token 但有 session)
|
|
1376
|
+
*/
|
|
1377
|
+
declare function isGuestMode(): boolean;
|
|
1378
|
+
|
|
1379
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1033,6 +1033,7 @@ type HowoneContextValue = {
|
|
|
1033
1033
|
user: ReturnType<typeof parseUserFromToken> | null;
|
|
1034
1034
|
token: string | null;
|
|
1035
1035
|
isAuthenticated: boolean;
|
|
1036
|
+
isGuest: boolean;
|
|
1036
1037
|
logout: () => void;
|
|
1037
1038
|
};
|
|
1038
1039
|
interface HowOneProviderProps {
|
|
@@ -1141,7 +1142,16 @@ interface ClayxButtonProps extends React$1.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
1141
1142
|
}
|
|
1142
1143
|
declare const ClayxButton: React$1.FC<ClayxButtonProps>;
|
|
1143
1144
|
|
|
1144
|
-
|
|
1145
|
+
type ToastVariant = 'purple' | 'blue';
|
|
1146
|
+
declare function showPremiumActionToast(message: string, onAction: () => void, buttonText?: string, title?: string, variant?: ToastVariant): void;
|
|
1147
|
+
/**
|
|
1148
|
+
* @deprecated Use showPremiumActionToast instead
|
|
1149
|
+
*/
|
|
1150
|
+
declare function showLimitUpgradeToast(message: string, onUpgrade: () => void, buttonText?: string, title?: string): void;
|
|
1151
|
+
/**
|
|
1152
|
+
* Specifically for sign in required scenarios
|
|
1153
|
+
*/
|
|
1154
|
+
declare function showSignInRequiredToast(message: string, onSignIn: () => void, buttonText?: string, title?: string): void;
|
|
1145
1155
|
|
|
1146
1156
|
type Theme = "dark" | "light" | "system";
|
|
1147
1157
|
type ThemeProviderProps = {
|
|
@@ -1348,4 +1358,22 @@ declare const elementSelector: {
|
|
|
1348
1358
|
isActive: () => boolean;
|
|
1349
1359
|
};
|
|
1350
1360
|
|
|
1351
|
-
|
|
1361
|
+
/**
|
|
1362
|
+
* Guest Session 工具模块
|
|
1363
|
+
* 为未登录用户生成和管理 Session ID
|
|
1364
|
+
*/
|
|
1365
|
+
/**
|
|
1366
|
+
* 获取或生成游客 Session ID
|
|
1367
|
+
* 存储在 localStorage,同设备同浏览器可复用
|
|
1368
|
+
*/
|
|
1369
|
+
declare function getGuestSessionId(): string | null;
|
|
1370
|
+
/**
|
|
1371
|
+
* 清除游客 Session(用于"注销"或"清除数据")
|
|
1372
|
+
*/
|
|
1373
|
+
declare function clearGuestSession(): void;
|
|
1374
|
+
/**
|
|
1375
|
+
* 判断是否是游客模式(无 auth token 但有 session)
|
|
1376
|
+
*/
|
|
1377
|
+
declare function isGuestMode(): boolean;
|
|
1378
|
+
|
|
1379
|
+
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 };
|