@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.
- package/dist/bitable-base-field.d.ts +309 -0
- package/dist/bitable-base-field.js +320 -0
- package/dist/bitable-base-field.js.map +1 -0
- package/dist/bitable-base-record.d.ts +214 -0
- package/dist/bitable-base-record.js +289 -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 +239 -0
- package/dist/contact-base.js.map +1 -0
- package/dist/feishu-base-plus.d.ts +26 -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 +11 -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 +140 -0
- package/dist/im-base.js +288 -0
- package/dist/im-base.js.map +1 -0
- package/dist/im-base.type.d.ts +27 -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 +24 -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 +1 -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 +12 -0
- package/dist/type.bitable.js +3 -0
- package/dist/type.bitable.js.map +1 -0
- package/dist/type.d.ts +68 -0
- package/dist/type.js +3 -0
- package/dist/type.js.map +1 -0
- package/dist/types/index.d.ts +224 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +13 -6
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FeishuBasePlus = void 0;
|
|
4
|
+
const node_sdk_1 = require("@larksuiteoapi/node-sdk");
|
|
5
|
+
const common_1 = require("@nestjs/common");
|
|
6
|
+
const axios_1 = require("axios");
|
|
7
|
+
const axios_retry_1 = require("axios-retry");
|
|
8
|
+
const http = require("http");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
const feishu_code_1 = require("./feishu-code");
|
|
11
|
+
class FeishuBasePlus {
|
|
12
|
+
constructor(larkClientParams, larkClientCardActionHandler) {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
this.logger = new common_1.Logger(FeishuBasePlus.name);
|
|
15
|
+
const appId = larkClientParams.appId;
|
|
16
|
+
const appSecret = larkClientParams.appSecret;
|
|
17
|
+
if (!appId || !appSecret) {
|
|
18
|
+
throw new Error('appId or appSecret is required');
|
|
19
|
+
}
|
|
20
|
+
if ((_a = FeishuBasePlus.instance) === null || _a === void 0 ? void 0 : _a.get(appId)) {
|
|
21
|
+
return (_b = FeishuBasePlus.instance) === null || _b === void 0 ? void 0 : _b.get(appId);
|
|
22
|
+
}
|
|
23
|
+
this.appId = appId;
|
|
24
|
+
this.appSecret = appSecret;
|
|
25
|
+
this.logger.debug(`FeishuBase appId: ${appId}`);
|
|
26
|
+
const verificationToken = larkClientCardActionHandler === null || larkClientCardActionHandler === void 0 ? void 0 : larkClientCardActionHandler.verificationToken;
|
|
27
|
+
const encryptKey = larkClientCardActionHandler === null || larkClientCardActionHandler === void 0 ? void 0 : larkClientCardActionHandler.encryptKey;
|
|
28
|
+
this.verificationToken = verificationToken;
|
|
29
|
+
this.encryptKey = encryptKey;
|
|
30
|
+
this.main();
|
|
31
|
+
FeishuBasePlus.instance.set(appId, this);
|
|
32
|
+
Object.freeze(FeishuBasePlus);
|
|
33
|
+
}
|
|
34
|
+
main() {
|
|
35
|
+
this.initLarkClient();
|
|
36
|
+
this.initEventDispatcher();
|
|
37
|
+
this.initCardDispatcher();
|
|
38
|
+
}
|
|
39
|
+
initLarkClient() {
|
|
40
|
+
const appId = this.appId;
|
|
41
|
+
const appSecret = this.appSecret;
|
|
42
|
+
const logger = this.logger;
|
|
43
|
+
if (!this.larkClient) {
|
|
44
|
+
const httpInstance = axios_1.default.create();
|
|
45
|
+
(0, axios_retry_1.default)(httpInstance, {
|
|
46
|
+
retries: 3,
|
|
47
|
+
onRetry(_retryCount, error, _requestConfig) {
|
|
48
|
+
logger.debug(`onRetry 重试第 ${_retryCount} 次`, error === null || error === void 0 ? void 0 : error.stack, _requestConfig);
|
|
49
|
+
},
|
|
50
|
+
retryCondition: (error) => {
|
|
51
|
+
var _a, _b, _c;
|
|
52
|
+
const code = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.code;
|
|
53
|
+
logger.debug(`retryCondition error?.response?.status ${(_c = error === null || error === void 0 ? void 0 : error.response) === null || _c === void 0 ? void 0 : _c.status} code: ${code}`);
|
|
54
|
+
return (axios_retry_1.default.isNetworkOrIdempotentRequestError(error) ||
|
|
55
|
+
error.code === 'ECONNABORTED' ||
|
|
56
|
+
[
|
|
57
|
+
feishu_code_1.CODE_FREQUENCY_LIMIT,
|
|
58
|
+
feishu_code_1.CODE_FAIL,
|
|
59
|
+
feishu_code_1.DATA_NOT_READY,
|
|
60
|
+
feishu_code_1.CODE_WRITE_CONFLICT,
|
|
61
|
+
feishu_code_1.TooManyRequest,
|
|
62
|
+
].includes(code));
|
|
63
|
+
},
|
|
64
|
+
onMaxRetryTimesExceeded(err, retryCount) {
|
|
65
|
+
logger.debug(`onMaxRetryTimesExceeded 重试总次数 ${retryCount}`);
|
|
66
|
+
},
|
|
67
|
+
retryDelay: (retryCount) => {
|
|
68
|
+
return retryCount * 1000;
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
httpInstance.interceptors.request.use((req) => {
|
|
72
|
+
var _a;
|
|
73
|
+
const requestId = (req.headers['x-request-id'] || (0, uuid_1.v4)()).substring(0, 8);
|
|
74
|
+
if (req.headers) {
|
|
75
|
+
req.headers['User-Agent'] = 'oapi-node-sdk/1.0.0 custom';
|
|
76
|
+
req.headers['x-request-id'] = requestId;
|
|
77
|
+
}
|
|
78
|
+
const { method, url, data, params, headers } = req;
|
|
79
|
+
if (!headers['x-ignore-log']) {
|
|
80
|
+
if (method.toUpperCase() === 'GET') {
|
|
81
|
+
logger.log(`[${requestId}] GET 请求 ${url} 的查询参数:`, params);
|
|
82
|
+
}
|
|
83
|
+
else if (method.toUpperCase() === 'POST') {
|
|
84
|
+
const dataCopy = Object.assign({}, data);
|
|
85
|
+
if (dataCopy['app_secret']) {
|
|
86
|
+
dataCopy['app_secret'] = '***';
|
|
87
|
+
}
|
|
88
|
+
if ((_a = dataCopy['records']) === null || _a === void 0 ? void 0 : _a.length) {
|
|
89
|
+
dataCopy['records'] = [dataCopy['records'][0]];
|
|
90
|
+
}
|
|
91
|
+
logger.log(`[${requestId}] POST 请求 ${url} 的请求体参数:`, dataCopy);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return req;
|
|
95
|
+
}, (error) => {
|
|
96
|
+
var _a;
|
|
97
|
+
logger.error(`interceptors.request.error`, error === null || error === void 0 ? void 0 : error.stack, (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
|
|
98
|
+
}, { synchronous: true });
|
|
99
|
+
httpInstance.interceptors.response.use((response) => {
|
|
100
|
+
var _a, _b, _c, _d;
|
|
101
|
+
if (!((response === null || response === void 0 ? void 0 : response.data) instanceof http.IncomingMessage) &&
|
|
102
|
+
((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.code) !== feishu_code_1.CODE_SUCCESS) {
|
|
103
|
+
const requestId = (_b = response === null || response === void 0 ? void 0 : response.headers) === null || _b === void 0 ? void 0 : _b['x-request-id'];
|
|
104
|
+
const errorData = {
|
|
105
|
+
response: {
|
|
106
|
+
code: (_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.code,
|
|
107
|
+
msg: (_d = response === null || response === void 0 ? void 0 : response.data) === null || _d === void 0 ? void 0 : _d.msg,
|
|
108
|
+
},
|
|
109
|
+
request: {
|
|
110
|
+
url: response.config.url,
|
|
111
|
+
data: response.config.data,
|
|
112
|
+
params: response.config.params,
|
|
113
|
+
requestId: requestId,
|
|
114
|
+
method: response.config.method,
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
logger.error(`FeishuBasePlus 公共请求返回不为 0 [${requestId}]`, errorData);
|
|
118
|
+
}
|
|
119
|
+
return response === null || response === void 0 ? void 0 : response.data;
|
|
120
|
+
}, (error) => {
|
|
121
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
122
|
+
const requestId = (_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b['x-request-id'];
|
|
123
|
+
const response = error === null || error === void 0 ? void 0 : error.response;
|
|
124
|
+
const errorData = {
|
|
125
|
+
request: {
|
|
126
|
+
headers: (_c = error === null || error === void 0 ? void 0 : error.config) === null || _c === void 0 ? void 0 : _c.headers,
|
|
127
|
+
data: (_d = error === null || error === void 0 ? void 0 : error.config) === null || _d === void 0 ? void 0 : _d.data,
|
|
128
|
+
url: (_e = error === null || error === void 0 ? void 0 : error.config) === null || _e === void 0 ? void 0 : _e.url,
|
|
129
|
+
params: (_f = error === null || error === void 0 ? void 0 : error.config) === null || _f === void 0 ? void 0 : _f.params,
|
|
130
|
+
method: (_g = error === null || error === void 0 ? void 0 : error.config) === null || _g === void 0 ? void 0 : _g.method,
|
|
131
|
+
requestId,
|
|
132
|
+
},
|
|
133
|
+
response: {
|
|
134
|
+
data: (_h = response === null || response === void 0 ? void 0 : response.data) === null || _h === void 0 ? void 0 : _h.data,
|
|
135
|
+
code: (_j = response === null || response === void 0 ? void 0 : response.data) === null || _j === void 0 ? void 0 : _j.code,
|
|
136
|
+
msg: (_k = response === null || response === void 0 ? void 0 : response.data) === null || _k === void 0 ? void 0 : _k.msg,
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
logger.error(`interceptors.response.error [${requestId}]`, error === null || error === void 0 ? void 0 : error.stack, (_l = error === null || error === void 0 ? void 0 : error.response) === null || _l === void 0 ? void 0 : _l.data, errorData);
|
|
140
|
+
});
|
|
141
|
+
const client = new node_sdk_1.Client({
|
|
142
|
+
appId,
|
|
143
|
+
appSecret,
|
|
144
|
+
appType: node_sdk_1.AppType.SelfBuild,
|
|
145
|
+
domain: node_sdk_1.Domain.Feishu,
|
|
146
|
+
httpInstance,
|
|
147
|
+
loggerLevel: node_sdk_1.LoggerLevel.error,
|
|
148
|
+
disableTokenCache: false,
|
|
149
|
+
});
|
|
150
|
+
this.larkClient = client;
|
|
151
|
+
this.logger.debug(`${appId} larkClient init success`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
initEventDispatcher() {
|
|
155
|
+
const encryptKey = this.encryptKey;
|
|
156
|
+
const verificationToken = this.verificationToken;
|
|
157
|
+
if (!encryptKey || !verificationToken) {
|
|
158
|
+
this.logger.warn('encryptKey or verificationToken is not set');
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
if (!this.eventDispatcher) {
|
|
162
|
+
this.eventDispatcher = new node_sdk_1.EventDispatcher({
|
|
163
|
+
encryptKey,
|
|
164
|
+
verificationToken,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
initCardDispatcher() {
|
|
169
|
+
const encryptKey = this.encryptKey;
|
|
170
|
+
const verificationToken = this.verificationToken;
|
|
171
|
+
if (!encryptKey || !verificationToken) {
|
|
172
|
+
this.logger.warn('encryptKey or verificationToken is not set');
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (!this.cardDispatcher) {
|
|
176
|
+
this.cardDispatcher = new node_sdk_1.CardActionHandler({
|
|
177
|
+
encryptKey,
|
|
178
|
+
verificationToken,
|
|
179
|
+
}, async (data) => {
|
|
180
|
+
this.logger.log('cardDispatcher', data);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
exports.FeishuBasePlus = FeishuBasePlus;
|
|
186
|
+
FeishuBasePlus.instance = new Map();
|
|
187
|
+
//# sourceMappingURL=feishu-base-plus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feishu-base-plus.js","sourceRoot":"","sources":["../src/feishu-base-plus.ts"],"names":[],"mappings":";;;AAAA,sDAQiC;AACjC,2CAAwC;AACxC,iCAA6C;AAC7C,6CAAqC;AACrC,6BAA6B;AAC7B,+BAAoC;AACpC,+CAOuB;AAOvB,MAAa,cAAc;IAYzB,YACE,gBAAsC,EACtC,2BAA6D;;QAb5C,WAAM,GAAG,IAAI,eAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QAe1D,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC;QACrC,MAAM,SAAS,GAAG,gBAAgB,CAAC,SAAS,CAAC;QAC7C,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,MAAA,cAAc,CAAC,QAAQ,0CAAE,GAAG,CAAC,KAAK,CAAC,EAAE,CAA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IL = 1254002;
|
|
3
|
+
export declare const CODE_WRITE_CONFLICT = 1254291;
|
|
4
|
+
export declare const CODE_RPC_ERROR = 1255002;
|
|
5
|
+
export declare const CODE_IP_DENIED = 99991401;
|
|
6
|
+
export declare const CODE_SUCCESS = 0;
|
|
7
|
+
export declare const CODE_FREQUENCY_LIMIT = 99991400;
|
|
8
|
+
export declare const CODE_FieldNameDuplicated = 1254014;
|
|
9
|
+
export declare const MESSAGE_IS_BEING_SENT = 230049;
|
|
10
|
+
export declare const RecordExceedLimit = 1254103;
|
|
11
|
+
export declare const INTERNAL_ERROR = 1241001;
|
|
12
|
+
export declare const internalError = 2200;
|
|
13
|
+
export declare const CHAT_BEEN_DISSOLVED = 232009;
|
|
14
|
+
export declare const BOT_NOT_IN_CHAT = 232011;
|
|
15
|
+
export declare const FieldNameNotFound = 1254045;
|
|
16
|
+
export declare const RESOURCE_NOT_FOUND = 131005;
|
|
17
|
+
export declare const MESSAGE_HAS_EXPIRED = 230031;
|
|
18
|
+
export declare const NumberFieldConvFail = 1254061;
|
|
19
|
+
export declare const InternalErrorInner = 40003;
|
|
20
|
+
export declare const TooManyRequest = 1254290;
|
|
21
|
+
export declare const UserFieldConvFail = 1254066;
|
|
22
|
+
export declare const TextFieldConvFail = 1254060;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TextFieldConvFail = exports.UserFieldConvFail = exports.TooManyRequest = exports.InternalErrorInner = exports.NumberFieldConvFail = exports.MESSAGE_HAS_EXPIRED = exports.RESOURCE_NOT_FOUND = exports.FieldNameNotFound = exports.BOT_NOT_IN_CHAT = exports.CHAT_BEEN_DISSOLVED = exports.internalError = exports.INTERNAL_ERROR = exports.RecordExceedLimit = exports.MESSAGE_IS_BEING_SENT = exports.CODE_FieldNameDuplicated = exports.CODE_FREQUENCY_LIMIT = exports.CODE_SUCCESS = exports.CODE_IP_DENIED = exports.CODE_RPC_ERROR = exports.CODE_WRITE_CONFLICT = exports.CODE_FAIL = exports.DATA_NOT_READY = void 0;
|
|
4
|
+
exports.DATA_NOT_READY = 1254607;
|
|
5
|
+
exports.CODE_FAIL = 1254002;
|
|
6
|
+
exports.CODE_WRITE_CONFLICT = 1254291;
|
|
7
|
+
exports.CODE_RPC_ERROR = 1255002;
|
|
8
|
+
exports.CODE_IP_DENIED = 99991401;
|
|
9
|
+
exports.CODE_SUCCESS = 0;
|
|
10
|
+
exports.CODE_FREQUENCY_LIMIT = 99991400;
|
|
11
|
+
exports.CODE_FieldNameDuplicated = 1254014;
|
|
12
|
+
exports.MESSAGE_IS_BEING_SENT = 230049;
|
|
13
|
+
exports.RecordExceedLimit = 1254103;
|
|
14
|
+
exports.INTERNAL_ERROR = 1241001;
|
|
15
|
+
exports.internalError = 2200;
|
|
16
|
+
exports.CHAT_BEEN_DISSOLVED = 232009;
|
|
17
|
+
exports.BOT_NOT_IN_CHAT = 232011;
|
|
18
|
+
exports.FieldNameNotFound = 1254045;
|
|
19
|
+
exports.RESOURCE_NOT_FOUND = 131005;
|
|
20
|
+
exports.MESSAGE_HAS_EXPIRED = 230031;
|
|
21
|
+
exports.NumberFieldConvFail = 1254061;
|
|
22
|
+
exports.InternalErrorInner = 40003;
|
|
23
|
+
exports.TooManyRequest = 1254290;
|
|
24
|
+
exports.UserFieldConvFail = 1254066;
|
|
25
|
+
exports.TextFieldConvFail = 1254060;
|
|
26
|
+
//# sourceMappingURL=feishu-code.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feishu-code.js","sourceRoot":"","sources":["../src/feishu-code.ts"],"names":[],"mappings":";;;AAMa,QAAA,cAAc,GAAG,OAAO,CAAC;AAGzB,QAAA,SAAS,GAAG,OAAO,CAAC;AAEpB,QAAA,mBAAmB,GAAG,OAAO,CAAC;AAE9B,QAAA,cAAc,GAAG,OAAO,CAAC;AAEzB,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,YAAY,GAAG,CAAC,CAAC;AAIjB,QAAA,oBAAoB,GAAG,QAAQ,CAAC;AAEhC,QAAA,wBAAwB,GAAG,OAAO,CAAC;AACnC,QAAA,qBAAqB,GAAG,MAAM,CAAC;AAC/B,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAG5B,QAAA,cAAc,GAAG,OAAO,CAAC;AACzB,QAAA,aAAa,GAAG,IAAI,CAAC;AACrB,QAAA,mBAAmB,GAAG,MAAM,CAAC;AAC7B,QAAA,eAAe,GAAG,MAAM,CAAC;AACzB,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAC5B,QAAA,kBAAkB,GAAG,MAAM,CAAC;AAC5B,QAAA,mBAAmB,GAAG,MAAM,CAAC;AAC7B,QAAA,mBAAmB,GAAG,OAAO,CAAC;AAE9B,QAAA,kBAAkB,GAAG,KAAK,CAAC;AAE3B,QAAA,cAAc,GAAG,OAAO,CAAC;AACzB,QAAA,iBAAiB,GAAG,OAAO,CAAC;AAC5B,QAAA,iBAAiB,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MODULE_OPTIONS = exports.MODULE_INSTANCE = void 0;
|
|
4
|
+
exports.MODULE_INSTANCE = Symbol('MODULE_INSTANCE');
|
|
5
|
+
exports.MODULE_OPTIONS = Symbol('MODULE_OPTIONS');
|
|
6
|
+
//# sourceMappingURL=feishu.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feishu.constants.js","sourceRoot":"","sources":["../src/feishu.constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAC5C,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FeishuBasePlus } from './feishu-base-plus';
|
|
2
|
+
import { NestjsLarkSdkModuleOptions } from './types';
|
|
3
|
+
export declare function getFeishuModuleInstanceToken(
|
|
4
|
+
moduleName?: string,
|
|
5
|
+
): string | symbol;
|
|
6
|
+
export declare function getFeishuModuleOptionsToken(
|
|
7
|
+
moduleName?: string,
|
|
8
|
+
): string | symbol;
|
|
9
|
+
export declare function getFeishuModuleInstance(
|
|
10
|
+
options: NestjsLarkSdkModuleOptions,
|
|
11
|
+
): FeishuBasePlus;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFeishuModuleInstanceToken = getFeishuModuleInstanceToken;
|
|
4
|
+
exports.getFeishuModuleOptionsToken = getFeishuModuleOptionsToken;
|
|
5
|
+
exports.getFeishuModuleInstance = getFeishuModuleInstance;
|
|
6
|
+
const feishu_base_plus_1 = require("./feishu-base-plus");
|
|
7
|
+
const feishu_constants_1 = require("./feishu.constants");
|
|
8
|
+
function getFeishuModuleInstanceToken(moduleName) {
|
|
9
|
+
if (moduleName) {
|
|
10
|
+
return `${moduleName}`;
|
|
11
|
+
}
|
|
12
|
+
return feishu_constants_1.MODULE_INSTANCE;
|
|
13
|
+
}
|
|
14
|
+
function getFeishuModuleOptionsToken(moduleName) {
|
|
15
|
+
if (moduleName) {
|
|
16
|
+
return `${moduleName}_options`;
|
|
17
|
+
}
|
|
18
|
+
return feishu_constants_1.MODULE_OPTIONS;
|
|
19
|
+
}
|
|
20
|
+
function getFeishuModuleInstance(options) {
|
|
21
|
+
return new feishu_base_plus_1.FeishuBasePlus(options.LarkClientParams, options.LarkEventDispatcherParams);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=feishu.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feishu.utils.js","sourceRoot":"","sources":["../src/feishu.utils.ts"],"names":[],"mappings":";;AAIA,oEAOC;AAED,kEAOC;AAED,0DAKC;AA3BD,yDAAoD;AACpD,yDAAqE;AAGrE,SAAgB,4BAA4B,CAC1C,UAAmB;IAEnB,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,GAAG,UAAU,EAAE,CAAC;IACzB,CAAC;IACD,OAAO,kCAAe,CAAC;AACzB,CAAC;AAED,SAAgB,2BAA2B,CACzC,UAAmB;IAEnB,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,GAAG,UAAU,UAAU,CAAC;IACjC,CAAC;IACD,OAAO,iCAAc,CAAC;AACxB,CAAC;AAED,SAAgB,uBAAuB,CAAC,OAAmC;IACzE,OAAO,IAAI,iCAAc,CACvB,OAAO,CAAC,gBAAgB,EACxB,OAAO,CAAC,yBAAyB,CAClC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.imChatCreateParamsDefault = exports.imChatCreateDataDefault = void 0;
|
|
4
|
+
exports.imChatCreateDataDefault = {
|
|
5
|
+
avatar: 'default-avatar_44ae0ca3-e140-494b-956f-78091e348435',
|
|
6
|
+
description: '内部客户沟通群',
|
|
7
|
+
chat_mode: 'group',
|
|
8
|
+
chat_type: 'private',
|
|
9
|
+
external: false,
|
|
10
|
+
join_message_visibility: 'all_members',
|
|
11
|
+
leave_message_visibility: 'all_members',
|
|
12
|
+
membership_approval: 'no_approval_required',
|
|
13
|
+
};
|
|
14
|
+
exports.imChatCreateParamsDefault = {
|
|
15
|
+
user_id_type: 'open_id',
|
|
16
|
+
set_bot_manager: true,
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=im-base.config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"im-base.config.js","sourceRoot":"","sources":["../src/im-base.config.ts"],"names":[],"mappings":";;;AAGa,QAAA,uBAAuB,GAAyB;IAE3D,MAAM,EAAE,qDAAqD;IAC7D,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,KAAK;IACf,uBAAuB,EAAE,aAAa;IACtC,wBAAwB,EAAE,aAAa;IACvC,mBAAmB,EAAE,sBAAsB;CAC5C,CAAC;AACW,QAAA,yBAAyB,GAA2B;IAC/D,YAAY,EAAE,SAAS;IACvB,eAAe,EAAE,IAAI;CAEtB,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Logger } from '@nestjs/common';
|
|
2
|
+
import { FeishuBasePlus } from './feishu-base-plus';
|
|
3
|
+
import { imChatCreateDataType, imChatCreateParamsType, imMessageCreateByCardPayloadType, imMessagePatchPayloadType, imMessageUpdateByCardPayloadType } from './im-base.type';
|
|
4
|
+
export declare class ImBase {
|
|
5
|
+
readonly logger: Logger;
|
|
6
|
+
feishuBaseInstance: FeishuBasePlus;
|
|
7
|
+
constructor(feishuBaseInstance: FeishuBasePlus);
|
|
8
|
+
getImMessageList(container_id: string, start_time: number): Promise<any[]>;
|
|
9
|
+
getImChatList(): Promise<{
|
|
10
|
+
chat_id?: string | undefined;
|
|
11
|
+
avatar?: string | undefined;
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
description?: string | undefined;
|
|
14
|
+
owner_id?: string | undefined;
|
|
15
|
+
owner_id_type?: string | undefined;
|
|
16
|
+
external?: boolean | undefined;
|
|
17
|
+
tenant_key?: string | undefined;
|
|
18
|
+
labels?: string[] | undefined;
|
|
19
|
+
chat_status?: "normal" | "dissolved" | "dissolved_save" | undefined;
|
|
20
|
+
}[]>;
|
|
21
|
+
chatCreate(imChatCreateData: imChatCreateDataType, imChatCreateParams: imChatCreateParamsType): Promise<{
|
|
22
|
+
code?: number | undefined;
|
|
23
|
+
msg?: string | undefined;
|
|
24
|
+
data?: {
|
|
25
|
+
chat_id?: string | undefined;
|
|
26
|
+
avatar?: string | undefined;
|
|
27
|
+
name?: string | undefined;
|
|
28
|
+
description?: string | undefined;
|
|
29
|
+
i18n_names?: {
|
|
30
|
+
zh_cn?: string | undefined;
|
|
31
|
+
en_us?: string | undefined;
|
|
32
|
+
ja_jp?: string | undefined;
|
|
33
|
+
} | undefined;
|
|
34
|
+
owner_id?: string | undefined;
|
|
35
|
+
owner_id_type?: string | undefined;
|
|
36
|
+
urgent_setting?: "all_members" | "only_owner" | undefined;
|
|
37
|
+
video_conference_setting?: "all_members" | "only_owner" | undefined;
|
|
38
|
+
pin_manage_setting?: "all_members" | "only_owner" | undefined;
|
|
39
|
+
add_member_permission?: string | undefined;
|
|
40
|
+
share_card_permission?: string | undefined;
|
|
41
|
+
at_all_permission?: string | undefined;
|
|
42
|
+
edit_permission?: string | undefined;
|
|
43
|
+
group_message_type?: string | undefined;
|
|
44
|
+
chat_mode?: string | undefined;
|
|
45
|
+
chat_type?: string | undefined;
|
|
46
|
+
chat_tag?: string | undefined;
|
|
47
|
+
external?: boolean | undefined;
|
|
48
|
+
tenant_key?: string | undefined;
|
|
49
|
+
join_message_visibility?: string | undefined;
|
|
50
|
+
leave_message_visibility?: string | undefined;
|
|
51
|
+
membership_approval?: string | undefined;
|
|
52
|
+
moderation_permission?: string | undefined;
|
|
53
|
+
labels?: string[] | undefined;
|
|
54
|
+
toolkit_ids?: string[] | undefined;
|
|
55
|
+
restricted_mode_setting?: {
|
|
56
|
+
status?: boolean | undefined;
|
|
57
|
+
screenshot_has_permission_setting?: "all_members" | "not_anyone" | undefined;
|
|
58
|
+
download_has_permission_setting?: "all_members" | "not_anyone" | undefined;
|
|
59
|
+
message_has_permission_setting?: "all_members" | "not_anyone" | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
hide_member_count_setting?: "all_members" | "only_owner" | undefined;
|
|
62
|
+
} | undefined;
|
|
63
|
+
}>;
|
|
64
|
+
getChatLink(chatId: string): Promise<{
|
|
65
|
+
code?: number | undefined;
|
|
66
|
+
msg?: string | undefined;
|
|
67
|
+
data?: {
|
|
68
|
+
share_link?: string | undefined;
|
|
69
|
+
expire_time?: string | undefined;
|
|
70
|
+
is_permanent?: boolean | undefined;
|
|
71
|
+
} | undefined;
|
|
72
|
+
}>;
|
|
73
|
+
getGroupMemberList(chatId: string, member_id_type?: 'user_id' | 'union_id' | 'open_id'): Promise<{
|
|
74
|
+
member_id_type?: string | undefined;
|
|
75
|
+
member_id?: string | undefined;
|
|
76
|
+
name?: string | undefined;
|
|
77
|
+
tenant_key?: string | undefined;
|
|
78
|
+
}[]>;
|
|
79
|
+
getUserByMobile(mobiles: string[]): Promise<{
|
|
80
|
+
union_id: string;
|
|
81
|
+
nickname: string;
|
|
82
|
+
name: string;
|
|
83
|
+
mobile: string;
|
|
84
|
+
user_id: string;
|
|
85
|
+
open_id: string;
|
|
86
|
+
}[]>;
|
|
87
|
+
batchUser(user_ids: string[], user_id_type?: 'open_id' | 'union_id' | 'user_id'): Promise<{
|
|
88
|
+
union_id: string;
|
|
89
|
+
nickname: string;
|
|
90
|
+
name: string;
|
|
91
|
+
mobile: string;
|
|
92
|
+
user_id: string;
|
|
93
|
+
open_id: string;
|
|
94
|
+
}[]>;
|
|
95
|
+
getUuid(content: string | object): string;
|
|
96
|
+
sendFeishuMessage(title: string, content: string, messageReceiveList: string[], type?: 'error' | 'info' | 'warn'): Promise<void>;
|
|
97
|
+
createByCard(payload: imMessageCreateByCardPayloadType): Promise<{
|
|
98
|
+
code?: number | undefined;
|
|
99
|
+
msg?: string | undefined;
|
|
100
|
+
data?: {
|
|
101
|
+
message_id?: string | undefined;
|
|
102
|
+
root_id?: string | undefined;
|
|
103
|
+
parent_id?: string | undefined;
|
|
104
|
+
thread_id?: string | undefined;
|
|
105
|
+
msg_type?: string | undefined;
|
|
106
|
+
create_time?: string | undefined;
|
|
107
|
+
update_time?: string | undefined;
|
|
108
|
+
deleted?: boolean | undefined;
|
|
109
|
+
updated?: boolean | undefined;
|
|
110
|
+
chat_id?: string | undefined;
|
|
111
|
+
sender?: {
|
|
112
|
+
id: string;
|
|
113
|
+
id_type: string;
|
|
114
|
+
sender_type: string;
|
|
115
|
+
tenant_key?: string | undefined;
|
|
116
|
+
} | undefined;
|
|
117
|
+
body?: {
|
|
118
|
+
content: string;
|
|
119
|
+
} | undefined;
|
|
120
|
+
mentions?: {
|
|
121
|
+
key: string;
|
|
122
|
+
id: string;
|
|
123
|
+
id_type: string;
|
|
124
|
+
name: string;
|
|
125
|
+
tenant_key?: string | undefined;
|
|
126
|
+
}[] | undefined;
|
|
127
|
+
upper_message_id?: string | undefined;
|
|
128
|
+
} | undefined;
|
|
129
|
+
}>;
|
|
130
|
+
patch(payload: imMessagePatchPayloadType): Promise<{
|
|
131
|
+
code?: number | undefined;
|
|
132
|
+
msg?: string | undefined;
|
|
133
|
+
data?: {} | undefined;
|
|
134
|
+
}>;
|
|
135
|
+
updateByCard(payload: imMessageUpdateByCardPayloadType): Promise<{
|
|
136
|
+
code?: number | undefined;
|
|
137
|
+
msg?: string | undefined;
|
|
138
|
+
data?: {} | undefined;
|
|
139
|
+
}>;
|
|
140
|
+
}
|