@satorijs/adapter-dingtalk 2.0.3 → 2.0.5

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 (56) hide show
  1. package/lib/bot.d.ts +1 -1
  2. package/lib/http.d.ts +3 -2
  3. package/lib/index.js +35 -14
  4. package/lib/index.js.map +2 -3
  5. package/package.json +8 -4
  6. package/src/api/.eslintrc.yml +2 -0
  7. package/src/api/alitrip.ts +467 -0
  8. package/src/api/attendance.ts +81 -0
  9. package/src/api/badge.ts +285 -0
  10. package/src/api/blackboard.ts +28 -0
  11. package/src/api/calendar.ts +817 -0
  12. package/src/api/card.ts +215 -0
  13. package/src/api/conference.ts +561 -0
  14. package/src/api/connector.ts +97 -0
  15. package/src/api/contact.ts +56 -0
  16. package/src/api/convFile.ts +166 -0
  17. package/src/api/crm.ts +830 -0
  18. package/src/api/customerService.ts +156 -0
  19. package/src/api/datacenter.ts +672 -0
  20. package/src/api/devicemng.ts +202 -0
  21. package/src/api/diot.ts +19 -0
  22. package/src/api/doc.ts +232 -0
  23. package/src/api/drive.ts +109 -0
  24. package/src/api/edu.ts +30 -0
  25. package/src/api/esign.ts +44 -0
  26. package/src/api/exclusive.ts +372 -0
  27. package/src/api/h3yun.ts +537 -0
  28. package/src/api/hrm.ts +272 -0
  29. package/src/api/im.ts +978 -0
  30. package/src/api/industry.ts +153 -0
  31. package/src/api/jzcrm.ts +304 -0
  32. package/src/api/link.ts +94 -0
  33. package/src/api/live.ts +162 -0
  34. package/src/api/microApp.ts +309 -0
  35. package/src/api/oapi.ts +4083 -0
  36. package/src/api/oauth2.ts +146 -0
  37. package/src/api/pedia.ts +222 -0
  38. package/src/api/project.ts +1519 -0
  39. package/src/api/resident.ts +133 -0
  40. package/src/api/robot.ts +326 -0
  41. package/src/api/rooms.ts +334 -0
  42. package/src/api/serviceGroup.ts +216 -0
  43. package/src/api/storage.ts +1701 -0
  44. package/src/api/swform.ts +94 -0
  45. package/src/api/todo.ts +220 -0
  46. package/src/api/wiki.ts +231 -0
  47. package/src/api/workbench.ts +73 -0
  48. package/src/api/yida.ts +2165 -0
  49. package/src/bot.ts +129 -0
  50. package/src/http.ts +44 -0
  51. package/src/index.ts +9 -0
  52. package/src/internal.ts +47 -0
  53. package/src/message.ts +141 -0
  54. package/src/types/index.ts +140 -0
  55. package/src/utils.ts +53 -0
  56. package/src/ws.ts +55 -0
@@ -0,0 +1,146 @@
1
+ import { Internal } from '../internal'
2
+ // GENERATED CONTENT
3
+
4
+ export interface CreateJsapiTicketResponse {
5
+ jsapiTicket?: string
6
+ expireIn?: number
7
+ }
8
+
9
+ export interface GetSsoAccessTokenParams {
10
+ /** 企业的corpId。 */
11
+ corpid: string
12
+ /** sso密钥,可以在[开发者后台](https://open-dev.dingtalk.com/fe/old#/corpAuthInfo)**基本信息**—**开发信息**(****旧版****)页面查看。 */
13
+ ssoSecret: string
14
+ }
15
+
16
+ export interface GetSsoAccessTokenResponse {
17
+ accessToken?: string
18
+ expireIn?: number
19
+ }
20
+
21
+ export interface GetPersonalAuthRuleResponse {
22
+ result?: {
23
+ resource: string
24
+ authItems: number
25
+ }[]
26
+ }
27
+
28
+ export interface GetAccessTokenParams {
29
+ /** 已创建的企业内部应用的AppKey。 */
30
+ appKey: string
31
+ /** 已创建的企业内部应用的AppSecret。 */
32
+ appSecret?: string
33
+ }
34
+
35
+ export interface GetAccessTokenResponse {
36
+ accessToken?: string
37
+ expireIn?: number
38
+ }
39
+
40
+ export interface GetCorpAccessTokenParams {
41
+ /** 已创建的第三方企业应用的SuiteKey。 */
42
+ suiteKey: string
43
+ /** 已创建的第三方企业应用的SuiteSecret。 */
44
+ suiteSecret: string
45
+ /** 授权企业的CorpId。 */
46
+ authCorpId: string
47
+ /** 钉钉推送的suiteTicket。 */
48
+ suiteTicket: string
49
+ }
50
+
51
+ export interface GetCorpAccessTokenResponse {
52
+ accessToken?: string
53
+ expireIn?: number
54
+ }
55
+
56
+ export interface GetUserTokenParams {
57
+ /** 应用id。可使用扫码登录应用或者第三方个人小程序的appId。 */
58
+ clientId: string
59
+ /** 应用密钥。 */
60
+ clientSecret?: string
61
+ /** OAuth 2.0 临时授权码。 */
62
+ code?: string
63
+ /** OAuth2.0刷新令牌,从返回结果里面获取。 */
64
+ refreshToken?: string
65
+ /** - 如果使用授权码换token,传authorization\_code。 */
66
+ grantType?: string
67
+ }
68
+
69
+ export interface GetUserTokenResponse {
70
+ accessToken?: string
71
+ refreshToken?: string
72
+ expireIn?: number
73
+ corpId?: string
74
+ }
75
+
76
+ export interface GetSsoUserInfoQuery {
77
+ /** 临时授权码,管理员在钉钉管理后台,跳转到应用管理页面时,该授权码会附带在URL中。 */
78
+ code: string
79
+ }
80
+
81
+ export interface GetSsoUserInfoResponse {
82
+ corpId: string
83
+ corpName: string
84
+ userId: string
85
+ email: string
86
+ userName: string
87
+ avatar: string
88
+ isAdmin: unknown
89
+ }
90
+
91
+ // funcName: isOldApi
92
+ Internal.define({
93
+ '/oauth2/jsapiTickets': { POST: { createJsapiTicket: false } },
94
+ '/oauth2/ssoAccessToken': { POST: { getSsoAccessToken: false } },
95
+ '/oauth2/authRules/user': { GET: { getPersonalAuthRule: false } },
96
+ '/oauth2/accessToken': { POST: { getAccessToken: false } },
97
+ '/oauth2/corpAccessToken': { POST: { getCorpAccessToken: false } },
98
+ '/oauth2/userAccessToken': { POST: { getUserToken: false } },
99
+ '/oauth2/ssoUserInfo': { GET: { getSsoUserInfo: false } },
100
+ })
101
+
102
+ declare module '../internal' {
103
+ interface Internal {
104
+ /**
105
+ * 生成jsapi ticket
106
+ * @see https://open.dingtalk.com/document/isvapp/create-a-jsapi-ticket
107
+ */
108
+ createJsapiTicket(): Promise<CreateJsapiTicketResponse>
109
+ /**
110
+ * 生成微应用管理后台accessToken
111
+ * @see https://open.dingtalk.com/document/isvapp/obtain-the-access_token-of-the-micro-application-background-without-log-on
112
+ */
113
+ getSsoAccessToken(
114
+ params: GetSsoAccessTokenParams,
115
+ ): Promise<GetSsoAccessTokenResponse>
116
+ /**
117
+ * 查询个人授权记录
118
+ * @see https://open.dingtalk.com/document/isvapp/query-individual-authorization-records
119
+ */
120
+ getPersonalAuthRule(): Promise<GetPersonalAuthRuleResponse>
121
+ /**
122
+ * 获取企业accessToken(企业内部应用)
123
+ * @see https://open.dingtalk.com/document/orgapp/obtain-the-access_token-of-an-internal-app
124
+ */
125
+ getAccessToken(
126
+ params: GetAccessTokenParams,
127
+ ): Promise<GetAccessTokenResponse>
128
+ /**
129
+ * 获取企业accessToken(应用商店应用)
130
+ * @see https://open.dingtalk.com/document/isvapp/obtain-the-access_token-of-the-authorized-enterprise
131
+ */
132
+ getCorpAccessToken(
133
+ params: GetCorpAccessTokenParams,
134
+ ): Promise<GetCorpAccessTokenResponse>
135
+ /**
136
+ * 获取用户token
137
+ * @see https://open.dingtalk.com/document/isvapp/obtain-user-token
138
+ */
139
+ getUserToken(params: GetUserTokenParams): Promise<GetUserTokenResponse>
140
+ /**
141
+ * 查询微应用后台免登的用户信息
142
+ * @see https://open.dingtalk.com/document/isvapp/obtains-the-identity-of-an-application-administrator
143
+ */
144
+ getSsoUserInfo(query: GetSsoUserInfoQuery): Promise<GetSsoUserInfoResponse>
145
+ }
146
+ }
@@ -0,0 +1,222 @@
1
+ import { Internal } from '../internal'
2
+ // GENERATED CONTENT
3
+
4
+ export interface PediaWordsQueryQuery {
5
+ /** 查询主键编号。 */
6
+ uuid: number
7
+ /** 当前操作用户的userId。 */
8
+ userId: string
9
+ }
10
+
11
+ export interface PediaWordsQueryResponse {
12
+ data?: {
13
+ wordName?: string
14
+ uuid?: number
15
+ gmtCreate?: number
16
+ gmtModify?: number
17
+ wordAlias?: number
18
+ highLightWordAlias?: number
19
+ relatedDoc?: number
20
+ relatedLink?: number
21
+ creatorName?: string
22
+ updaterName?: string
23
+ approveName?: string
24
+ wordParaphrase?: string
25
+ simpleWordParaphrase?: string
26
+ contacts?: number
27
+ tagsList?: number
28
+ appLink?: number
29
+ imHighLight?: number
30
+ simHighLight?: number
31
+ picList?: number
32
+ contactList?: number
33
+ userId?: string
34
+ parentUuid?: number
35
+ }
36
+ success?: unknown
37
+ }
38
+
39
+ export interface PediaWordsSearchParams {
40
+ /** 搜索关键词。 */
41
+ wordName?: string
42
+ /** 操作人的userId。 */
43
+ userId: string
44
+ /** 当前每页需要展示的数量,最大20。 */
45
+ pageSize: number
46
+ /** 当前查询的页数,从1开始。 */
47
+ pageNumber: number
48
+ /** 当前搜索列表的状态: */
49
+ status: string
50
+ }
51
+
52
+ export interface PediaWordsSearchResponse {
53
+ data?: {
54
+ wordName?: string
55
+ uuid?: number
56
+ gmtCreate?: number
57
+ gmtModify?: number
58
+ wordAlias?: number
59
+ highLightWordAlias?: number
60
+ relatedLink?: number
61
+ relatedDoc?: number
62
+ creatorName?: string
63
+ updaterName?: string
64
+ approveName?: string
65
+ wordParaphrase?: string
66
+ simpleWordParaphrase?: string
67
+ contacts?: number
68
+ tagsList?: number
69
+ appLink?: number
70
+ imHighLight?: number
71
+ simHighLight?: number
72
+ picList?: number
73
+ contactList?: number
74
+ userId?: string
75
+ parentUuid?: number
76
+ }[]
77
+ success?: unknown
78
+ }
79
+
80
+ export interface PediaWordsApproveParams {
81
+ /** 当前审核的词条的主键编号。 */
82
+ uuid: number
83
+ /** 操作人的组织员工userId。 */
84
+ userId: string
85
+ /** 审核的结果: */
86
+ approveStatus: string
87
+ /** 拒绝的原因。 */
88
+ approveReason?: string
89
+ /** 当前内部群是否高亮: */
90
+ imHighLight: unknown
91
+ /** 服务群是否高亮: */
92
+ simHighLight: unknown
93
+ }
94
+
95
+ export interface PediaWordsApproveResponse {
96
+ success?: unknown
97
+ }
98
+
99
+ export interface PediaWordsDeleteQuery {
100
+ /** 当前需要删除的词条主键编号。 */
101
+ uuid: number
102
+ /** 当前操作用户的userId。 */
103
+ userId: string
104
+ }
105
+
106
+ export interface PediaWordsDeleteResponse {
107
+ uuid?: number
108
+ success?: unknown
109
+ }
110
+
111
+ export interface PediaWordsUpdateParams {
112
+ /** 需要更新的词条编号。 */
113
+ uuid: number
114
+ /** 词条名称。 */
115
+ wordName: string
116
+ /** 词条别名列表,最大值10。 */
117
+ wordAlias?: string[]
118
+ /** 可高亮的别名列表,最大值10。 */
119
+ highLightWordAlias?: string[]
120
+ /** 词条相关文档信息,最大值10。 */
121
+ relatedDoc?: object[]
122
+ /** 词条相关链接信息,最大值10。 */
123
+ relatedLink?: object[]
124
+ /** 词条释义。 */
125
+ wordParaphrase: string
126
+ /** 相关应用对象。 */
127
+ appLink?: object[]
128
+ /** 操作人的userId。 */
129
+ userId?: string
130
+ /** 词条的相关图片信息,最大值10。 */
131
+ picList?: object[]
132
+ /** 词条的相关联系人信息,最大值10。 */
133
+ contactList?: object[]
134
+ }
135
+
136
+ export interface PediaWordsUpdateResponse {
137
+ uuid?: number
138
+ success?: unknown
139
+ }
140
+
141
+ export interface PediaWordsAddParams {
142
+ /** 新增词条的名称。 */
143
+ wordName: string
144
+ /** 词条的别名列表,多个名字的时候可以添加,每次调用最多传10个。 */
145
+ wordAlias?: string[]
146
+ /** 词条高亮别名列表,每次调用最多传10个。 */
147
+ highLightWordAlias?: string[]
148
+ /** 词条相关的文档列表,每次调用最多传10个。 */
149
+ relatedDoc?: object[]
150
+ /** 词条相关的链接信息,每次调用最多传10个。 */
151
+ relatedLink?: object[]
152
+ /** 词条释义,针对词条的描述内容。 */
153
+ wordParaphrase: string
154
+ /** 词条相关的图片信息,每次调用最多传10个。 */
155
+ picList?: object[]
156
+ /** 组织对应的员工userId。 */
157
+ userId: string
158
+ /** 词条相关的联系人信息,每次调用最多传10个。 */
159
+ contactList?: object[]
160
+ }
161
+
162
+ export interface PediaWordsAddResponse {
163
+ uuid?: number
164
+ success?: unknown
165
+ }
166
+
167
+ // funcName: isOldApi
168
+ Internal.define({
169
+ '/pedia/words/query': { POST: { pediaWordsQuery: false } },
170
+ '/pedia/words/search': { POST: { pediaWordsSearch: false } },
171
+ '/pedia/words/approve': { POST: { pediaWordsApprove: false } },
172
+ '/pedia/words': {
173
+ DELETE: { pediaWordsDelete: false },
174
+ PUT: { pediaWordsUpdate: false },
175
+ POST: { pediaWordsAdd: false },
176
+ },
177
+ })
178
+
179
+ declare module '../internal' {
180
+ interface Internal {
181
+ /**
182
+ * 根据词条主键ID查询当前词条详情
183
+ * @see https://open.dingtalk.com/document/app/entry-query
184
+ */
185
+ pediaWordsQuery(
186
+ query: PediaWordsQueryQuery,
187
+ ): Promise<PediaWordsQueryResponse>
188
+ /**
189
+ * 分页获取企业词条信息
190
+ * @see https://open.dingtalk.com/document/app/entry-search
191
+ */
192
+ pediaWordsSearch(
193
+ params: PediaWordsSearchParams,
194
+ ): Promise<PediaWordsSearchResponse>
195
+ /**
196
+ * 企业百科针对待审核词条进行审核
197
+ * @see https://open.dingtalk.com/document/app/entry-review
198
+ */
199
+ pediaWordsApprove(
200
+ params: PediaWordsApproveParams,
201
+ ): Promise<PediaWordsApproveResponse>
202
+ /**
203
+ * 企业百科针对uuid删除当前词条
204
+ * @see https://open.dingtalk.com/document/app/entry-delete
205
+ */
206
+ pediaWordsDelete(
207
+ query: PediaWordsDeleteQuery,
208
+ ): Promise<PediaWordsDeleteResponse>
209
+ /**
210
+ * 企业百科对当前已经生效词条进行编辑
211
+ * @see https://open.dingtalk.com/document/app/update-entry
212
+ */
213
+ pediaWordsUpdate(
214
+ params: PediaWordsUpdateParams,
215
+ ): Promise<PediaWordsUpdateResponse>
216
+ /**
217
+ * 企业百科增加当前企业词条信息
218
+ * @see https://open.dingtalk.com/document/app/new-entry
219
+ */
220
+ pediaWordsAdd(params: PediaWordsAddParams): Promise<PediaWordsAddResponse>
221
+ }
222
+ }