@amaster.ai/client 1.1.61 → 1.1.62

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.cts CHANGED
@@ -289,10 +289,12 @@ interface AmasterClientOptions {
289
289
  * Automatically handle OAuth callback on initialization (default: true)
290
290
  *
291
291
  * When enabled, the client will automatically detect and process OAuth
292
- * callback URLs containing #access_token. After processing, the hash
293
- * is automatically cleared from the URL for security.
292
+ * callback URLs containing an access-token hash, `login_ticket`, or
293
+ * `oauth_error`. Processed callback parameters are removed from the URL.
294
294
  *
295
- * Set to false if you want to manually handle OAuth callbacks.
295
+ * Set to false if you want to manually handle OAuth callbacks. Do not use
296
+ * automatic and manual ownership together; repeated calls on one client
297
+ * instance reuse the same result as a safety net.
296
298
  *
297
299
  * @default true
298
300
  */
package/dist/index.d.ts CHANGED
@@ -289,10 +289,12 @@ interface AmasterClientOptions {
289
289
  * Automatically handle OAuth callback on initialization (default: true)
290
290
  *
291
291
  * When enabled, the client will automatically detect and process OAuth
292
- * callback URLs containing #access_token. After processing, the hash
293
- * is automatically cleared from the URL for security.
292
+ * callback URLs containing an access-token hash, `login_ticket`, or
293
+ * `oauth_error`. Processed callback parameters are removed from the URL.
294
294
  *
295
- * Set to false if you want to manually handle OAuth callbacks.
295
+ * Set to false if you want to manually handle OAuth callbacks. Do not use
296
+ * automatic and manual ownership together; repeated calls on one client
297
+ * instance reuse the same result as a safety net.
296
298
  *
297
299
  * @default true
298
300
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/client",
3
- "version": "1.1.61",
3
+ "version": "1.1.62",
4
4
  "description": "Unified API client for Amaster platform - All services in one package",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -72,16 +72,16 @@
72
72
  "registry": "https://registry.npmjs.org/"
73
73
  },
74
74
  "dependencies": {
75
- "@amaster.ai/asr-client": "1.1.61",
76
- "@amaster.ai/bpm-client": "1.1.61",
77
- "@amaster.ai/copilot-client": "1.1.61",
78
- "@amaster.ai/entity-client": "1.1.61",
79
- "@amaster.ai/function-client": "1.1.61",
80
- "@amaster.ai/http-client": "1.1.61",
81
- "@amaster.ai/s3-client": "1.1.61",
82
- "@amaster.ai/workflow-client": "1.1.61",
83
- "@amaster.ai/tts-client": "1.1.61",
84
- "@amaster.ai/auth-client": "1.1.61"
75
+ "@amaster.ai/asr-client": "1.1.62",
76
+ "@amaster.ai/auth-client": "1.1.62",
77
+ "@amaster.ai/copilot-client": "1.1.62",
78
+ "@amaster.ai/entity-client": "1.1.62",
79
+ "@amaster.ai/function-client": "1.1.62",
80
+ "@amaster.ai/bpm-client": "1.1.62",
81
+ "@amaster.ai/http-client": "1.1.62",
82
+ "@amaster.ai/s3-client": "1.1.62",
83
+ "@amaster.ai/tts-client": "1.1.62",
84
+ "@amaster.ai/workflow-client": "1.1.62"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "axios": "^1.11.0"
@@ -95,6 +95,9 @@ describe('Type Tests', () => {
95
95
  expectTypeOf<AmasterClient['auth']>().toHaveProperty('miniLogin');
96
96
  expectTypeOf<AmasterClient['auth']>().toHaveProperty('getMiniProgramPhoneNumber');
97
97
  expectTypeOf<AmasterClient['auth']>().toHaveProperty('loginWithMiniProgram');
98
+ expectTypeOf<AmasterClient['auth']>().toHaveProperty('loginWithFeishu');
99
+ expectTypeOf<AmasterClient['auth']>().toHaveProperty('loginWithFeishuCode');
100
+ expectTypeOf<AmasterClient['auth']>().toHaveProperty('exchangeOAuthLoginTicket');
98
101
  expectTypeOf<AmasterClient['auth']>().toHaveProperty('handleOAuthCallback');
99
102
  expectTypeOf<AmasterClient['auth']>().toHaveProperty('updateMe');
100
103
  expectTypeOf<AmasterClient['auth']>().toHaveProperty('getSession');
@@ -22,7 +22,19 @@ export type OAuthProvider =
22
22
  | 'wechat'
23
23
  /** @deprecated Legacy mini-program provider marker kept for compatibility */
24
24
  | 'wechat_mini'
25
- | 'platform';
25
+ | 'platform'
26
+ | 'feishu';
27
+
28
+ export interface FeishuPublicConfig {
29
+ enabled: boolean;
30
+ appId: string;
31
+ usePkce: boolean;
32
+ }
33
+
34
+ export interface OAuthLoginTicketResponse {
35
+ accessToken: string;
36
+ returnUrl: string;
37
+ }
26
38
 
27
39
  /**
28
40
  * OAuth binding information for the current user
@@ -126,6 +138,21 @@ export interface OAuthAPI {
126
138
  */
127
139
  loginWithOAuth(provider: OAuthProvider, redirectUrl?: string): void;
128
140
 
141
+ /**
142
+ * Use requestAccess inside Feishu, or redirect to browser OAuth outside Feishu.
143
+ * Browser mode returns null after starting navigation.
144
+ */
145
+ loginWithFeishu(returnUrl?: string): Promise<ClientResult<LoginResponse> | null>;
146
+
147
+ /** Submit an existing requestAccess/requestAuthCode authorization code. */
148
+ loginWithFeishuCode(
149
+ code: string,
150
+ returnUrl?: string
151
+ ): Promise<ClientResult<LoginResponse>>;
152
+
153
+ /** Exchange a short-lived, one-time application OAuth login ticket. */
154
+ exchangeOAuthLoginTicket(ticket: string): Promise<ClientResult<LoginResponse>>;
155
+
129
156
  /**
130
157
  * Handle OAuth callback on the current browser page
131
158
  *
package/types/index.d.ts CHANGED
@@ -118,9 +118,9 @@ export interface AmasterClientOptions {
118
118
  /**
119
119
  * Auto-handle OAuth callback on page load (default: true)
120
120
  *
121
- * Automatically detects and processes `#access_token` in URL hash,
122
- * then clears the hash for security. Set to `false` to manually
123
- * call `client.auth.handleOAuthCallback()`.
121
+ * Automatically detects and processes an access-token hash, `login_ticket`,
122
+ * or `oauth_error`, then clears processed callback parameters for security.
123
+ * Set to `false` to manually call `client.auth.handleOAuthCallback()`.
124
124
  *
125
125
  * @default true
126
126
  */