@amaster.ai/client 1.1.1 → 1.1.2
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/package.json +11 -11
- package/types/__tests__/type-checks.test-d.ts +24 -8
- package/types/auth/code-auth.d.ts +21 -17
- package/types/auth/index.d.ts +53 -73
- package/types/auth/oauth.d.ts +83 -89
- package/types/auth/password-auth.d.ts +81 -51
- package/types/auth/permissions.d.ts +46 -0
- package/types/auth/profile.d.ts +17 -21
- package/types/auth/sessions.d.ts +83 -0
- package/types/auth/user.d.ts +65 -21
- package/types/bpm.d.ts +364 -1
- package/types/common.d.ts +23 -41
- package/types/entity.d.ts +7 -7
- package/types/function.d.ts +1 -1
- package/types/index.d.ts +53 -14
- package/types/s3.d.ts +3 -3
- package/types/workflow.d.ts +1 -1
package/types/index.d.ts
CHANGED
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
*
|
|
22
22
|
* // All subsequent requests automatically include auth token
|
|
23
23
|
* await client.entity.list('default', 'users');
|
|
24
|
-
* await client.bpm.startProcess('approval'
|
|
24
|
+
* await client.bpm.startProcess({ processKey: 'approval' });
|
|
25
25
|
* ```
|
|
26
26
|
*
|
|
27
27
|
* ## Module Documentation
|
|
28
28
|
* For detailed API documentation, see individual module type definitions:
|
|
29
|
-
* - **Authentication**: {@link ./auth/index.d.ts} (split into user, password-auth, code-auth, oauth, permissions, profile)
|
|
29
|
+
* - **Authentication**: {@link ./auth/index.d.ts} (split into user, password-auth, code-auth, oauth, permissions, profile, sessions)
|
|
30
30
|
* - **Entity Operations**: {@link ./entity.d.ts}
|
|
31
31
|
* - **BPM (Business Process)**: {@link ./bpm.d.ts}
|
|
32
32
|
* - **Workflow Execution**: {@link ./workflow.d.ts}
|
|
@@ -51,7 +51,7 @@ import type { WorkflowClientAPI } from "./workflow";
|
|
|
51
51
|
import type { ASRClientConfig, ASRClient, ASRHttpClientConfig, ASRHttpClient } from "./asr";
|
|
52
52
|
import type { CopilotClientAPI } from "./copilot";
|
|
53
53
|
import type { FunctionClientAPI } from "./function";
|
|
54
|
-
import type { TTSClientAPI } from "./tts";
|
|
54
|
+
import type { TTSClientAPI, TTSClientConfig } from "./tts";
|
|
55
55
|
import type { S3ClientAPI } from "./s3";
|
|
56
56
|
import type { HttpClient } from "./http";
|
|
57
57
|
|
|
@@ -123,6 +123,15 @@ export interface AmasterClientOptions {
|
|
|
123
123
|
* @default true
|
|
124
124
|
*/
|
|
125
125
|
autoHandleOAuthCallback?: boolean;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Automatically redirect to the current page's `?redirect=...` target after successful login
|
|
129
|
+
*
|
|
130
|
+
* Applies to password login, code login, Mini Program login, and OAuth callback handling.
|
|
131
|
+
*
|
|
132
|
+
* @default true
|
|
133
|
+
*/
|
|
134
|
+
autoRedirectAfterLogin?: boolean;
|
|
126
135
|
}
|
|
127
136
|
|
|
128
137
|
/**
|
|
@@ -229,7 +238,7 @@ export interface AmasterClient {
|
|
|
229
238
|
*
|
|
230
239
|
* For detailed documentation, see {@link ./tts.d.ts}
|
|
231
240
|
*/
|
|
232
|
-
tts: TTSClientAPI;
|
|
241
|
+
tts: (config: TTSClientConfig) => TTSClientAPI;
|
|
233
242
|
|
|
234
243
|
/**
|
|
235
244
|
* S3 Storage module
|
|
@@ -316,19 +325,49 @@ export interface AmasterClient {
|
|
|
316
325
|
export declare function createClient(options: AmasterClientOptions): AmasterClient;
|
|
317
326
|
|
|
318
327
|
// Re-export shared common types
|
|
319
|
-
export type { ClientResult } from "./common";
|
|
328
|
+
export type { ClientError, ClientResult } from "./common";
|
|
320
329
|
|
|
321
330
|
// Re-export main client interfaces
|
|
322
|
-
export type { AuthClientAPI } from "./auth";
|
|
323
|
-
export type {
|
|
324
|
-
|
|
325
|
-
|
|
331
|
+
export type { AuthClientAPI, AuthClientAPI as AuthClient } from "./auth";
|
|
332
|
+
export type {
|
|
333
|
+
AuthEvent,
|
|
334
|
+
EventHandler,
|
|
335
|
+
LoginParams,
|
|
336
|
+
LoginResponse,
|
|
337
|
+
RegisterParams,
|
|
338
|
+
RegisterResponse,
|
|
339
|
+
RefreshTokenResponse,
|
|
340
|
+
SuccessResponse,
|
|
341
|
+
CodeLoginParams,
|
|
342
|
+
CodeLoginType,
|
|
343
|
+
SendCodeParams,
|
|
344
|
+
SendCodeType,
|
|
345
|
+
CaptchaResponse,
|
|
346
|
+
OAuthProvider,
|
|
347
|
+
OAuthBinding,
|
|
348
|
+
MiniProgramLoginParams,
|
|
349
|
+
MiniProgramPhoneParams,
|
|
350
|
+
MiniProgramPhoneResponse,
|
|
351
|
+
UpdateMeParams,
|
|
352
|
+
UpdateProfileParams,
|
|
353
|
+
PermissionCheck,
|
|
354
|
+
Session,
|
|
355
|
+
RevokeAllSessionsResponse,
|
|
356
|
+
User,
|
|
357
|
+
Role,
|
|
358
|
+
Permission,
|
|
359
|
+
RoleDetail,
|
|
360
|
+
PermissionDetail,
|
|
361
|
+
} from "./auth";
|
|
362
|
+
export type { EntityClientAPI, EntityQueryParams, EntityListResponse, FilterOperator, FilterItem, FilterGroup } from "./entity";
|
|
363
|
+
export type { BpmClientAPI, ProcessInstance, Task, TaskQueryParams, ProcessVariable, HistoryTask, HistoryProcessInstance, HistoryActivityInstance, ActivityInstanceTree, UserOperationLog, CamundaVariable, TaskFormSchema } from "./bpm";
|
|
364
|
+
export type { WorkflowClientAPI, WorkflowRunRequest, WorkflowRunResponse, WorkflowInputValue, WorkflowFile } from "./workflow";
|
|
326
365
|
export type { ASRClient, ASRClientConfig, ASRHttpClient, ASRHttpClientConfig, Recorder, RecorderOptions } from "./asr";
|
|
327
|
-
export type { CopilotClientAPI } from "./copilot";
|
|
328
|
-
export type { FunctionClientAPI } from "./function";
|
|
329
|
-
export type { TTSClientAPI } from "./tts";
|
|
330
|
-
export type { S3ClientAPI } from "./s3";
|
|
331
|
-
export type { HttpClient } from "./http";
|
|
366
|
+
export type { CopilotClientAPI, CopilotClientAPI as CopilotClient, MessageContent, TextContent, ImageContent, FileContent, ConversationController, ConversationControllerOptions, ConversationControllerSnapshot, Conversation, MessagesItem, TextMessage, ErrorMessage, ThoughtMessage, ToolMessage, UIRenderMessage, Role as CopilotRole } from "./copilot";
|
|
367
|
+
export type { FunctionClientAPI, FunctionClientAPI as FunctionClient } from "./function";
|
|
368
|
+
export type { TTSClientAPI, TTSClientAPI as TTSClient, TTSClientConfig } from "./tts";
|
|
369
|
+
export type { S3ClientAPI, UploadRes, S3Metadata, S3ClientAPI as S3Client } from "./s3";
|
|
370
|
+
export type { HttpClient, RequestConfig } from "./http";
|
|
332
371
|
|
|
333
372
|
// For detailed types, import directly from submodules:
|
|
334
373
|
// import type { LoginParams, User } from '@amaster.ai/client/auth'
|
package/types/s3.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export interface S3ClientAPI {
|
|
|
47
47
|
*
|
|
48
48
|
* @example
|
|
49
49
|
* const result = await client.s3.download('documents/report.pdf');
|
|
50
|
-
* if (result.
|
|
50
|
+
* if (result.data) {
|
|
51
51
|
* const blob = result.data;
|
|
52
52
|
* const url = URL.createObjectURL(blob);
|
|
53
53
|
* window.open(url);
|
|
@@ -65,7 +65,7 @@ export interface S3ClientAPI {
|
|
|
65
65
|
*
|
|
66
66
|
* @example
|
|
67
67
|
* const result = await client.s3.getMetadata('images/photo.jpg');
|
|
68
|
-
* if (result.
|
|
68
|
+
* if (result.data) {
|
|
69
69
|
* console.log('Size:', result.data.contentLength);
|
|
70
70
|
* console.log('Type:', result.data.contentType);
|
|
71
71
|
* }
|
|
@@ -85,7 +85,7 @@ export interface S3ClientAPI {
|
|
|
85
85
|
* const file = fileInput.files[0];
|
|
86
86
|
*
|
|
87
87
|
* const result = await client.s3.upload(file);
|
|
88
|
-
* if (result.
|
|
88
|
+
* if (result.data) {
|
|
89
89
|
* console.log('File uploaded:', result.data.url);
|
|
90
90
|
* console.log('File key:', result.data.key);
|
|
91
91
|
* }
|