@nest-packages/nestjs-lark-sdk 0.1.0 → 0.1.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.
- package/dist/bitable-base-field.d.ts +177 -0
- package/dist/bitable-base-field.js +188 -0
- package/dist/bitable-base-field.js.map +1 -0
- package/dist/bitable-base-record.d.ts +211 -0
- package/dist/bitable-base-record.js +276 -0
- package/dist/bitable-base-record.js.map +1 -0
- package/dist/bitable-base.abstract.d.ts +18 -0
- package/dist/bitable-base.abstract.js +68 -0
- package/dist/bitable-base.abstract.js.map +1 -0
- package/dist/contact-base.d.ts +333 -0
- package/dist/contact-base.js +238 -0
- package/dist/contact-base.js.map +1 -0
- package/dist/feishu-base-plus.d.ts +19 -0
- package/dist/feishu-base-plus.js +187 -0
- package/dist/feishu-base-plus.js.map +1 -0
- package/dist/feishu-code.d.ts +22 -0
- package/dist/feishu-code.js +26 -0
- package/dist/feishu-code.js.map +1 -0
- package/dist/feishu.constants.d.ts +2 -0
- package/dist/feishu.constants.js +6 -0
- package/dist/feishu.constants.js.map +1 -0
- package/dist/feishu.utils.d.ts +5 -0
- package/dist/feishu.utils.js +23 -0
- package/dist/feishu.utils.js.map +1 -0
- package/dist/im-base.config.d.ts +3 -0
- package/dist/im-base.config.js +18 -0
- package/dist/im-base.config.js.map +1 -0
- package/dist/im-base.d.ts +96 -0
- package/dist/im-base.js +270 -0
- package/dist/im-base.js.map +1 -0
- package/dist/im-base.type.d.ts +19 -0
- package/dist/im-base.type.js +3 -0
- package/dist/im-base.type.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/nestjs-lark-sdk.module.d.ts +9 -0
- package/dist/nestjs-lark-sdk.module.js +95 -0
- package/dist/nestjs-lark-sdk.module.js.map +1 -0
- package/dist/nestjs-lark-sdk.service.d.ts +2 -0
- package/dist/nestjs-lark-sdk.service.js +17 -0
- package/dist/nestjs-lark-sdk.service.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/type.bitable.d.ts +9 -0
- package/dist/type.bitable.js +3 -0
- package/dist/type.bitable.js.map +1 -0
- package/dist/type.d.ts +63 -0
- package/dist/type.js +3 -0
- package/dist/type.js.map +1 -0
- package/dist/types/index.d.ts +168 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +13 -6
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { CardActionHandler, Client, EventDispatcher } from '@larksuiteoapi/node-sdk';
|
|
2
|
+
import { ModuleMetadata, Type } from '@nestjs/common';
|
|
3
|
+
export type LarkClientParamsType = ConstructorParameters<typeof Client>[0];
|
|
4
|
+
export type LarkEventDispatcherParamsType = ConstructorParameters<typeof EventDispatcher>[0];
|
|
5
|
+
export type LarkClientCardActionHandlerType = ConstructorParameters<typeof CardActionHandler>[0];
|
|
6
|
+
export interface NestjsLarkSdkModuleOptionsFactory {
|
|
7
|
+
createNestjsLarkSdkModuleOptions(): Promise<NestjsLarkSdkModuleOptions> | NestjsLarkSdkModuleOptions;
|
|
8
|
+
}
|
|
9
|
+
export interface NestjsLarkSdkModuleOptions {
|
|
10
|
+
LarkClientParams: LarkClientParamsType;
|
|
11
|
+
LarkEventDispatcherParams?: LarkEventDispatcherParamsType;
|
|
12
|
+
}
|
|
13
|
+
export interface NestjsLarkSdkModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> {
|
|
14
|
+
inject?: any[];
|
|
15
|
+
useClass?: Type<NestjsLarkSdkModuleOptionsFactory>;
|
|
16
|
+
useExisting?: Type<NestjsLarkSdkModuleOptionsFactory>;
|
|
17
|
+
useFactory?: (...args: any[]) => Promise<NestjsLarkSdkModuleOptions> | NestjsLarkSdkModuleOptions;
|
|
18
|
+
}
|
|
19
|
+
import * as lark from '@larksuiteoapi/node-sdk';
|
|
20
|
+
export type EhrEmployeeList = lark.Client['ehr']['employee']['list'];
|
|
21
|
+
export type EhrEmployeeListReturnType = ReturnType<EhrEmployeeList>;
|
|
22
|
+
export type EhrEmployeeListParams = Parameters<EhrEmployeeList>[0]['params'];
|
|
23
|
+
export type EhrEmployeeListDataItems = UnPromise<EhrEmployeeListReturnType>['data']['items'];
|
|
24
|
+
export type BitableAppTableFieldList = lark.Client['bitable']['appTableField']['list'];
|
|
25
|
+
export type BitableAppTableFieldListReturnType = ReturnType<BitableAppTableFieldList>;
|
|
26
|
+
export type BitableAppTableFieldListDataItems = UnPromise<BitableAppTableFieldListReturnType>['data']['items'];
|
|
27
|
+
export type BitableAppTableFieldCreate = lark.Client['bitable']['appTableField']['create'];
|
|
28
|
+
export type appTableFieldCreateData = Parameters<BitableAppTableFieldCreate>[0]['data'];
|
|
29
|
+
export type appTableFieldCreatePath = Parameters<BitableAppTableFieldCreate>[0]['path'];
|
|
30
|
+
export type bitableAppTableCreate = lark.Client['bitable']['appTable']['create'];
|
|
31
|
+
export type appTableCreateData = Parameters<bitableAppTableCreate>[0]['data']['table']['fields'][0];
|
|
32
|
+
export type appTableCreatePath = Parameters<bitableAppTableCreate>[0]['path'];
|
|
33
|
+
export type BitableAppTableFieldCreateReturnTypeDataField = UnPromise<ReturnType<BitableAppTableFieldCreate>>['data']['field'];
|
|
34
|
+
export type typeAppTableRecordCreateFields = Parameters<lark.Client['bitable']['appTableRecord']['create']>[0]['data']['fields'];
|
|
35
|
+
type returnTypeAppTableRecordCreate = ReturnType<lark.Client['bitable']['appTableRecord']['create']>;
|
|
36
|
+
export type UnPromise<T> = T extends Promise<infer R> ? R : any;
|
|
37
|
+
type returnTypeImMessageCreate = ReturnType<lark.Client['im']['message']['create']>;
|
|
38
|
+
export type responseTypeImMessageCreate = UnPromise<returnTypeImMessageCreate>;
|
|
39
|
+
export interface typeFeishuImMessageCreated {
|
|
40
|
+
requestData: any;
|
|
41
|
+
responseData: responseTypeImMessageCreate;
|
|
42
|
+
larkClient?: lark.Client;
|
|
43
|
+
}
|
|
44
|
+
export type responseAppTableRecordCreate = UnPromise<returnTypeAppTableRecordCreate>;
|
|
45
|
+
type returnTypeAppTableRecordList = ReturnType<lark.Client['bitable']['appTableRecord']['list']>;
|
|
46
|
+
export type AppTableRecordApiResponseRecordField = UnPromise<returnTypeAppTableRecordList>;
|
|
47
|
+
export type AppTableRecordRecordField = AppTableRecordApiResponseRecordField['data']['items'][0];
|
|
48
|
+
type returnTypeAppTableFieldList = ReturnType<lark.Client['bitable']['appTableField']['list']>;
|
|
49
|
+
export type appTableFieldApiResponseRecordField = UnPromise<returnTypeAppTableFieldList>;
|
|
50
|
+
export type appTableFieldRecordField = appTableFieldApiResponseRecordField['data']['items'][0];
|
|
51
|
+
export type IMessageRootObject = Parameters<lark.EventHandles['im.message.receive_v1']>[0];
|
|
52
|
+
export type IMessageEvent = Parameters<lark.EventHandles['im.message.receive_v1']>[0]['message'];
|
|
53
|
+
export interface FileToken {
|
|
54
|
+
file_token?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface UploadImage {
|
|
57
|
+
file_name: string;
|
|
58
|
+
parent_type: 'doc_image' | 'docx_image' | 'sheet_image' | 'doc_file' | 'docx_file' | 'sheet_file' | 'vc_virtual_background' | 'bitable_image' | 'bitable_file' | 'moments' | 'ccm_import_open';
|
|
59
|
+
parent_node: string;
|
|
60
|
+
extra?: {
|
|
61
|
+
image_key: string;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export interface Link {
|
|
65
|
+
text?: string;
|
|
66
|
+
link?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface Address {
|
|
69
|
+
location?: string;
|
|
70
|
+
pname?: string;
|
|
71
|
+
cityname?: string;
|
|
72
|
+
adname?: string;
|
|
73
|
+
address?: string;
|
|
74
|
+
name?: string;
|
|
75
|
+
full_address?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface Person {
|
|
78
|
+
id?: string;
|
|
79
|
+
name?: string;
|
|
80
|
+
en_name?: string;
|
|
81
|
+
email?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface Files {
|
|
84
|
+
file_token?: string;
|
|
85
|
+
name?: string;
|
|
86
|
+
type?: string;
|
|
87
|
+
size?: number;
|
|
88
|
+
url?: string;
|
|
89
|
+
tmp_url?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface Text {
|
|
92
|
+
tag: 'text';
|
|
93
|
+
text: string;
|
|
94
|
+
}
|
|
95
|
+
export interface Image {
|
|
96
|
+
tag: 'img';
|
|
97
|
+
image_key: string;
|
|
98
|
+
width: number;
|
|
99
|
+
height: number;
|
|
100
|
+
}
|
|
101
|
+
export interface AtUser {
|
|
102
|
+
tag: 'at';
|
|
103
|
+
user_id: string;
|
|
104
|
+
user_name: string;
|
|
105
|
+
}
|
|
106
|
+
export interface Field {
|
|
107
|
+
field_id: string;
|
|
108
|
+
field_value: string;
|
|
109
|
+
}
|
|
110
|
+
export interface TypeBitablePath {
|
|
111
|
+
app_token: string;
|
|
112
|
+
table_id: string;
|
|
113
|
+
view_id: string;
|
|
114
|
+
}
|
|
115
|
+
export type SubEventMessageParseItemText = Text[];
|
|
116
|
+
export type SubEventMessageParseItemImage = Image[];
|
|
117
|
+
export type SubEventMessageParseItemAtUser = AtUser[];
|
|
118
|
+
export type SubEventMessageParse = Array<Array<Text | Image | AtUser>>;
|
|
119
|
+
export interface CardInteraction {
|
|
120
|
+
schema: string;
|
|
121
|
+
header: Header;
|
|
122
|
+
event: Event;
|
|
123
|
+
}
|
|
124
|
+
export interface Header {
|
|
125
|
+
event_id: string;
|
|
126
|
+
token: string;
|
|
127
|
+
create_time: string;
|
|
128
|
+
event_type: string;
|
|
129
|
+
tenant_key: string;
|
|
130
|
+
app_id: string;
|
|
131
|
+
}
|
|
132
|
+
export interface Event {
|
|
133
|
+
operator: Operator;
|
|
134
|
+
token: string;
|
|
135
|
+
action: Action;
|
|
136
|
+
host: string;
|
|
137
|
+
delivery_type: string;
|
|
138
|
+
context: Context;
|
|
139
|
+
}
|
|
140
|
+
export interface Operator {
|
|
141
|
+
tenant_key: string;
|
|
142
|
+
user_id: string;
|
|
143
|
+
open_id: string;
|
|
144
|
+
}
|
|
145
|
+
export interface Action {
|
|
146
|
+
value: Value;
|
|
147
|
+
tag: string;
|
|
148
|
+
form_value: {
|
|
149
|
+
statementIntro: string;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
export interface Value {
|
|
153
|
+
actionType: any;
|
|
154
|
+
[key: string]: string;
|
|
155
|
+
}
|
|
156
|
+
export interface Context {
|
|
157
|
+
url: string;
|
|
158
|
+
preview_token: string;
|
|
159
|
+
open_message_id: string;
|
|
160
|
+
open_chat_id: string;
|
|
161
|
+
}
|
|
162
|
+
export interface InteractiveCardActionEvent extends lark.InteractiveCardActionEvent, CardInteraction {
|
|
163
|
+
context: Context;
|
|
164
|
+
operator: Operator;
|
|
165
|
+
action: Action;
|
|
166
|
+
event_type: 'card.action.trigger';
|
|
167
|
+
}
|
|
168
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nest-packages/nestjs-lark-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
|
-
"files": [
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
7
9
|
"peerDependencies": {
|
|
8
|
-
"@nestjs/common": "^
|
|
9
|
-
"@nestjs/core": "^
|
|
10
|
+
"@nestjs/common": "^11.0.0",
|
|
11
|
+
"@nestjs/core": "^11.0.0"
|
|
10
12
|
},
|
|
11
13
|
"scripts": {
|
|
12
|
-
"build": "tsc -p tsconfig.
|
|
14
|
+
"build": "tsc -p tsconfig.build.json"
|
|
13
15
|
},
|
|
14
16
|
"publishConfig": {
|
|
15
17
|
"access": "public"
|
|
16
18
|
},
|
|
17
|
-
"license": "MIT"
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@larksuiteoapi/node-sdk": "^1.46.0",
|
|
22
|
+
"axios": "^1.8.4",
|
|
23
|
+
"axios-retry": "^4.5.0"
|
|
24
|
+
}
|
|
18
25
|
}
|