@nest-packages/nestjs-lark-sdk 0.1.1 → 0.2.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.
- package/dist/bitable-base-field.d.ts +407 -144
- package/dist/bitable-base-field.js +133 -1
- package/dist/bitable-base-field.js.map +1 -1
- package/dist/bitable-base-record.d.ts +312 -195
- package/dist/bitable-base-record.js +13 -0
- package/dist/bitable-base-record.js.map +1 -1
- package/dist/bitable-base.abstract.d.ts +10 -10
- package/dist/contact-base.d.ts +328 -233
- package/dist/contact-base.js +1 -0
- package/dist/contact-base.js.map +1 -1
- package/dist/feishu-base-plus.d.ts +22 -15
- package/dist/feishu.utils.d.ts +9 -3
- package/dist/im-base.d.ts +186 -89
- package/dist/im-base.js +20 -2
- package/dist/im-base.js.map +1 -1
- package/dist/im-base.type.d.ts +29 -5
- package/dist/nestjs-lark-sdk.module.d.ts +21 -6
- package/dist/nestjs-lark-sdk.service.d.ts +1 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/type.bitable.d.ts +6 -3
- package/dist/type.d.ts +63 -58
- package/dist/types/index.d.ts +169 -113
- package/package.json +3 -2
package/dist/type.bitable.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ import * as lark from '@larksuiteoapi/node-sdk';
|
|
|
2
2
|
export type bitableType = lark.Client['bitable'];
|
|
3
3
|
export type appTableRecordType = bitableType['appTableRecord'];
|
|
4
4
|
export type appTableRecordListType = appTableRecordType['list'];
|
|
5
|
-
export type appTableRecordListParamsType =
|
|
5
|
+
export type appTableRecordListParamsType =
|
|
6
|
+
Parameters<appTableRecordListType>[0]['params'];
|
|
6
7
|
export type TypeAppTablePath = Parameters<appTableRecordListType>[0]['path'];
|
|
7
8
|
export type TypeAppTableRecordSearch = appTableRecordType['search'];
|
|
8
|
-
export type TypeAppTableRecordSearchPayloadData =
|
|
9
|
-
|
|
9
|
+
export type TypeAppTableRecordSearchPayloadData =
|
|
10
|
+
Parameters<TypeAppTableRecordSearch>[0]['data'];
|
|
11
|
+
export type TypeAppTableRecordSearchPayloadParams =
|
|
12
|
+
Parameters<TypeAppTableRecordSearch>[0]['params'];
|
package/dist/type.d.ts
CHANGED
|
@@ -1,63 +1,68 @@
|
|
|
1
1
|
import * as lark from '@larksuiteoapi/node-sdk';
|
|
2
2
|
export interface TypeUser {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
3
|
+
avatar: {
|
|
4
|
+
avatar_240: string;
|
|
5
|
+
};
|
|
6
|
+
city: string;
|
|
7
|
+
country: string;
|
|
8
|
+
department_ids: string[];
|
|
9
|
+
description: string;
|
|
10
|
+
email: string;
|
|
11
|
+
employee_no: string;
|
|
12
|
+
employee_type: number;
|
|
13
|
+
en_name: string;
|
|
14
|
+
enterprise_email: string;
|
|
15
|
+
gender: 1 | 2;
|
|
16
|
+
is_tenant_manager: boolean;
|
|
17
|
+
job_title: string;
|
|
18
|
+
join_time: number;
|
|
19
|
+
mobile: string;
|
|
20
|
+
mobile_visible: boolean;
|
|
21
|
+
name: string;
|
|
22
|
+
nickname: string;
|
|
23
|
+
open_id: string;
|
|
24
|
+
orders: Array<{
|
|
25
|
+
department_id: string;
|
|
26
|
+
department_order: number;
|
|
27
|
+
is_primary_dept: boolean;
|
|
28
|
+
user_order: number;
|
|
29
|
+
}>;
|
|
30
|
+
status: {
|
|
31
|
+
is_activated: boolean;
|
|
32
|
+
is_exited: boolean;
|
|
33
|
+
is_frozen: boolean;
|
|
34
|
+
is_resigned: boolean;
|
|
35
|
+
is_unjoin: boolean;
|
|
36
|
+
};
|
|
37
|
+
union_id: string;
|
|
38
|
+
user_id: string;
|
|
39
|
+
work_station: string;
|
|
40
40
|
}
|
|
41
|
-
export type TypeUserStore = Pick<
|
|
41
|
+
export type TypeUserStore = Pick<
|
|
42
|
+
TypeUser,
|
|
43
|
+
'name' | 'open_id' | 'mobile' | 'nickname' | 'user_id'
|
|
44
|
+
>;
|
|
42
45
|
export interface TypeDepartment {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
department_id: string;
|
|
47
|
+
i18n_name: {
|
|
48
|
+
[key: string]: string;
|
|
49
|
+
};
|
|
50
|
+
leader_user_id?: string;
|
|
51
|
+
leaders: Array<{
|
|
52
|
+
leaderID: string;
|
|
53
|
+
leaderType: number;
|
|
54
|
+
}>;
|
|
55
|
+
member_count: number;
|
|
56
|
+
name: string;
|
|
57
|
+
open_department_id?: string;
|
|
58
|
+
order: string;
|
|
59
|
+
parent_department_id: string;
|
|
60
|
+
primary_member_count: number;
|
|
61
|
+
status: {
|
|
62
|
+
is_deleted: boolean;
|
|
63
|
+
};
|
|
64
|
+
chat_id: string;
|
|
62
65
|
}
|
|
63
|
-
export type BitableRecordChangedDataType = Parameters<
|
|
66
|
+
export type BitableRecordChangedDataType = Parameters<
|
|
67
|
+
lark.EventHandles['drive.file.bitable_record_changed_v1']
|
|
68
|
+
>[0];
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,168 +1,224 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
CardActionHandler,
|
|
3
|
+
Client,
|
|
4
|
+
EventDispatcher,
|
|
5
|
+
} from '@larksuiteoapi/node-sdk';
|
|
2
6
|
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
3
7
|
export type LarkClientParamsType = ConstructorParameters<typeof Client>[0];
|
|
4
|
-
export type LarkEventDispatcherParamsType = ConstructorParameters<
|
|
5
|
-
|
|
8
|
+
export type LarkEventDispatcherParamsType = ConstructorParameters<
|
|
9
|
+
typeof EventDispatcher
|
|
10
|
+
>[0];
|
|
11
|
+
export type LarkClientCardActionHandlerType = ConstructorParameters<
|
|
12
|
+
typeof CardActionHandler
|
|
13
|
+
>[0];
|
|
6
14
|
export interface NestjsLarkSdkModuleOptionsFactory {
|
|
7
|
-
|
|
15
|
+
createNestjsLarkSdkModuleOptions():
|
|
16
|
+
| Promise<NestjsLarkSdkModuleOptions>
|
|
17
|
+
| NestjsLarkSdkModuleOptions;
|
|
8
18
|
}
|
|
9
19
|
export interface NestjsLarkSdkModuleOptions {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
export interface NestjsLarkSdkModuleAsyncOptions
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
LarkClientParams: LarkClientParamsType;
|
|
21
|
+
LarkEventDispatcherParams?: LarkEventDispatcherParamsType;
|
|
22
|
+
}
|
|
23
|
+
export interface NestjsLarkSdkModuleAsyncOptions
|
|
24
|
+
extends Pick<ModuleMetadata, 'imports'> {
|
|
25
|
+
inject?: any[];
|
|
26
|
+
useClass?: Type<NestjsLarkSdkModuleOptionsFactory>;
|
|
27
|
+
useExisting?: Type<NestjsLarkSdkModuleOptionsFactory>;
|
|
28
|
+
useFactory?: (
|
|
29
|
+
...args: any[]
|
|
30
|
+
) => Promise<NestjsLarkSdkModuleOptions> | NestjsLarkSdkModuleOptions;
|
|
18
31
|
}
|
|
19
32
|
import * as lark from '@larksuiteoapi/node-sdk';
|
|
20
33
|
export type EhrEmployeeList = lark.Client['ehr']['employee']['list'];
|
|
21
34
|
export type EhrEmployeeListReturnType = ReturnType<EhrEmployeeList>;
|
|
22
35
|
export type EhrEmployeeListParams = Parameters<EhrEmployeeList>[0]['params'];
|
|
23
|
-
export type EhrEmployeeListDataItems =
|
|
24
|
-
|
|
25
|
-
export type
|
|
26
|
-
|
|
27
|
-
export type
|
|
28
|
-
|
|
29
|
-
export type
|
|
30
|
-
|
|
31
|
-
export type
|
|
36
|
+
export type EhrEmployeeListDataItems =
|
|
37
|
+
UnPromise<EhrEmployeeListReturnType>['data']['items'];
|
|
38
|
+
export type BitableAppTableFieldList =
|
|
39
|
+
lark.Client['bitable']['appTableField']['list'];
|
|
40
|
+
export type BitableAppTableFieldListReturnType =
|
|
41
|
+
ReturnType<BitableAppTableFieldList>;
|
|
42
|
+
export type BitableAppTableFieldListDataItems =
|
|
43
|
+
UnPromise<BitableAppTableFieldListReturnType>['data']['items'];
|
|
44
|
+
export type BitableAppTableFieldCreate =
|
|
45
|
+
lark.Client['bitable']['appTableField']['create'];
|
|
46
|
+
export type appTableFieldCreateData =
|
|
47
|
+
Parameters<BitableAppTableFieldCreate>[0]['data'];
|
|
48
|
+
export type appTableFieldCreatePath =
|
|
49
|
+
Parameters<BitableAppTableFieldCreate>[0]['path'];
|
|
50
|
+
export type bitableAppTableCreate =
|
|
51
|
+
lark.Client['bitable']['appTable']['create'];
|
|
52
|
+
export type appTableCreateData =
|
|
53
|
+
Parameters<bitableAppTableCreate>[0]['data']['table']['fields'][0];
|
|
32
54
|
export type appTableCreatePath = Parameters<bitableAppTableCreate>[0]['path'];
|
|
33
|
-
export type BitableAppTableFieldCreateReturnTypeDataField = UnPromise<
|
|
34
|
-
|
|
35
|
-
|
|
55
|
+
export type BitableAppTableFieldCreateReturnTypeDataField = UnPromise<
|
|
56
|
+
ReturnType<BitableAppTableFieldCreate>
|
|
57
|
+
>['data']['field'];
|
|
58
|
+
export type typeAppTableRecordCreateFields = Parameters<
|
|
59
|
+
lark.Client['bitable']['appTableRecord']['create']
|
|
60
|
+
>[0]['data']['fields'];
|
|
61
|
+
type returnTypeAppTableRecordCreate = ReturnType<
|
|
62
|
+
lark.Client['bitable']['appTableRecord']['create']
|
|
63
|
+
>;
|
|
36
64
|
export type UnPromise<T> = T extends Promise<infer R> ? R : any;
|
|
37
|
-
type returnTypeImMessageCreate = ReturnType<
|
|
65
|
+
type returnTypeImMessageCreate = ReturnType<
|
|
66
|
+
lark.Client['im']['message']['create']
|
|
67
|
+
>;
|
|
38
68
|
export type responseTypeImMessageCreate = UnPromise<returnTypeImMessageCreate>;
|
|
39
69
|
export interface typeFeishuImMessageCreated {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
export type responseAppTableRecordCreate =
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
export type
|
|
50
|
-
|
|
51
|
-
export type
|
|
52
|
-
|
|
70
|
+
requestData: any;
|
|
71
|
+
responseData: responseTypeImMessageCreate;
|
|
72
|
+
larkClient?: lark.Client;
|
|
73
|
+
}
|
|
74
|
+
export type responseAppTableRecordCreate =
|
|
75
|
+
UnPromise<returnTypeAppTableRecordCreate>;
|
|
76
|
+
type returnTypeAppTableRecordList = ReturnType<
|
|
77
|
+
lark.Client['bitable']['appTableRecord']['list']
|
|
78
|
+
>;
|
|
79
|
+
export type AppTableRecordApiResponseRecordField =
|
|
80
|
+
UnPromise<returnTypeAppTableRecordList>;
|
|
81
|
+
export type AppTableRecordRecordField =
|
|
82
|
+
AppTableRecordApiResponseRecordField['data']['items'][0];
|
|
83
|
+
type returnTypeAppTableFieldList = ReturnType<
|
|
84
|
+
lark.Client['bitable']['appTableField']['list']
|
|
85
|
+
>;
|
|
86
|
+
export type appTableFieldApiResponseRecordField =
|
|
87
|
+
UnPromise<returnTypeAppTableFieldList>;
|
|
88
|
+
export type appTableFieldRecordField =
|
|
89
|
+
appTableFieldApiResponseRecordField['data']['items'][0];
|
|
90
|
+
export type IMessageRootObject = Parameters<
|
|
91
|
+
lark.EventHandles['im.message.receive_v1']
|
|
92
|
+
>[0];
|
|
93
|
+
export type IMessageEvent = Parameters<
|
|
94
|
+
lark.EventHandles['im.message.receive_v1']
|
|
95
|
+
>[0]['message'];
|
|
53
96
|
export interface FileToken {
|
|
54
|
-
|
|
97
|
+
file_token?: string;
|
|
55
98
|
}
|
|
56
99
|
export interface UploadImage {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
100
|
+
file_name: string;
|
|
101
|
+
parent_type:
|
|
102
|
+
| 'doc_image'
|
|
103
|
+
| 'docx_image'
|
|
104
|
+
| 'sheet_image'
|
|
105
|
+
| 'doc_file'
|
|
106
|
+
| 'docx_file'
|
|
107
|
+
| 'sheet_file'
|
|
108
|
+
| 'vc_virtual_background'
|
|
109
|
+
| 'bitable_image'
|
|
110
|
+
| 'bitable_file'
|
|
111
|
+
| 'moments'
|
|
112
|
+
| 'ccm_import_open';
|
|
113
|
+
parent_node: string;
|
|
114
|
+
extra?: {
|
|
115
|
+
image_key: string;
|
|
116
|
+
};
|
|
63
117
|
}
|
|
64
118
|
export interface Link {
|
|
65
|
-
|
|
66
|
-
|
|
119
|
+
text?: string;
|
|
120
|
+
link?: string;
|
|
67
121
|
}
|
|
68
122
|
export interface Address {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
123
|
+
location?: string;
|
|
124
|
+
pname?: string;
|
|
125
|
+
cityname?: string;
|
|
126
|
+
adname?: string;
|
|
127
|
+
address?: string;
|
|
128
|
+
name?: string;
|
|
129
|
+
full_address?: string;
|
|
76
130
|
}
|
|
77
131
|
export interface Person {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
132
|
+
id?: string;
|
|
133
|
+
name?: string;
|
|
134
|
+
en_name?: string;
|
|
135
|
+
email?: string;
|
|
82
136
|
}
|
|
83
137
|
export interface Files {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
138
|
+
file_token?: string;
|
|
139
|
+
name?: string;
|
|
140
|
+
type?: string;
|
|
141
|
+
size?: number;
|
|
142
|
+
url?: string;
|
|
143
|
+
tmp_url?: string;
|
|
90
144
|
}
|
|
91
145
|
export interface Text {
|
|
92
|
-
|
|
93
|
-
|
|
146
|
+
tag: 'text';
|
|
147
|
+
text: string;
|
|
94
148
|
}
|
|
95
149
|
export interface Image {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
150
|
+
tag: 'img';
|
|
151
|
+
image_key: string;
|
|
152
|
+
width: number;
|
|
153
|
+
height: number;
|
|
100
154
|
}
|
|
101
155
|
export interface AtUser {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
156
|
+
tag: 'at';
|
|
157
|
+
user_id: string;
|
|
158
|
+
user_name: string;
|
|
105
159
|
}
|
|
106
160
|
export interface Field {
|
|
107
|
-
|
|
108
|
-
|
|
161
|
+
field_id: string;
|
|
162
|
+
field_value: string;
|
|
109
163
|
}
|
|
110
164
|
export interface TypeBitablePath {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
165
|
+
app_token: string;
|
|
166
|
+
table_id: string;
|
|
167
|
+
view_id: string;
|
|
114
168
|
}
|
|
115
169
|
export type SubEventMessageParseItemText = Text[];
|
|
116
170
|
export type SubEventMessageParseItemImage = Image[];
|
|
117
171
|
export type SubEventMessageParseItemAtUser = AtUser[];
|
|
118
172
|
export type SubEventMessageParse = Array<Array<Text | Image | AtUser>>;
|
|
119
173
|
export interface CardInteraction {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
174
|
+
schema: string;
|
|
175
|
+
header: Header;
|
|
176
|
+
event: Event;
|
|
123
177
|
}
|
|
124
178
|
export interface Header {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
179
|
+
event_id: string;
|
|
180
|
+
token: string;
|
|
181
|
+
create_time: string;
|
|
182
|
+
event_type: string;
|
|
183
|
+
tenant_key: string;
|
|
184
|
+
app_id: string;
|
|
131
185
|
}
|
|
132
186
|
export interface Event {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
187
|
+
operator: Operator;
|
|
188
|
+
token: string;
|
|
189
|
+
action: Action;
|
|
190
|
+
host: string;
|
|
191
|
+
delivery_type: string;
|
|
192
|
+
context: Context;
|
|
139
193
|
}
|
|
140
194
|
export interface Operator {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
195
|
+
tenant_key: string;
|
|
196
|
+
user_id: string;
|
|
197
|
+
open_id: string;
|
|
144
198
|
}
|
|
145
199
|
export interface Action {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
200
|
+
value: Value;
|
|
201
|
+
tag: string;
|
|
202
|
+
form_value: {
|
|
203
|
+
statementIntro: string;
|
|
204
|
+
};
|
|
151
205
|
}
|
|
152
206
|
export interface Value {
|
|
153
|
-
|
|
154
|
-
|
|
207
|
+
actionType: any;
|
|
208
|
+
[key: string]: string;
|
|
155
209
|
}
|
|
156
210
|
export interface Context {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
export interface InteractiveCardActionEvent
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
211
|
+
url: string;
|
|
212
|
+
preview_token: string;
|
|
213
|
+
open_message_id: string;
|
|
214
|
+
open_chat_id: string;
|
|
215
|
+
}
|
|
216
|
+
export interface InteractiveCardActionEvent
|
|
217
|
+
extends lark.InteractiveCardActionEvent,
|
|
218
|
+
CardInteraction {
|
|
219
|
+
context: Context;
|
|
220
|
+
operator: Operator;
|
|
221
|
+
action: Action;
|
|
222
|
+
event_type: 'card.action.trigger';
|
|
167
223
|
}
|
|
168
224
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nest-packages/nestjs-lark-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
],
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"@nestjs/common": "^11.0.0",
|
|
11
|
-
"@nestjs/core": "^11.0.0"
|
|
11
|
+
"@nestjs/core": "^11.0.0",
|
|
12
|
+
"@nest-packages/nestjs-queue-events": "*"
|
|
12
13
|
},
|
|
13
14
|
"scripts": {
|
|
14
15
|
"build": "tsc -p tsconfig.build.json"
|