@satorijs/adapter-lark 3.10.6 → 3.11.0

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