@satorijs/adapter-lark 3.10.6 → 3.11.1

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.
Files changed (119) hide show
  1. package/lib/content.d.ts +211 -93
  2. package/lib/index.cjs +2954 -2474
  3. package/lib/internal.d.ts +4 -4
  4. package/lib/message.d.ts +2 -3
  5. package/lib/types/acs.d.ts +212 -172
  6. package/lib/types/admin.d.ts +331 -291
  7. package/lib/types/aily.d.ts +331 -216
  8. package/lib/types/apaas.d.ts +646 -494
  9. package/lib/types/application.d.ts +559 -458
  10. package/lib/types/approval.d.ts +826 -791
  11. package/lib/types/attendance.d.ts +1094 -994
  12. package/lib/types/auth.d.ts +66 -61
  13. package/lib/types/authen.d.ts +221 -186
  14. package/lib/types/baike.d.ts +258 -233
  15. package/lib/types/base.d.ts +74 -0
  16. package/lib/types/bitable.d.ts +830 -770
  17. package/lib/types/board.d.ts +29 -14
  18. package/lib/types/calendar.d.ts +660 -605
  19. package/lib/types/cardkit.d.ts +149 -134
  20. package/lib/types/compensation.d.ts +84 -49
  21. package/lib/types/contact.d.ts +1279 -1204
  22. package/lib/types/corehr.d.ts +4982 -4526
  23. package/lib/types/directory.d.ts +447 -0
  24. package/lib/types/docs.d.ts +28 -18
  25. package/lib/types/document_ai.d.ts +347 -252
  26. package/lib/types/docx.d.ts +428 -383
  27. package/lib/types/drive.d.ts +1093 -1048
  28. package/lib/types/ehr.d.ts +66 -51
  29. package/lib/types/event.d.ts +16 -6
  30. package/lib/types/helpdesk.d.ts +816 -741
  31. package/lib/types/hire.d.ts +3955 -3589
  32. package/lib/types/human_authentication.d.ts +32 -22
  33. package/lib/types/im.d.ts +1420 -1295
  34. package/lib/types/index.d.ts +1422 -330
  35. package/lib/types/lingo.d.ts +279 -249
  36. package/lib/types/mail.d.ts +1032 -675
  37. package/lib/types/mdm.d.ts +105 -37
  38. package/lib/types/minutes.d.ts +73 -26
  39. package/lib/types/moments.d.ts +23 -13
  40. package/lib/types/okr.d.ts +266 -225
  41. package/lib/types/optical_char_recognition.d.ts +22 -12
  42. package/lib/types/passport.d.ts +58 -48
  43. package/lib/types/payroll.d.ts +210 -53
  44. package/lib/types/performance.d.ts +463 -414
  45. package/lib/types/personal_settings.d.ts +93 -82
  46. package/lib/types/report.d.ts +79 -58
  47. package/lib/types/search.d.ts +265 -235
  48. package/lib/types/security_and_compliance.d.ts +30 -19
  49. package/lib/types/sheets.d.ts +356 -321
  50. package/lib/types/speech_to_text.d.ts +44 -34
  51. package/lib/types/task.d.ts +998 -1087
  52. package/lib/types/tenant.d.ts +25 -15
  53. package/lib/types/translation.d.ts +42 -32
  54. package/lib/types/trust_party.d.ts +81 -0
  55. package/lib/types/vc.d.ts +1218 -1123
  56. package/lib/types/verification.d.ts +11 -6
  57. package/lib/types/wiki.d.ts +270 -235
  58. package/lib/types/workplace.d.ts +58 -38
  59. package/lib/utils.d.ts +2 -2
  60. package/package.json +4 -4
  61. package/src/bot.ts +15 -15
  62. package/src/content.ts +230 -107
  63. package/src/internal.ts +29 -12
  64. package/src/message.ts +82 -111
  65. package/src/types/acs.ts +234 -186
  66. package/src/types/admin.ts +353 -305
  67. package/src/types/aily.ts +375 -233
  68. package/src/types/apaas.ts +754 -568
  69. package/src/types/application.ts +633 -507
  70. package/src/types/approval.ts +914 -872
  71. package/src/types/attendance.ts +1226 -1104
  72. package/src/types/auth.ts +72 -66
  73. package/src/types/authen.ts +233 -191
  74. package/src/types/baike.ts +276 -246
  75. package/src/types/base.ts +93 -0
  76. package/src/types/bitable.ts +966 -894
  77. package/src/types/board.ts +34 -16
  78. package/src/types/calendar.ts +751 -685
  79. package/src/types/cardkit.ts +164 -146
  80. package/src/types/compensation.ts +97 -55
  81. package/src/types/contact.ts +1465 -1375
  82. package/src/types/corehr.ts +5664 -5077
  83. package/src/types/directory.ts +569 -0
  84. package/src/types/docs.ts +31 -19
  85. package/src/types/document_ai.ts +401 -287
  86. package/src/types/docx.ts +492 -438
  87. package/src/types/drive.ts +1266 -1213
  88. package/src/types/ehr.ts +71 -53
  89. package/src/types/event.ts +19 -7
  90. package/src/types/helpdesk.ts +930 -840
  91. package/src/types/hire.ts +4453 -4019
  92. package/src/types/human_authentication.ts +35 -23
  93. package/src/types/im.ts +1626 -1476
  94. package/src/types/index.ts +1532 -346
  95. package/src/types/lingo.ts +299 -263
  96. package/src/types/mail.ts +1231 -779
  97. package/src/types/mdm.ts +122 -39
  98. package/src/types/minutes.ts +88 -28
  99. package/src/types/moments.ts +26 -14
  100. package/src/types/okr.ts +286 -238
  101. package/src/types/optical_char_recognition.ts +25 -13
  102. package/src/types/passport.ts +62 -50
  103. package/src/types/payroll.ts +254 -57
  104. package/src/types/performance.ts +528 -467
  105. package/src/types/personal_settings.ts +101 -89
  106. package/src/types/report.ts +86 -62
  107. package/src/types/search.ts +285 -249
  108. package/src/types/security_and_compliance.ts +33 -21
  109. package/src/types/sheets.ts +421 -379
  110. package/src/types/speech_to_text.ts +48 -36
  111. package/src/types/task.ts +1152 -1260
  112. package/src/types/tenant.ts +29 -17
  113. package/src/types/translation.ts +46 -34
  114. package/src/types/trust_party.ts +110 -0
  115. package/src/types/vc.ts +1397 -1283
  116. package/src/types/verification.ts +13 -7
  117. package/src/types/wiki.ts +293 -251
  118. package/src/types/workplace.ts +65 -41
  119. package/src/utils.ts +3 -3
@@ -1,86 +1,91 @@
1
1
  import { BaseResponse } from '../internal';
2
2
  declare module '../internal' {
3
3
  interface Internal {
4
+ auth: Auth.Methods;
5
+ }
6
+ }
7
+ export declare namespace Auth {
8
+ interface Methods {
4
9
  /**
5
10
  * 自建应用获取 tenant_access_token
6
11
  * @see https://open.feishu.cn/document/ukTMukTMukTM/ukDNz4SO0MjL5QzM/auth-v3/auth/tenant_access_token_internal
7
12
  */
8
- tenantAccessTokenInternalAuth(body: TenantAccessTokenInternalAuthRequest): Promise<TenantAccessTokenInternalAuthResponse>;
13
+ tenantAccessTokenInternal(body: TenantAccessTokenInternalRequest): Promise<Auth.TenantAccessTokenInternalResponse>;
9
14
  /**
10
15
  * 自建应用获取 app_access_token
11
16
  * @see https://open.feishu.cn/document/ukTMukTMukTM/ukDNz4SO0MjL5QzM/auth-v3/auth/app_access_token_internal
12
17
  */
13
- appAccessTokenInternalAuth(body: AppAccessTokenInternalAuthRequest): Promise<AppAccessTokenInternalAuthResponse>;
18
+ appAccessTokenInternal(body: AppAccessTokenInternalRequest): Promise<Auth.AppAccessTokenInternalResponse>;
14
19
  /**
15
20
  * 重新获取 app_ticket
16
21
  * @see https://open.feishu.cn/document/ukTMukTMukTM/ukDNz4SO0MjL5QzM/auth-v3/auth/app_ticket_resend
17
22
  */
18
- appTicketResendAuth(body: AppTicketResendAuthRequest): Promise<void>;
23
+ appTicketResend(body: AppTicketResendRequest): Promise<void>;
19
24
  /**
20
25
  * 商店应用获取 app_access_token
21
26
  * @see https://open.feishu.cn/document/ukTMukTMukTM/ukDNz4SO0MjL5QzM/auth-v3/auth/app_access_token
22
27
  */
23
- appAccessTokenAuth(body: AppAccessTokenAuthRequest): Promise<AppAccessTokenAuthResponse>;
28
+ appAccessToken(body: AppAccessTokenRequest): Promise<Auth.AppAccessTokenResponse>;
24
29
  /**
25
30
  * 商店应用获取 tenant_access_token
26
31
  * @see https://open.feishu.cn/document/ukTMukTMukTM/ukDNz4SO0MjL5QzM/auth-v3/auth/tenant_access_token
27
32
  */
28
- tenantAccessTokenAuth(body: TenantAccessTokenAuthRequest): Promise<TenantAccessTokenAuthResponse>;
33
+ tenantAccessToken(body: TenantAccessTokenRequest): Promise<Auth.TenantAccessTokenResponse>;
34
+ }
35
+ interface TenantAccessTokenInternalRequest {
36
+ /** 应用唯一标识,创建应用后获得 */
37
+ app_id: string;
38
+ /** 应用秘钥,创建应用后获得 */
39
+ app_secret: string;
40
+ }
41
+ interface TenantAccessTokenInternalResponse extends BaseResponse {
42
+ /** 访问 token */
43
+ tenant_access_token?: string;
44
+ /** app_access_token 过期时间 */
45
+ expire?: number;
46
+ }
47
+ interface AppAccessTokenInternalRequest {
48
+ /** 应用唯一标识,创建应用后获得 */
49
+ app_id: string;
50
+ /** 应用秘钥,创建应用后获得 */
51
+ app_secret: string;
52
+ }
53
+ interface AppAccessTokenInternalResponse extends BaseResponse {
54
+ /** 访问 token */
55
+ app_access_token?: string;
56
+ /** app_access_token 过期时间 */
57
+ expire?: number;
58
+ }
59
+ interface AppTicketResendRequest {
60
+ /** 应用唯一标识,创建应用后获得 */
61
+ app_id: string;
62
+ /** 应用秘钥,创建应用后获得 */
63
+ app_secret: string;
64
+ }
65
+ interface AppAccessTokenRequest {
66
+ /** 应用唯一标识,创建应用后获得 */
67
+ app_id: string;
68
+ /** 应用秘钥,创建应用后获得 */
69
+ app_secret: string;
70
+ /** 平台定时推送给应用的临时凭证,通过事件监听机制获得 */
71
+ app_ticket: string;
72
+ }
73
+ interface AppAccessTokenResponse extends BaseResponse {
74
+ /** 访问 token */
75
+ app_access_token?: string;
76
+ /** app_access_token 过期时间 */
77
+ expire?: number;
78
+ }
79
+ interface TenantAccessTokenRequest {
80
+ /** 应用唯一标识,创建应用 */
81
+ app_access_token: string;
82
+ /** 应用秘钥,创建应用后获得 */
83
+ tenant_key: string;
84
+ }
85
+ interface TenantAccessTokenResponse extends BaseResponse {
86
+ /** 访问 token */
87
+ tenant_access_token?: string;
88
+ /** app_access_token 过期时间 */
89
+ expire?: number;
29
90
  }
30
- }
31
- export interface TenantAccessTokenInternalAuthRequest {
32
- /** 应用唯一标识,创建应用后获得 */
33
- app_id: string;
34
- /** 应用秘钥,创建应用后获得 */
35
- app_secret: string;
36
- }
37
- export interface TenantAccessTokenInternalAuthResponse extends BaseResponse {
38
- /** 访问 token */
39
- tenant_access_token?: string;
40
- /** app_access_token 过期时间 */
41
- expire?: number;
42
- }
43
- export interface AppAccessTokenInternalAuthRequest {
44
- /** 应用唯一标识,创建应用后获得 */
45
- app_id: string;
46
- /** 应用秘钥,创建应用后获得 */
47
- app_secret: string;
48
- }
49
- export interface AppAccessTokenInternalAuthResponse extends BaseResponse {
50
- /** 访问 token */
51
- app_access_token?: string;
52
- /** app_access_token 过期时间 */
53
- expire?: number;
54
- }
55
- export interface AppTicketResendAuthRequest {
56
- /** 应用唯一标识,创建应用后获得 */
57
- app_id: string;
58
- /** 应用秘钥,创建应用后获得 */
59
- app_secret: string;
60
- }
61
- export interface AppAccessTokenAuthRequest {
62
- /** 应用唯一标识,创建应用后获得 */
63
- app_id: string;
64
- /** 应用秘钥,创建应用后获得 */
65
- app_secret: string;
66
- /** 平台定时推送给应用的临时凭证,通过事件监听机制获得 */
67
- app_ticket: string;
68
- }
69
- export interface AppAccessTokenAuthResponse extends BaseResponse {
70
- /** 访问 token */
71
- app_access_token?: string;
72
- /** app_access_token 过期时间 */
73
- expire?: number;
74
- }
75
- export interface TenantAccessTokenAuthRequest {
76
- /** 应用唯一标识,创建应用 */
77
- app_access_token: string;
78
- /** 应用秘钥,创建应用后获得 */
79
- tenant_key: string;
80
- }
81
- export interface TenantAccessTokenAuthResponse extends BaseResponse {
82
- /** 访问 token */
83
- tenant_access_token?: string;
84
- /** app_access_token 过期时间 */
85
- expire?: number;
86
91
  }
@@ -1,191 +1,226 @@
1
1
  declare module '../internal' {
2
2
  interface Internal {
3
- /**
4
- * 获取用户信息
5
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/authen-v1/user_info/get
6
- */
7
- getAuthenUserInfo(): Promise<GetAuthenUserInfoResponse>;
8
- /**
9
- * 获取 user_access_token
10
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/authen-v1/oidc-access_token/create
11
- */
12
- createAuthenOidcAccessToken(body: CreateAuthenOidcAccessTokenRequest): Promise<CreateAuthenOidcAccessTokenResponse>;
13
- /**
14
- * 刷新 user_access_token
15
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/authen-v1/oidc-refresh_access_token/create
16
- */
17
- createAuthenOidcRefreshAccessToken(body: CreateAuthenOidcRefreshAccessTokenRequest): Promise<CreateAuthenOidcRefreshAccessTokenResponse>;
18
- /**
19
- * 获取 user_access_token(v1 版本)
20
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/authen-v1/access_token/create
21
- */
22
- createAuthenAccessToken(body: CreateAuthenAccessTokenRequest): Promise<CreateAuthenAccessTokenResponse>;
23
- /**
24
- * 刷新 user_access_token(v1 版本)
25
- * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/authen-v1/refresh_access_token/create
26
- */
27
- createAuthenRefreshAccessToken(body: CreateAuthenRefreshAccessTokenRequest): Promise<CreateAuthenRefreshAccessTokenResponse>;
3
+ authen: Authen.Methods;
28
4
  }
29
5
  }
30
- export interface GetAuthenUserInfoResponse {
31
- /** 用户姓名 */
32
- name?: string;
33
- /** 用户英文名称 */
34
- en_name?: string;
35
- /** 用户头像 */
36
- avatar_url?: string;
37
- /** 用户头像 72x72 */
38
- avatar_thumb?: string;
39
- /** 用户头像 240x240 */
40
- avatar_middle?: string;
41
- /** 用户头像 640x640 */
42
- avatar_big?: string;
43
- /** 用户在应用内的唯一标识 */
44
- open_id?: string;
45
- /** 用户统一ID */
46
- union_id?: string;
47
- /** 用户邮箱 */
48
- email?: string;
49
- /** 企业邮箱,请先确保已在管理后台启用飞书邮箱服务 */
50
- enterprise_email?: string;
51
- /** 用户 user_id */
52
- user_id?: string;
53
- /** 用户手机号 */
54
- mobile?: string;
55
- /** 当前企业标识 */
56
- tenant_key?: string;
57
- /** 用户工号 */
58
- employee_no?: string;
59
- }
60
- export interface CreateAuthenOidcAccessTokenRequest {
61
- /** 授权类型,**固定值** */
62
- grant_type: string;
63
- /** 登录预授权码 */
64
- code: string;
65
- }
66
- export interface CreateAuthenOidcAccessTokenResponse {
67
- /** user_access_token,用于获取用户资源和访问某些open api */
68
- access_token: string;
69
- /** 刷新用户 `access_token` 时使用的 token */
70
- refresh_token?: string;
71
- /** token 类型,固定值 */
72
- token_type: string;
73
- /** `access_token`的有效期,单位: 秒,一般是两个小时左右,需要以返回结果为准 */
74
- expires_in?: number;
75
- /** `refresh_token` 的有效期,单位: 秒,一般是30天左右,需要以返回结果为准 */
76
- refresh_expires_in?: number;
77
- /** 用户授予app的权限全集 */
78
- scope?: string;
79
- }
80
- export interface CreateAuthenOidcRefreshAccessTokenRequest {
81
- /** 授权类型,**固定值**: */
82
- grant_type: string;
83
- /** 刷新 `user_access_token` 需要的凭证<br>获取user_access_token`接口和本接口均返回 `refresh_token`,**每次请求,请注意使用最新获取到的`refresh_token`** */
84
- refresh_token: string;
85
- }
86
- export interface CreateAuthenOidcRefreshAccessTokenResponse {
87
- /** user_access_token,用于获取用户资源和访问某些open api */
88
- access_token: string;
89
- /** 刷新用户 `access_token` 时使用的 token */
90
- refresh_token?: string;
91
- /** token 类型,固定值 */
92
- token_type: string;
93
- /** `access_token`的有效期,单位: 秒,一般是两个小时左右,需要以返回结果为准 */
94
- expires_in?: number;
95
- /** `refresh_token` 的有效期,单位: 秒,一般是30天左右,需要以返回结果为准 */
96
- refresh_expires_in?: number;
97
- /** 用户授予app的权限全集 */
98
- scope?: string;
99
- }
100
- export interface CreateAuthenAccessTokenRequest {
101
- /** 授权类型,**固定值** */
102
- grant_type: string;
103
- /** 登录预授权码,调用[获取登录预授权码](https://open.feishu.cn/document/ukTMukTMukTM/ukzN4UjL5cDO14SO3gTN)接口获取 */
104
- code: string;
105
- }
106
- export interface CreateAuthenAccessTokenResponse {
107
- /** user_access_token,用于获取用户资源 */
108
- access_token?: string;
109
- /** token 类型 */
110
- token_type?: string;
111
- /** `access_token`的有效期,单位: 秒 */
112
- expires_in?: number;
113
- /** 用户姓名 */
114
- name?: string;
115
- /** 用户英文名称 */
116
- en_name?: string;
117
- /** 用户头像 */
118
- avatar_url?: string;
119
- /** 用户头像 72x72 */
120
- avatar_thumb?: string;
121
- /** 用户头像 240x240 */
122
- avatar_middle?: string;
123
- /** 用户头像 640x640 */
124
- avatar_big?: string;
125
- /** 用户在应用内的唯一标识 */
126
- open_id?: string;
127
- /** 用户统一ID */
128
- union_id?: string;
129
- /** 用户邮箱 */
130
- email?: string;
131
- /** 企业邮箱,请先确保已在管理后台启用飞书邮箱服务 */
132
- enterprise_email?: string;
133
- /** 用户 user_id */
134
- user_id?: string;
135
- /** 用户手机号 */
136
- mobile?: string;
137
- /** 当前企业标识 */
138
- tenant_key?: string;
139
- /** `refresh_token` 的有效期,单位: 秒 */
140
- refresh_expires_in?: number;
141
- /** 刷新用户 `access_token` 时使用的 token */
142
- refresh_token?: string;
143
- /** 用户当前登录态session的唯一标识,为空则不返回 */
144
- sid?: string;
145
- }
146
- export interface CreateAuthenRefreshAccessTokenRequest {
147
- /** 授权类型,**固定值**: */
148
- grant_type: string;
149
- /** 刷新 `user_access_token` 需要的凭证<br>获取user_access_token`接口和本接口均返回 `refresh_token`,**每次请求,请注意使用最新获取到的`refresh_token`** */
150
- refresh_token: string;
151
- }
152
- export interface CreateAuthenRefreshAccessTokenResponse {
153
- /** user_access_token,用于获取用户资源 */
154
- access_token?: string;
155
- /** token 类型 */
156
- token_type?: string;
157
- /** `access_token`的有效期,单位: */
158
- expires_in?: number;
159
- /** 用户姓名 */
160
- name?: string;
161
- /** 用户英文名称 */
162
- en_name?: string;
163
- /** 用户头像 */
164
- avatar_url?: string;
165
- /** 用户头像 72x72 */
166
- avatar_thumb?: string;
167
- /** 用户头像 240x240 */
168
- avatar_middle?: string;
169
- /** 用户头像 640x640 */
170
- avatar_big?: string;
171
- /** 用户在应用内的唯一标识 */
172
- open_id?: string;
173
- /** 用户统一ID */
174
- union_id?: string;
175
- /** 用户邮箱 */
176
- email?: string;
177
- /** 企业邮箱,请先确保已在管理后台启用飞书邮箱服务 */
178
- enterprise_email?: string;
179
- /** 用户 user_id */
180
- user_id?: string;
181
- /** 用户手机号 */
182
- mobile?: string;
183
- /** 当前企业标识 */
184
- tenant_key?: string;
185
- /** `refresh_token` 的有效期,单位: 秒 */
186
- refresh_expires_in?: number;
187
- /** 刷新用户 `access_token` 时使用的 token */
188
- refresh_token?: string;
189
- /** 用户当前登录态session的唯一标识,为空则不返回 */
190
- sid?: string;
6
+ export declare namespace Authen {
7
+ interface Methods {
8
+ userInfo: UserInfo.Methods;
9
+ oidc: Oidc.Methods;
10
+ accessToken: AccessToken.Methods;
11
+ refreshAccessToken: RefreshAccessToken.Methods;
12
+ }
13
+ namespace UserInfo {
14
+ interface Methods {
15
+ /**
16
+ * 获取用户信息
17
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/authen-v1/user_info/get
18
+ */
19
+ get(): Promise<GetResponse>;
20
+ }
21
+ interface GetResponse {
22
+ /** 用户姓名 */
23
+ name?: string;
24
+ /** 用户英文名称 */
25
+ en_name?: string;
26
+ /** 用户头像 */
27
+ avatar_url?: string;
28
+ /** 用户头像 72x72 */
29
+ avatar_thumb?: string;
30
+ /** 用户头像 240x240 */
31
+ avatar_middle?: string;
32
+ /** 用户头像 640x640 */
33
+ avatar_big?: string;
34
+ /** 用户在应用内的唯一标识 */
35
+ open_id?: string;
36
+ /** 用户统一ID */
37
+ union_id?: string;
38
+ /** 用户邮箱 */
39
+ email?: string;
40
+ /** 企业邮箱,请先确保已在管理后台启用飞书邮箱服务 */
41
+ enterprise_email?: string;
42
+ /** 用户 user_id */
43
+ user_id?: string;
44
+ /** 用户手机号 */
45
+ mobile?: string;
46
+ /** 当前企业标识 */
47
+ tenant_key?: string;
48
+ /** 用户工号 */
49
+ employee_no?: string;
50
+ }
51
+ }
52
+ namespace Oidc {
53
+ interface Methods {
54
+ accessToken: AccessToken.Methods;
55
+ refreshAccessToken: RefreshAccessToken.Methods;
56
+ }
57
+ namespace AccessToken {
58
+ interface Methods {
59
+ /**
60
+ * 获取 user_access_token
61
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/authen-v1/oidc-access_token/create
62
+ */
63
+ create(body: CreateRequest): Promise<CreateResponse>;
64
+ }
65
+ interface CreateRequest {
66
+ /** 授权类型,**固定值** */
67
+ grant_type: string;
68
+ /** 登录预授权码 */
69
+ code: string;
70
+ }
71
+ interface CreateResponse {
72
+ /** user_access_token,用于获取用户资源和访问某些open api */
73
+ access_token: string;
74
+ /** 刷新用户 `access_token` 时使用的 token */
75
+ refresh_token?: string;
76
+ /** token 类型,固定值 */
77
+ token_type: string;
78
+ /** `access_token`的有效期,单位: 秒,一般是两个小时左右,需要以返回结果为准 */
79
+ expires_in?: number;
80
+ /** `refresh_token` 的有效期,单位: 秒,一般是30天左右,需要以返回结果为准 */
81
+ refresh_expires_in?: number;
82
+ /** 用户授予app的权限全集 */
83
+ scope?: string;
84
+ }
85
+ }
86
+ namespace RefreshAccessToken {
87
+ interface Methods {
88
+ /**
89
+ * 刷新 user_access_token
90
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/authen-v1/oidc-refresh_access_token/create
91
+ */
92
+ create(body: CreateRequest): Promise<CreateResponse>;
93
+ }
94
+ interface CreateRequest {
95
+ /** 授权类型,**固定值**: */
96
+ grant_type: string;
97
+ /** 刷新 `user_access_token` 需要的凭证<br>获取user_access_token`接口和本接口均返回 `refresh_token`,**每次请求,请注意使用最新获取到的`refresh_token`** */
98
+ refresh_token: string;
99
+ }
100
+ interface CreateResponse {
101
+ /** user_access_token,用于获取用户资源和访问某些open api */
102
+ access_token: string;
103
+ /** 刷新用户 `access_token` 时使用的 token */
104
+ refresh_token?: string;
105
+ /** token 类型,固定值 */
106
+ token_type: string;
107
+ /** `access_token`的有效期,单位: 秒,一般是两个小时左右,需要以返回结果为准 */
108
+ expires_in?: number;
109
+ /** `refresh_token` 的有效期,单位: 秒,一般是30天左右,需要以返回结果为准 */
110
+ refresh_expires_in?: number;
111
+ /** 用户授予app的权限全集 */
112
+ scope?: string;
113
+ }
114
+ }
115
+ }
116
+ namespace AccessToken {
117
+ interface Methods {
118
+ /**
119
+ * 获取 user_access_token(v1 版本)
120
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/authen-v1/access_token/create
121
+ */
122
+ create(body: CreateRequest): Promise<CreateResponse>;
123
+ }
124
+ interface CreateRequest {
125
+ /** 授权类型,**固定值** */
126
+ grant_type: string;
127
+ /** 登录预授权码,调用[获取登录预授权码](https://open.feishu.cn/document/ukTMukTMukTM/ukzN4UjL5cDO14SO3gTN)接口获取 */
128
+ code: string;
129
+ }
130
+ interface CreateResponse {
131
+ /** user_access_token,用于获取用户资源 */
132
+ access_token?: string;
133
+ /** token 类型 */
134
+ token_type?: string;
135
+ /** `access_token`的有效期,单位: */
136
+ expires_in?: number;
137
+ /** 用户姓名 */
138
+ name?: string;
139
+ /** 用户英文名称 */
140
+ en_name?: string;
141
+ /** 用户头像 */
142
+ avatar_url?: string;
143
+ /** 用户头像 72x72 */
144
+ avatar_thumb?: string;
145
+ /** 用户头像 240x240 */
146
+ avatar_middle?: string;
147
+ /** 用户头像 640x640 */
148
+ avatar_big?: string;
149
+ /** 用户在应用内的唯一标识 */
150
+ open_id?: string;
151
+ /** 用户统一ID */
152
+ union_id?: string;
153
+ /** 用户邮箱 */
154
+ email?: string;
155
+ /** 企业邮箱,请先确保已在管理后台启用飞书邮箱服务 */
156
+ enterprise_email?: string;
157
+ /** 用户 user_id */
158
+ user_id?: string;
159
+ /** 用户手机号 */
160
+ mobile?: string;
161
+ /** 当前企业标识 */
162
+ tenant_key?: string;
163
+ /** `refresh_token` 的有效期,单位: */
164
+ refresh_expires_in?: number;
165
+ /** 刷新用户 `access_token` 时使用的 token */
166
+ refresh_token?: string;
167
+ /** 用户当前登录态session的唯一标识,为空则不返回 */
168
+ sid?: string;
169
+ }
170
+ }
171
+ namespace RefreshAccessToken {
172
+ interface Methods {
173
+ /**
174
+ * 刷新 user_access_token(v1 版本)
175
+ * @see https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/authen-v1/refresh_access_token/create
176
+ */
177
+ create(body: CreateRequest): Promise<CreateResponse>;
178
+ }
179
+ interface CreateRequest {
180
+ /** 授权类型,**固定值**: */
181
+ grant_type: string;
182
+ /** 刷新 `user_access_token` 需要的凭证<br>获取user_access_token`接口和本接口均返回 `refresh_token`,**每次请求,请注意使用最新获取到的`refresh_token`** */
183
+ refresh_token: string;
184
+ }
185
+ interface CreateResponse {
186
+ /** user_access_token,用于获取用户资源 */
187
+ access_token?: string;
188
+ /** token 类型 */
189
+ token_type?: string;
190
+ /** `access_token`的有效期,单位: 秒 */
191
+ expires_in?: number;
192
+ /** 用户姓名 */
193
+ name?: string;
194
+ /** 用户英文名称 */
195
+ en_name?: string;
196
+ /** 用户头像 */
197
+ avatar_url?: string;
198
+ /** 用户头像 72x72 */
199
+ avatar_thumb?: string;
200
+ /** 用户头像 240x240 */
201
+ avatar_middle?: string;
202
+ /** 用户头像 640x640 */
203
+ avatar_big?: string;
204
+ /** 用户在应用内的唯一标识 */
205
+ open_id?: string;
206
+ /** 用户统一ID */
207
+ union_id?: string;
208
+ /** 用户邮箱 */
209
+ email?: string;
210
+ /** 企业邮箱,请先确保已在管理后台启用飞书邮箱服务 */
211
+ enterprise_email?: string;
212
+ /** 用户 user_id */
213
+ user_id?: string;
214
+ /** 用户手机号 */
215
+ mobile?: string;
216
+ /** 当前企业标识 */
217
+ tenant_key?: string;
218
+ /** `refresh_token` 的有效期,单位: 秒 */
219
+ refresh_expires_in?: number;
220
+ /** 刷新用户 `access_token` 时使用的 token */
221
+ refresh_token?: string;
222
+ /** 用户当前登录态session的唯一标识,为空则不返回 */
223
+ sid?: string;
224
+ }
225
+ }
191
226
  }