@howone/sdk 0.3.19 → 0.3.21
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 +49 -84
- package/dist/index.d.ts +49 -84
- package/dist/index.js +1 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -11,73 +11,6 @@ interface FloatingButtonProps {
|
|
|
11
11
|
}
|
|
12
12
|
declare const FloatingButton: React$1.FC<FloatingButtonProps>;
|
|
13
13
|
|
|
14
|
-
interface RequestInterceptors<T = AxiosResponse> {
|
|
15
|
-
requestInterceptor?: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;
|
|
16
|
-
requestInterceptorCatch?: (error: any) => any;
|
|
17
|
-
responseInterceptor?: (res: T) => T;
|
|
18
|
-
responseInterceptorCatch?: (error: any) => any;
|
|
19
|
-
}
|
|
20
|
-
interface RequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
|
|
21
|
-
interceptors?: RequestInterceptors<T>;
|
|
22
|
-
showLoading?: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
declare class Request {
|
|
26
|
-
instance: AxiosInstance;
|
|
27
|
-
interceptors?: RequestInterceptors;
|
|
28
|
-
abortControllers: Map<string, AbortController>;
|
|
29
|
-
constructor(config: RequestConfig);
|
|
30
|
-
cancelRequest(url: string): void;
|
|
31
|
-
cancelAllRequests(): void;
|
|
32
|
-
request<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
33
|
-
get<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
34
|
-
post<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
35
|
-
delete<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
36
|
-
put<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
37
|
-
patch<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* AI 功能客户端
|
|
42
|
-
*
|
|
43
|
-
* 包含图片生成、修改等 AI 相关功能
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* 图片生成/修改选项
|
|
48
|
-
*/
|
|
49
|
-
interface GenerateImageOptions {
|
|
50
|
-
imageUrl: string;
|
|
51
|
-
description: string;
|
|
52
|
-
signal?: AbortSignal;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* 图片生成结果
|
|
56
|
-
*/
|
|
57
|
-
interface GenerateImageResponse {
|
|
58
|
-
imageUrl: string;
|
|
59
|
-
taskId?: string;
|
|
60
|
-
metadata?: Record<string, any>;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* 创建 AI 客户端
|
|
64
|
-
*/
|
|
65
|
-
declare function createAIClient(req: Request, projectId?: string): {
|
|
66
|
-
/**
|
|
67
|
-
* 生成/修改图片
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* ```typescript
|
|
71
|
-
* const result = await client.ai.generateImage({
|
|
72
|
-
* imageUrl: 'https://example.com/image.jpg',
|
|
73
|
-
* description: '把天空改成蓝色'
|
|
74
|
-
* })
|
|
75
|
-
* console.log('新图片:', result.imageUrl)
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
generateImage(options: GenerateImageOptions): Promise<GenerateImageResponse>;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
14
|
/**
|
|
82
15
|
* 文件上传类型定义
|
|
83
16
|
*
|
|
@@ -448,6 +381,32 @@ declare class AIWorkflowClient {
|
|
|
448
381
|
declare function createAIWorkflowClient(options?: AIWorkflowClientOptions): AIWorkflowClient;
|
|
449
382
|
declare const aiWorkflow: AIWorkflowClient;
|
|
450
383
|
|
|
384
|
+
interface RequestInterceptors<T = AxiosResponse> {
|
|
385
|
+
requestInterceptor?: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;
|
|
386
|
+
requestInterceptorCatch?: (error: any) => any;
|
|
387
|
+
responseInterceptor?: (res: T) => T;
|
|
388
|
+
responseInterceptorCatch?: (error: any) => any;
|
|
389
|
+
}
|
|
390
|
+
interface RequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
|
|
391
|
+
interceptors?: RequestInterceptors<T>;
|
|
392
|
+
showLoading?: boolean;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
declare class Request {
|
|
396
|
+
instance: AxiosInstance;
|
|
397
|
+
interceptors?: RequestInterceptors;
|
|
398
|
+
abortControllers: Map<string, AbortController>;
|
|
399
|
+
constructor(config: RequestConfig);
|
|
400
|
+
cancelRequest(url: string): void;
|
|
401
|
+
cancelAllRequests(): void;
|
|
402
|
+
request<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
403
|
+
get<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
404
|
+
post<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
405
|
+
delete<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
406
|
+
put<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
407
|
+
patch<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
408
|
+
}
|
|
409
|
+
|
|
451
410
|
interface AxiosAIWorkflowOptions {
|
|
452
411
|
baseUrl?: string;
|
|
453
412
|
basePath?: string;
|
|
@@ -566,6 +525,28 @@ declare function createUploadClient(req: Request, projectId?: string): {
|
|
|
566
525
|
batch(options: BatchUploadOptions): Promise<BatchUploadResponse>;
|
|
567
526
|
};
|
|
568
527
|
|
|
528
|
+
/**
|
|
529
|
+
* AI 功能客户端
|
|
530
|
+
*
|
|
531
|
+
* 包含图片生成、修改等 AI 相关功能
|
|
532
|
+
*/
|
|
533
|
+
/**
|
|
534
|
+
* 图片生成/修改选项
|
|
535
|
+
*/
|
|
536
|
+
interface GenerateImageOptions {
|
|
537
|
+
imageUrl: string;
|
|
538
|
+
description: string;
|
|
539
|
+
signal?: AbortSignal;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* 图片生成结果
|
|
543
|
+
*/
|
|
544
|
+
interface GenerateImageResponse {
|
|
545
|
+
imageUrl: string;
|
|
546
|
+
taskId?: string;
|
|
547
|
+
metadata?: Record<string, any>;
|
|
548
|
+
}
|
|
549
|
+
|
|
569
550
|
declare const AUTH_TOKEN_KEY = "auth_token";
|
|
570
551
|
declare function setToken(token: string | null): void;
|
|
571
552
|
declare function getToken(): string | null;
|
|
@@ -1021,22 +1002,6 @@ declare function createClient(opts: {
|
|
|
1021
1002
|
}>;
|
|
1022
1003
|
batch(options: BatchUploadOptions): Promise<BatchUploadResponse>;
|
|
1023
1004
|
};
|
|
1024
|
-
/**
|
|
1025
|
-
* AI 功能模块
|
|
1026
|
-
*
|
|
1027
|
-
* @example
|
|
1028
|
-
* ```typescript
|
|
1029
|
-
* // 图片生成/修改
|
|
1030
|
-
* const result = await client.ai.generateImage({
|
|
1031
|
-
* imageUrl: 'https://example.com/image.jpg',
|
|
1032
|
-
* description: '把天空改成蓝色'
|
|
1033
|
-
* })
|
|
1034
|
-
* console.log('新图片:', result.imageUrl)
|
|
1035
|
-
* ```
|
|
1036
|
-
*/
|
|
1037
|
-
ai: {
|
|
1038
|
-
generateImage(options: GenerateImageOptions): Promise<GenerateImageResponse>;
|
|
1039
|
-
};
|
|
1040
1005
|
me: () => Promise<{
|
|
1041
1006
|
id: {};
|
|
1042
1007
|
email: string;
|
|
@@ -1383,4 +1348,4 @@ declare const elementSelector: {
|
|
|
1383
1348
|
isActive: () => boolean;
|
|
1384
1349
|
};
|
|
1385
1350
|
|
|
1386
|
-
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,
|
|
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
|
@@ -11,73 +11,6 @@ interface FloatingButtonProps {
|
|
|
11
11
|
}
|
|
12
12
|
declare const FloatingButton: React$1.FC<FloatingButtonProps>;
|
|
13
13
|
|
|
14
|
-
interface RequestInterceptors<T = AxiosResponse> {
|
|
15
|
-
requestInterceptor?: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;
|
|
16
|
-
requestInterceptorCatch?: (error: any) => any;
|
|
17
|
-
responseInterceptor?: (res: T) => T;
|
|
18
|
-
responseInterceptorCatch?: (error: any) => any;
|
|
19
|
-
}
|
|
20
|
-
interface RequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
|
|
21
|
-
interceptors?: RequestInterceptors<T>;
|
|
22
|
-
showLoading?: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
declare class Request {
|
|
26
|
-
instance: AxiosInstance;
|
|
27
|
-
interceptors?: RequestInterceptors;
|
|
28
|
-
abortControllers: Map<string, AbortController>;
|
|
29
|
-
constructor(config: RequestConfig);
|
|
30
|
-
cancelRequest(url: string): void;
|
|
31
|
-
cancelAllRequests(): void;
|
|
32
|
-
request<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
33
|
-
get<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
34
|
-
post<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
35
|
-
delete<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
36
|
-
put<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
37
|
-
patch<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* AI 功能客户端
|
|
42
|
-
*
|
|
43
|
-
* 包含图片生成、修改等 AI 相关功能
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* 图片生成/修改选项
|
|
48
|
-
*/
|
|
49
|
-
interface GenerateImageOptions {
|
|
50
|
-
imageUrl: string;
|
|
51
|
-
description: string;
|
|
52
|
-
signal?: AbortSignal;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* 图片生成结果
|
|
56
|
-
*/
|
|
57
|
-
interface GenerateImageResponse {
|
|
58
|
-
imageUrl: string;
|
|
59
|
-
taskId?: string;
|
|
60
|
-
metadata?: Record<string, any>;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* 创建 AI 客户端
|
|
64
|
-
*/
|
|
65
|
-
declare function createAIClient(req: Request, projectId?: string): {
|
|
66
|
-
/**
|
|
67
|
-
* 生成/修改图片
|
|
68
|
-
*
|
|
69
|
-
* @example
|
|
70
|
-
* ```typescript
|
|
71
|
-
* const result = await client.ai.generateImage({
|
|
72
|
-
* imageUrl: 'https://example.com/image.jpg',
|
|
73
|
-
* description: '把天空改成蓝色'
|
|
74
|
-
* })
|
|
75
|
-
* console.log('新图片:', result.imageUrl)
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
generateImage(options: GenerateImageOptions): Promise<GenerateImageResponse>;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
14
|
/**
|
|
82
15
|
* 文件上传类型定义
|
|
83
16
|
*
|
|
@@ -448,6 +381,32 @@ declare class AIWorkflowClient {
|
|
|
448
381
|
declare function createAIWorkflowClient(options?: AIWorkflowClientOptions): AIWorkflowClient;
|
|
449
382
|
declare const aiWorkflow: AIWorkflowClient;
|
|
450
383
|
|
|
384
|
+
interface RequestInterceptors<T = AxiosResponse> {
|
|
385
|
+
requestInterceptor?: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;
|
|
386
|
+
requestInterceptorCatch?: (error: any) => any;
|
|
387
|
+
responseInterceptor?: (res: T) => T;
|
|
388
|
+
responseInterceptorCatch?: (error: any) => any;
|
|
389
|
+
}
|
|
390
|
+
interface RequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
|
|
391
|
+
interceptors?: RequestInterceptors<T>;
|
|
392
|
+
showLoading?: boolean;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
declare class Request {
|
|
396
|
+
instance: AxiosInstance;
|
|
397
|
+
interceptors?: RequestInterceptors;
|
|
398
|
+
abortControllers: Map<string, AbortController>;
|
|
399
|
+
constructor(config: RequestConfig);
|
|
400
|
+
cancelRequest(url: string): void;
|
|
401
|
+
cancelAllRequests(): void;
|
|
402
|
+
request<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
403
|
+
get<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
404
|
+
post<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
405
|
+
delete<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
406
|
+
put<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
407
|
+
patch<T = any>(config: RequestConfig<T>): Promise<T>;
|
|
408
|
+
}
|
|
409
|
+
|
|
451
410
|
interface AxiosAIWorkflowOptions {
|
|
452
411
|
baseUrl?: string;
|
|
453
412
|
basePath?: string;
|
|
@@ -566,6 +525,28 @@ declare function createUploadClient(req: Request, projectId?: string): {
|
|
|
566
525
|
batch(options: BatchUploadOptions): Promise<BatchUploadResponse>;
|
|
567
526
|
};
|
|
568
527
|
|
|
528
|
+
/**
|
|
529
|
+
* AI 功能客户端
|
|
530
|
+
*
|
|
531
|
+
* 包含图片生成、修改等 AI 相关功能
|
|
532
|
+
*/
|
|
533
|
+
/**
|
|
534
|
+
* 图片生成/修改选项
|
|
535
|
+
*/
|
|
536
|
+
interface GenerateImageOptions {
|
|
537
|
+
imageUrl: string;
|
|
538
|
+
description: string;
|
|
539
|
+
signal?: AbortSignal;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* 图片生成结果
|
|
543
|
+
*/
|
|
544
|
+
interface GenerateImageResponse {
|
|
545
|
+
imageUrl: string;
|
|
546
|
+
taskId?: string;
|
|
547
|
+
metadata?: Record<string, any>;
|
|
548
|
+
}
|
|
549
|
+
|
|
569
550
|
declare const AUTH_TOKEN_KEY = "auth_token";
|
|
570
551
|
declare function setToken(token: string | null): void;
|
|
571
552
|
declare function getToken(): string | null;
|
|
@@ -1021,22 +1002,6 @@ declare function createClient(opts: {
|
|
|
1021
1002
|
}>;
|
|
1022
1003
|
batch(options: BatchUploadOptions): Promise<BatchUploadResponse>;
|
|
1023
1004
|
};
|
|
1024
|
-
/**
|
|
1025
|
-
* AI 功能模块
|
|
1026
|
-
*
|
|
1027
|
-
* @example
|
|
1028
|
-
* ```typescript
|
|
1029
|
-
* // 图片生成/修改
|
|
1030
|
-
* const result = await client.ai.generateImage({
|
|
1031
|
-
* imageUrl: 'https://example.com/image.jpg',
|
|
1032
|
-
* description: '把天空改成蓝色'
|
|
1033
|
-
* })
|
|
1034
|
-
* console.log('新图片:', result.imageUrl)
|
|
1035
|
-
* ```
|
|
1036
|
-
*/
|
|
1037
|
-
ai: {
|
|
1038
|
-
generateImage(options: GenerateImageOptions): Promise<GenerateImageResponse>;
|
|
1039
|
-
};
|
|
1040
1005
|
me: () => Promise<{
|
|
1041
1006
|
id: {};
|
|
1042
1007
|
email: string;
|
|
@@ -1383,4 +1348,4 @@ declare const elementSelector: {
|
|
|
1383
1348
|
isActive: () => boolean;
|
|
1384
1349
|
};
|
|
1385
1350
|
|
|
1386
|
-
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,
|
|
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.js
CHANGED
|
@@ -91,7 +91,7 @@ var init_config = __esm({
|
|
|
91
91
|
prodEnv = {
|
|
92
92
|
AUTH_ROOT_VALUE: "https://howone.ai",
|
|
93
93
|
baseUrl: "https://api.howone.ai/api",
|
|
94
|
-
aiBaseUrl: "https://
|
|
94
|
+
aiBaseUrl: "https://eax.services"
|
|
95
95
|
};
|
|
96
96
|
envs = {
|
|
97
97
|
local: localEnv,
|
|
@@ -289,7 +289,6 @@ __export(index_exports, {
|
|
|
289
289
|
ThemeToggle: () => ThemeToggle,
|
|
290
290
|
aiWorkflow: () => aiWorkflow,
|
|
291
291
|
canAccessArtifact: () => canAccessArtifact,
|
|
292
|
-
createAIClient: () => createAIClient,
|
|
293
292
|
createAIWorkflowClient: () => createAIWorkflowClient,
|
|
294
293
|
createAIWorkflowClientAxios: () => createAIWorkflowClientAxios,
|
|
295
294
|
createArtifactsClient: () => createArtifactsClient,
|
|
@@ -2635,39 +2634,6 @@ function createUploadClient(req, projectId) {
|
|
|
2635
2634
|
};
|
|
2636
2635
|
}
|
|
2637
2636
|
|
|
2638
|
-
// src/services/ai-client.ts
|
|
2639
|
-
function createAIClient(req, projectId) {
|
|
2640
|
-
const generateImageUrl = projectId ? `/entities/apps/${projectId}/generate-image` : "/generate-image";
|
|
2641
|
-
return {
|
|
2642
|
-
/**
|
|
2643
|
-
* 生成/修改图片
|
|
2644
|
-
*
|
|
2645
|
-
* @example
|
|
2646
|
-
* ```typescript
|
|
2647
|
-
* const result = await client.ai.generateImage({
|
|
2648
|
-
* imageUrl: 'https://example.com/image.jpg',
|
|
2649
|
-
* description: '把天空改成蓝色'
|
|
2650
|
-
* })
|
|
2651
|
-
* console.log('新图片:', result.imageUrl)
|
|
2652
|
-
* ```
|
|
2653
|
-
*/
|
|
2654
|
-
async generateImage(options) {
|
|
2655
|
-
const { imageUrl, description, signal } = options;
|
|
2656
|
-
const response = await req.post({
|
|
2657
|
-
url: generateImageUrl,
|
|
2658
|
-
data: {
|
|
2659
|
-
imageUrl,
|
|
2660
|
-
description
|
|
2661
|
-
},
|
|
2662
|
-
signal
|
|
2663
|
-
});
|
|
2664
|
-
return {
|
|
2665
|
-
imageUrl: response.data.result.imageUrl
|
|
2666
|
-
};
|
|
2667
|
-
}
|
|
2668
|
-
};
|
|
2669
|
-
}
|
|
2670
|
-
|
|
2671
2637
|
// src/services/sse-executor.ts
|
|
2672
2638
|
init_config();
|
|
2673
2639
|
async function executeSSEWorkflow(request, options = {}) {
|
|
@@ -3771,20 +3737,6 @@ function createClient(opts) {
|
|
|
3771
3737
|
* ```
|
|
3772
3738
|
*/
|
|
3773
3739
|
upload: createUploadClient(bizWrapped, opts?.projectId),
|
|
3774
|
-
/**
|
|
3775
|
-
* AI 功能模块
|
|
3776
|
-
*
|
|
3777
|
-
* @example
|
|
3778
|
-
* ```typescript
|
|
3779
|
-
* // 图片生成/修改
|
|
3780
|
-
* const result = await client.ai.generateImage({
|
|
3781
|
-
* imageUrl: 'https://example.com/image.jpg',
|
|
3782
|
-
* description: '把天空改成蓝色'
|
|
3783
|
-
* })
|
|
3784
|
-
* console.log('新图片:', result.imageUrl)
|
|
3785
|
-
* ```
|
|
3786
|
-
*/
|
|
3787
|
-
ai: createAIClient(bizWrapped, opts?.projectId),
|
|
3788
3740
|
me: async () => {
|
|
3789
3741
|
try {
|
|
3790
3742
|
let availableToken = getCachedOrGlobalToken();
|
|
@@ -4289,7 +4241,6 @@ var elementSelector = {
|
|
|
4289
4241
|
ThemeToggle,
|
|
4290
4242
|
aiWorkflow,
|
|
4291
4243
|
canAccessArtifact,
|
|
4292
|
-
createAIClient,
|
|
4293
4244
|
createAIWorkflowClient,
|
|
4294
4245
|
createAIWorkflowClientAxios,
|
|
4295
4246
|
createArtifactsClient,
|