@amaster.ai/client 1.1.2 → 1.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/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({ processKey: 'approval' });
24
+ * await client.bpm.startProcess('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, sessions)
29
+ * - **Authentication**: {@link ./auth/index.d.ts} (split into user, password-auth, code-auth, oauth, permissions, profile)
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, TTSClientConfig } from "./tts";
54
+ import type { TTSClientAPI } from "./tts";
55
55
  import type { S3ClientAPI } from "./s3";
56
56
  import type { HttpClient } from "./http";
57
57
 
@@ -123,15 +123,6 @@ 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;
135
126
  }
136
127
 
137
128
  /**
@@ -238,7 +229,7 @@ export interface AmasterClient {
238
229
  *
239
230
  * For detailed documentation, see {@link ./tts.d.ts}
240
231
  */
241
- tts: (config: TTSClientConfig) => TTSClientAPI;
232
+ tts: TTSClientAPI;
242
233
 
243
234
  /**
244
235
  * S3 Storage module
@@ -325,49 +316,19 @@ export interface AmasterClient {
325
316
  export declare function createClient(options: AmasterClientOptions): AmasterClient;
326
317
 
327
318
  // Re-export shared common types
328
- export type { ClientError, ClientResult } from "./common";
319
+ export type { ClientResult } from "./common";
329
320
 
330
321
  // Re-export main client interfaces
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";
322
+ export type { AuthClientAPI } from "./auth";
323
+ export type { EntityClientAPI } from "./entity";
324
+ export type { BpmClientAPI } from "./bpm";
325
+ export type { WorkflowClientAPI } from "./workflow";
365
326
  export type { ASRClient, ASRClientConfig, ASRHttpClient, ASRHttpClientConfig, Recorder, RecorderOptions } from "./asr";
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";
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";
371
332
 
372
333
  // For detailed types, import directly from submodules:
373
334
  // 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.data) {
50
+ * if (result.success) {
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.data) {
68
+ * if (result.success) {
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.data) {
88
+ * if (result.success) {
89
89
  * console.log('File uploaded:', result.data.url);
90
90
  * console.log('File key:', result.data.key);
91
91
  * }
@@ -122,7 +122,7 @@ export interface WorkflowClientAPI {
122
122
  * limit: 100
123
123
  * });
124
124
  *
125
- * if (result.data) {
125
+ * if (result.success) {
126
126
  * console.log('Output:', result.data.outputs);
127
127
  * }
128
128
  *
@@ -1,46 +0,0 @@
1
- /**
2
- * * Local permission checks including:
3
- * - Role checks
4
- * - Single permission checks
5
- * - Any/all permission checks
6
- *
7
- * @module auth/permissions
8
- */
9
-
10
- /**
11
- * Permission check input
12
- */
13
- export interface PermissionCheck {
14
- /** Resource name, such as `user` or `order` */
15
- resource: string;
16
-
17
- /** Action name, such as `read` or `write` */
18
- action: string;
19
- }
20
-
21
- /**
22
- * Local permission helper API
23
- *
24
- * These methods are synchronous checks against the current cached user state.
25
- */
26
- export interface PermissionsAPI {
27
- /**
28
- * Check whether the current user has the specified role
29
- */
30
- hasRole(roleCode: string): boolean;
31
-
32
- /**
33
- * Check whether the current user has the specified permission
34
- */
35
- hasPermission(resource: string, action: string): boolean;
36
-
37
- /**
38
- * Check whether the current user has at least one of the specified permissions
39
- */
40
- hasAnyPermission(permissions: PermissionCheck[]): boolean;
41
-
42
- /**
43
- * Check whether the current user has all of the specified permissions
44
- */
45
- hasAllPermissions(permissions: PermissionCheck[]): boolean;
46
- }
@@ -1,83 +0,0 @@
1
- /**
2
- * * Session management including:
3
- * - Current session lookup
4
- * - Multi-device session listing
5
- * - Revoking one session
6
- * - Revoking all other sessions
7
- *
8
- * @module auth/sessions
9
- */
10
-
11
- import type { ClientResult } from '../common';
12
- import type { SuccessResponse } from './password-auth';
13
-
14
- /**
15
- * Session information for multi-device management
16
- */
17
- export interface Session {
18
- /** Session ID */
19
- id: number;
20
-
21
- /** Session name, such as browser and OS */
22
- sessionName?: string;
23
-
24
- /** IP address */
25
- ipAddress?: string;
26
-
27
- /** Approximate login location */
28
- location?: string;
29
-
30
- /** User agent string */
31
- userAgent?: string;
32
-
33
- /** Last-used timestamp */
34
- lastUsedAt?: string;
35
-
36
- /** Session creation timestamp */
37
- createdAt: string;
38
-
39
- /** Whether this is the current session */
40
- isCurrent: boolean;
41
- }
42
-
43
- /**
44
- * Revoke-all-sessions response
45
- */
46
- export interface RevokeAllSessionsResponse {
47
- /** Backend status code */
48
- statusCode: number;
49
-
50
- /** Optional message */
51
- message?: string;
52
-
53
- /** Backend timestamp */
54
- timestamp?: string;
55
-
56
- /** Number of revoked sessions */
57
- revokedCount: number;
58
- }
59
-
60
- /**
61
- * Session management API
62
- */
63
- export interface SessionsAPI {
64
- /**
65
- * Get the current active session
66
- */
67
- getSession(): Promise<ClientResult<Session>>;
68
-
69
- /**
70
- * Get all active sessions for the current user
71
- */
72
- getSessions(): Promise<ClientResult<Session[]>>;
73
-
74
- /**
75
- * Revoke a specific session by ID
76
- */
77
- revokeSession(sessionId: string): Promise<ClientResult<SuccessResponse>>;
78
-
79
- /**
80
- * Revoke all sessions except the current one
81
- */
82
- revokeAllSessions(): Promise<ClientResult<RevokeAllSessionsResponse>>;
83
- }