@nest-packages/nestjs-lark-sdk 0.1.0 → 0.1.2

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 (53) hide show
  1. package/dist/bitable-base-field.d.ts +309 -0
  2. package/dist/bitable-base-field.js +320 -0
  3. package/dist/bitable-base-field.js.map +1 -0
  4. package/dist/bitable-base-record.d.ts +214 -0
  5. package/dist/bitable-base-record.js +289 -0
  6. package/dist/bitable-base-record.js.map +1 -0
  7. package/dist/bitable-base.abstract.d.ts +18 -0
  8. package/dist/bitable-base.abstract.js +68 -0
  9. package/dist/bitable-base.abstract.js.map +1 -0
  10. package/dist/contact-base.d.ts +333 -0
  11. package/dist/contact-base.js +239 -0
  12. package/dist/contact-base.js.map +1 -0
  13. package/dist/feishu-base-plus.d.ts +26 -0
  14. package/dist/feishu-base-plus.js +187 -0
  15. package/dist/feishu-base-plus.js.map +1 -0
  16. package/dist/feishu-code.d.ts +22 -0
  17. package/dist/feishu-code.js +26 -0
  18. package/dist/feishu-code.js.map +1 -0
  19. package/dist/feishu.constants.d.ts +2 -0
  20. package/dist/feishu.constants.js +6 -0
  21. package/dist/feishu.constants.js.map +1 -0
  22. package/dist/feishu.utils.d.ts +11 -0
  23. package/dist/feishu.utils.js +23 -0
  24. package/dist/feishu.utils.js.map +1 -0
  25. package/dist/im-base.config.d.ts +3 -0
  26. package/dist/im-base.config.js +18 -0
  27. package/dist/im-base.config.js.map +1 -0
  28. package/dist/im-base.d.ts +140 -0
  29. package/dist/im-base.js +288 -0
  30. package/dist/im-base.js.map +1 -0
  31. package/dist/im-base.type.d.ts +27 -0
  32. package/dist/im-base.type.js +3 -0
  33. package/dist/im-base.type.js.map +1 -0
  34. package/dist/index.d.ts +8 -0
  35. package/dist/index.js +25 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/nestjs-lark-sdk.module.d.ts +24 -0
  38. package/dist/nestjs-lark-sdk.module.js +95 -0
  39. package/dist/nestjs-lark-sdk.module.js.map +1 -0
  40. package/dist/nestjs-lark-sdk.service.d.ts +1 -0
  41. package/dist/nestjs-lark-sdk.service.js +17 -0
  42. package/dist/nestjs-lark-sdk.service.js.map +1 -0
  43. package/dist/tsconfig.build.tsbuildinfo +1 -0
  44. package/dist/type.bitable.d.ts +12 -0
  45. package/dist/type.bitable.js +3 -0
  46. package/dist/type.bitable.js.map +1 -0
  47. package/dist/type.d.ts +68 -0
  48. package/dist/type.js +3 -0
  49. package/dist/type.js.map +1 -0
  50. package/dist/types/index.d.ts +224 -0
  51. package/dist/types/index.js +3 -0
  52. package/dist/types/index.js.map +1 -0
  53. package/package.json +13 -6
@@ -0,0 +1,224 @@
1
+ import {
2
+ CardActionHandler,
3
+ Client,
4
+ EventDispatcher,
5
+ } from '@larksuiteoapi/node-sdk';
6
+ import { ModuleMetadata, Type } from '@nestjs/common';
7
+ export type LarkClientParamsType = ConstructorParameters<typeof Client>[0];
8
+ export type LarkEventDispatcherParamsType = ConstructorParameters<
9
+ typeof EventDispatcher
10
+ >[0];
11
+ export type LarkClientCardActionHandlerType = ConstructorParameters<
12
+ typeof CardActionHandler
13
+ >[0];
14
+ export interface NestjsLarkSdkModuleOptionsFactory {
15
+ createNestjsLarkSdkModuleOptions():
16
+ | Promise<NestjsLarkSdkModuleOptions>
17
+ | NestjsLarkSdkModuleOptions;
18
+ }
19
+ export interface NestjsLarkSdkModuleOptions {
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;
31
+ }
32
+ import * as lark from '@larksuiteoapi/node-sdk';
33
+ export type EhrEmployeeList = lark.Client['ehr']['employee']['list'];
34
+ export type EhrEmployeeListReturnType = ReturnType<EhrEmployeeList>;
35
+ export type EhrEmployeeListParams = Parameters<EhrEmployeeList>[0]['params'];
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];
54
+ export type appTableCreatePath = Parameters<bitableAppTableCreate>[0]['path'];
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
+ >;
64
+ export type UnPromise<T> = T extends Promise<infer R> ? R : any;
65
+ type returnTypeImMessageCreate = ReturnType<
66
+ lark.Client['im']['message']['create']
67
+ >;
68
+ export type responseTypeImMessageCreate = UnPromise<returnTypeImMessageCreate>;
69
+ export interface typeFeishuImMessageCreated {
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'];
96
+ export interface FileToken {
97
+ file_token?: string;
98
+ }
99
+ export interface UploadImage {
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
+ };
117
+ }
118
+ export interface Link {
119
+ text?: string;
120
+ link?: string;
121
+ }
122
+ export interface Address {
123
+ location?: string;
124
+ pname?: string;
125
+ cityname?: string;
126
+ adname?: string;
127
+ address?: string;
128
+ name?: string;
129
+ full_address?: string;
130
+ }
131
+ export interface Person {
132
+ id?: string;
133
+ name?: string;
134
+ en_name?: string;
135
+ email?: string;
136
+ }
137
+ export interface Files {
138
+ file_token?: string;
139
+ name?: string;
140
+ type?: string;
141
+ size?: number;
142
+ url?: string;
143
+ tmp_url?: string;
144
+ }
145
+ export interface Text {
146
+ tag: 'text';
147
+ text: string;
148
+ }
149
+ export interface Image {
150
+ tag: 'img';
151
+ image_key: string;
152
+ width: number;
153
+ height: number;
154
+ }
155
+ export interface AtUser {
156
+ tag: 'at';
157
+ user_id: string;
158
+ user_name: string;
159
+ }
160
+ export interface Field {
161
+ field_id: string;
162
+ field_value: string;
163
+ }
164
+ export interface TypeBitablePath {
165
+ app_token: string;
166
+ table_id: string;
167
+ view_id: string;
168
+ }
169
+ export type SubEventMessageParseItemText = Text[];
170
+ export type SubEventMessageParseItemImage = Image[];
171
+ export type SubEventMessageParseItemAtUser = AtUser[];
172
+ export type SubEventMessageParse = Array<Array<Text | Image | AtUser>>;
173
+ export interface CardInteraction {
174
+ schema: string;
175
+ header: Header;
176
+ event: Event;
177
+ }
178
+ export interface Header {
179
+ event_id: string;
180
+ token: string;
181
+ create_time: string;
182
+ event_type: string;
183
+ tenant_key: string;
184
+ app_id: string;
185
+ }
186
+ export interface Event {
187
+ operator: Operator;
188
+ token: string;
189
+ action: Action;
190
+ host: string;
191
+ delivery_type: string;
192
+ context: Context;
193
+ }
194
+ export interface Operator {
195
+ tenant_key: string;
196
+ user_id: string;
197
+ open_id: string;
198
+ }
199
+ export interface Action {
200
+ value: Value;
201
+ tag: string;
202
+ form_value: {
203
+ statementIntro: string;
204
+ };
205
+ }
206
+ export interface Value {
207
+ actionType: any;
208
+ [key: string]: string;
209
+ }
210
+ export interface Context {
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';
223
+ }
224
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=index.js.map
@@ -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.0",
3
+ "version": "0.1.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
- "files": ["dist"],
6
+ "files": [
7
+ "dist"
8
+ ],
7
9
  "peerDependencies": {
8
- "@nestjs/common": "^10.0.0",
9
- "@nestjs/core": "^10.0.0"
10
+ "@nestjs/common": "^11.0.0",
11
+ "@nestjs/core": "^11.0.0"
10
12
  },
11
13
  "scripts": {
12
- "build": "tsc -p tsconfig.lib.json"
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
  }