lansenger-sdk-ts 1.0.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/LICENSE +21 -0
- package/README.fr.md +501 -0
- package/README.md +504 -0
- package/README.zhHans.md +501 -0
- package/README.zhHant.md +501 -0
- package/README.zhHantHK.md +501 -0
- package/dist/accountMessages.d.ts +12 -0
- package/dist/accountMessages.js +41 -0
- package/dist/auth.d.ts +13 -0
- package/dist/auth.js +70 -0
- package/dist/calendars.d.ts +84 -0
- package/dist/calendars.js +278 -0
- package/dist/callbacks.d.ts +384 -0
- package/dist/callbacks.js +712 -0
- package/dist/chats.d.ts +22 -0
- package/dist/chats.js +88 -0
- package/dist/client.d.ts +439 -0
- package/dist/client.js +712 -0
- package/dist/config.d.ts +14 -0
- package/dist/config.js +42 -0
- package/dist/constants.d.ts +30 -0
- package/dist/constants.js +187 -0
- package/dist/contacts.d.ts +38 -0
- package/dist/contacts.js +161 -0
- package/dist/departments.d.ts +18 -0
- package/dist/departments.js +69 -0
- package/dist/exceptions.d.ts +20 -0
- package/dist/exceptions.js +42 -0
- package/dist/groupMessages.d.ts +11 -0
- package/dist/groupMessages.js +39 -0
- package/dist/groups.d.ts +66 -0
- package/dist/groups.js +218 -0
- package/dist/http.d.ts +7 -0
- package/dist/http.js +67 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +189 -0
- package/dist/media.d.ts +16 -0
- package/dist/media.js +178 -0
- package/dist/models.d.ts +925 -0
- package/dist/models.js +991 -0
- package/dist/oauth.d.ts +17 -0
- package/dist/oauth.js +107 -0
- package/dist/persistence.d.ts +26 -0
- package/dist/persistence.js +210 -0
- package/dist/reminders.d.ts +10 -0
- package/dist/reminders.js +31 -0
- package/dist/streaming.d.ts +9 -0
- package/dist/streaming.js +40 -0
- package/dist/todos.d.ts +75 -0
- package/dist/todos.js +282 -0
- package/dist/urlHelpers.d.ts +7 -0
- package/dist/urlHelpers.js +22 -0
- package/dist/userMessages.d.ts +8 -0
- package/dist/userMessages.js +34 -0
- package/dist/users.d.ts +6 -0
- package/dist/users.js +32 -0
- package/package.json +33 -0
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class LansengerConfig {
|
|
2
|
+
app_id: string;
|
|
3
|
+
app_secret: string;
|
|
4
|
+
api_gateway_url: string;
|
|
5
|
+
passport_url: string;
|
|
6
|
+
http_timeout: number;
|
|
7
|
+
encoding_key: string;
|
|
8
|
+
callback_token: string;
|
|
9
|
+
constructor(app_id: string, app_secret: string, api_gateway_url?: string, passport_url?: string, http_timeout?: number, encoding_key?: string, callback_token?: string);
|
|
10
|
+
static create(app_id?: string, app_secret?: string, api_gateway_url?: string, passport_url?: string, http_timeout?: number, encoding_key?: string, callback_token?: string): LansengerConfig;
|
|
11
|
+
static fromEnv(): LansengerConfig;
|
|
12
|
+
isConfigured(): boolean;
|
|
13
|
+
hasPassportUrl(): boolean;
|
|
14
|
+
}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LansengerConfig = void 0;
|
|
4
|
+
const exceptions_1 = require("./exceptions");
|
|
5
|
+
const DEFAULT_API_GATEWAY_URL = "https://open.e.lanxin.cn/open/apigw";
|
|
6
|
+
class LansengerConfig {
|
|
7
|
+
constructor(app_id, app_secret, api_gateway_url = DEFAULT_API_GATEWAY_URL, passport_url = "", http_timeout = 30.0, encoding_key = "", callback_token = "") {
|
|
8
|
+
this.app_id = app_id;
|
|
9
|
+
this.app_secret = app_secret;
|
|
10
|
+
this.api_gateway_url = api_gateway_url;
|
|
11
|
+
this.passport_url = passport_url;
|
|
12
|
+
this.http_timeout = http_timeout;
|
|
13
|
+
this.encoding_key = encoding_key;
|
|
14
|
+
this.callback_token = callback_token;
|
|
15
|
+
}
|
|
16
|
+
static create(app_id, app_secret, api_gateway_url, passport_url, http_timeout, encoding_key, callback_token) {
|
|
17
|
+
const resolved_app_id = app_id || (process.env.LANSENGER_APP_ID || "").trim();
|
|
18
|
+
const resolved_app_secret = app_secret || (process.env.LANSENGER_APP_SECRET || "").trim();
|
|
19
|
+
const resolved_gateway = api_gateway_url || (process.env.LANSENGER_API_GATEWAY_URL || DEFAULT_API_GATEWAY_URL).trim();
|
|
20
|
+
const resolved_passport = passport_url || (process.env.LANSENGER_PASSPORT_URL || "").trim();
|
|
21
|
+
const resolved_timeout = http_timeout || 30.0;
|
|
22
|
+
const resolved_encoding_key = encoding_key || (process.env.LANSENGER_ENCODING_KEY || "").trim();
|
|
23
|
+
const resolved_callback_token = callback_token || (process.env.LANSENGER_CALLBACK_TOKEN || "").trim();
|
|
24
|
+
if (!resolved_app_id || !resolved_app_secret) {
|
|
25
|
+
throw new exceptions_1.LansengerConfigError("Lansenger credentials not configured. " +
|
|
26
|
+
"Set LANSENGER_APP_ID and LANSENGER_APP_SECRET env vars, " +
|
|
27
|
+
"or pass app_id/app_secret directly.");
|
|
28
|
+
}
|
|
29
|
+
return new LansengerConfig(resolved_app_id, resolved_app_secret, resolved_gateway, resolved_passport, resolved_timeout, resolved_encoding_key, resolved_callback_token);
|
|
30
|
+
}
|
|
31
|
+
static fromEnv() {
|
|
32
|
+
return LansengerConfig.create();
|
|
33
|
+
}
|
|
34
|
+
isConfigured() {
|
|
35
|
+
return Boolean(this.app_id && this.app_secret);
|
|
36
|
+
}
|
|
37
|
+
hasPassportUrl() {
|
|
38
|
+
return Boolean(this.passport_url);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.LansengerConfig = LansengerConfig;
|
|
42
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const API_ENDPOINTS: Record<string, Record<string, string>>;
|
|
2
|
+
export declare const OAUTH2_SCOPE_BASIC_USER_INFO = "basic_userinfor";
|
|
3
|
+
export declare const OAUTH2_SCOPES: Record<string, string>;
|
|
4
|
+
export declare const MEDIA_TYPE_VIDEO = 1;
|
|
5
|
+
export declare const MEDIA_TYPE_IMAGE = 2;
|
|
6
|
+
export declare const MEDIA_TYPE_FILE = 3;
|
|
7
|
+
export declare const MEDIA_TYPE_AUDIO = 4;
|
|
8
|
+
export declare const APP_MEDIA_TYPE_FILE = "file";
|
|
9
|
+
export declare const APP_MEDIA_TYPE_VIDEO = "video";
|
|
10
|
+
export declare const APP_MEDIA_TYPE_IMAGE = "image";
|
|
11
|
+
export declare const APP_MEDIA_TYPE_AUDIO = "audio";
|
|
12
|
+
export declare const IMAGE_EXTENSIONS: Set<string>;
|
|
13
|
+
export declare const VIDEO_EXTENSIONS: Set<string>;
|
|
14
|
+
export declare const AUDIO_EXTENSIONS: Set<string>;
|
|
15
|
+
export declare const MAX_MESSAGE_LENGTH = 4000;
|
|
16
|
+
export declare const TOKEN_REFRESH_MARGIN = 300;
|
|
17
|
+
export declare const TODO_TODO_STATUS_PENDING_READ = "11";
|
|
18
|
+
export declare const TODO_TODO_STATUS_READ = "12";
|
|
19
|
+
export declare const TODO_TODO_STATUS_PENDING_DO = "21";
|
|
20
|
+
export declare const TODO_TODO_STATUS_DONE = "22";
|
|
21
|
+
export declare const TODO_TYPE_NOTIFICATION = 1;
|
|
22
|
+
export declare const TODO_TYPE_APPROVAL = 2;
|
|
23
|
+
export declare const REMINDER_TYPE_NONE = 0;
|
|
24
|
+
export declare const REMINDER_TYPE_POPUP = 1;
|
|
25
|
+
export declare const REMINDER_TYPE_SMS = 2;
|
|
26
|
+
export declare const REMINDER_TYPE_PHONE = 3;
|
|
27
|
+
export declare const CALLBACK_EVENT_TYPES: Record<string, string>;
|
|
28
|
+
export declare function guessMediaType(filePath: string): number;
|
|
29
|
+
export declare function guessAppMediaType(filePath: string): string;
|
|
30
|
+
export declare const VERSION = "1.4.1";
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VERSION = exports.CALLBACK_EVENT_TYPES = exports.REMINDER_TYPE_PHONE = exports.REMINDER_TYPE_SMS = exports.REMINDER_TYPE_POPUP = exports.REMINDER_TYPE_NONE = exports.TODO_TYPE_APPROVAL = exports.TODO_TYPE_NOTIFICATION = exports.TODO_TODO_STATUS_DONE = exports.TODO_TODO_STATUS_PENDING_DO = exports.TODO_TODO_STATUS_READ = exports.TODO_TODO_STATUS_PENDING_READ = exports.TOKEN_REFRESH_MARGIN = exports.MAX_MESSAGE_LENGTH = exports.AUDIO_EXTENSIONS = exports.VIDEO_EXTENSIONS = exports.IMAGE_EXTENSIONS = exports.APP_MEDIA_TYPE_AUDIO = exports.APP_MEDIA_TYPE_IMAGE = exports.APP_MEDIA_TYPE_VIDEO = exports.APP_MEDIA_TYPE_FILE = exports.MEDIA_TYPE_AUDIO = exports.MEDIA_TYPE_FILE = exports.MEDIA_TYPE_IMAGE = exports.MEDIA_TYPE_VIDEO = exports.OAUTH2_SCOPES = exports.OAUTH2_SCOPE_BASIC_USER_INFO = exports.API_ENDPOINTS = void 0;
|
|
4
|
+
exports.guessMediaType = guessMediaType;
|
|
5
|
+
exports.guessAppMediaType = guessAppMediaType;
|
|
6
|
+
exports.API_ENDPOINTS = {
|
|
7
|
+
auth: {
|
|
8
|
+
tenant_access_token: "/auth/v3/tenant_access_token/internal",
|
|
9
|
+
},
|
|
10
|
+
app_token: {
|
|
11
|
+
create: "/v1/apptoken/create",
|
|
12
|
+
},
|
|
13
|
+
oauth2: {
|
|
14
|
+
authorize: "/oauth2/authorize",
|
|
15
|
+
user_token_create: "/v2/user_token/create",
|
|
16
|
+
refresh_token_create: "/v1/refresh_token/create",
|
|
17
|
+
},
|
|
18
|
+
users: {
|
|
19
|
+
fetch: "/v1/users/fetch",
|
|
20
|
+
},
|
|
21
|
+
staffs: {
|
|
22
|
+
fetch: "/v1/staffs/{staff_id}/fetch",
|
|
23
|
+
detail_fetch: "/v1/staffs/{staff_id}/infor/fetch",
|
|
24
|
+
department_ancestors: "/v1/staffs/{staff_id}/departmentancestors/fetch",
|
|
25
|
+
id_mapping: "/v2/staffs/id_mapping/fetch",
|
|
26
|
+
search: "/v2/staffs/search",
|
|
27
|
+
},
|
|
28
|
+
departments: {
|
|
29
|
+
fetch: "/v1/departments/{department_id}/fetch",
|
|
30
|
+
children_fetch: "/v1/departments/{department_id}/children/fetch",
|
|
31
|
+
staffs_fetch: "/v1/departments/{department_id}/staffs/fetch",
|
|
32
|
+
},
|
|
33
|
+
org: {
|
|
34
|
+
fetch: "/v1/org/{org_id}/fetch",
|
|
35
|
+
extra_field_ids: "/v1/org/{org_id}/extrafieldids/fetch",
|
|
36
|
+
},
|
|
37
|
+
websocket: {
|
|
38
|
+
endpoint: "/v1/ws/endpoint/create",
|
|
39
|
+
},
|
|
40
|
+
smart_bot: {
|
|
41
|
+
private_message: "/v1/bot/messages/create",
|
|
42
|
+
group_message: "/v1/messages/group/create",
|
|
43
|
+
},
|
|
44
|
+
account_message: {
|
|
45
|
+
create: "/v1/messages/create",
|
|
46
|
+
},
|
|
47
|
+
user_message: {
|
|
48
|
+
create: "/v1/messages/chat/create",
|
|
49
|
+
},
|
|
50
|
+
bot: {
|
|
51
|
+
message_create: "/v1/bot/messages/create",
|
|
52
|
+
},
|
|
53
|
+
sse: {
|
|
54
|
+
msg_create: "/v1/sse/msg/create",
|
|
55
|
+
msg_fetch: "/v1/sse/msg/fetch",
|
|
56
|
+
},
|
|
57
|
+
media: {
|
|
58
|
+
create: "/v1/medias/create",
|
|
59
|
+
app_create: "/v1/app/medias/create",
|
|
60
|
+
fetch: "/v1/medias/{media_id}/fetch",
|
|
61
|
+
path_fetch: "/v1/medias/{media_id}/path/fetch",
|
|
62
|
+
},
|
|
63
|
+
message: {
|
|
64
|
+
revoke: "/v1/messages/revoke",
|
|
65
|
+
dynamic_update: "/v1/messages/dynamic/update",
|
|
66
|
+
reminder_create: "/v1/messages/reminder/create",
|
|
67
|
+
},
|
|
68
|
+
groups: {
|
|
69
|
+
fetch: "/v2/groups/fetch",
|
|
70
|
+
},
|
|
71
|
+
groups_v2: {
|
|
72
|
+
create: "/v2/groups/create",
|
|
73
|
+
info_fetch: "/v2/groups/{group_id}/info/fetch",
|
|
74
|
+
info_update: "/v2/groups/{group_id}/info/update",
|
|
75
|
+
members_fetch: "/v2/groups/{group_id}/members/fetch",
|
|
76
|
+
members_update: "/v2/groups/{group_id}/members/update",
|
|
77
|
+
groups_fetch: "/v2/groups/fetch",
|
|
78
|
+
is_in_group: "/v2/groups/{group_id}/members/is_in_group",
|
|
79
|
+
delete: "/v2/groups/{group_id}/delete",
|
|
80
|
+
share_create: "/v2/groups/{group_id}/share/create",
|
|
81
|
+
},
|
|
82
|
+
chats: {
|
|
83
|
+
fetch: "/v1/chats/fetch",
|
|
84
|
+
messages_fetch: "/v1/messages/fetch",
|
|
85
|
+
},
|
|
86
|
+
calendars: {
|
|
87
|
+
primary: "/v1/calendars/primary",
|
|
88
|
+
schedule_create: "/v1/calendars/{calendar_id}/schedules/create",
|
|
89
|
+
schedule_fetch: "/v1/calendars/{calendar_id}/schedules/{schedule_id}/fetch",
|
|
90
|
+
schedule_update: "/v1/calendars/{calendar_id}/schedules/{schedule_id}/update",
|
|
91
|
+
schedule_delete: "/v1/calendars/{calendar_id}/schedules/{schedule_id}/delete",
|
|
92
|
+
schedule_list: "/v1/calendars/{calendar_id}/schedules/fetch",
|
|
93
|
+
attendees_fetch: "/v1/calendars/{calendar_id}/schedules/{schedule_id}/members/fetch",
|
|
94
|
+
attendees_create: "/v1/calendars/{calendar_id}/schedules/{schedule_id}/members/create",
|
|
95
|
+
attendees_delete: "/v1/calendars/{calendar_id}/schedules/{schedule_id}/members/delete",
|
|
96
|
+
attendees_meta_update: "/v1/calendars/{calendar_id}/schedules/{schedule_id}/members/meta/update",
|
|
97
|
+
},
|
|
98
|
+
todo: {
|
|
99
|
+
create: "/xtra/task/unified/v1/todotask/create",
|
|
100
|
+
info_update: "/xtra/task/unified/v1/todotask/info/update",
|
|
101
|
+
status_update: "/xtra/task/unified/v1/todotask/status/update",
|
|
102
|
+
sender_delete: "/xtra/task/unified/v1/sender/todotask/delete",
|
|
103
|
+
list_fetch: "/xtra/task/unified/v1/todotask/list/fetch",
|
|
104
|
+
info_fetch_by_source_id: "/xtra/task/unified/v1/todotask/info/fetchbysourceid",
|
|
105
|
+
info_fetch: "/xtra/task/unified/v1/todotask/info/fetch",
|
|
106
|
+
status_count_list_fetch: "/xtra/task/unified/v1/todotask/status/countList/fetch",
|
|
107
|
+
executor_status_update: "/xtra/task/unified/v1/todotask/executor/status/update",
|
|
108
|
+
executor_create: "/xtra/task/unified/v1/todotask/executor/create",
|
|
109
|
+
executor_delete: "/xtra/task/unified/v1/todotask/executor/delete",
|
|
110
|
+
executor_list_fetch: "/xtra/task/unified/v1/todotask/executor/list/fetch",
|
|
111
|
+
staff_application_fetch: "/xtra/task/unified/v1/staff/application/fetch",
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
exports.OAUTH2_SCOPE_BASIC_USER_INFO = "basic_userinfor";
|
|
115
|
+
exports.OAUTH2_SCOPES = {
|
|
116
|
+
basic_user_info: exports.OAUTH2_SCOPE_BASIC_USER_INFO,
|
|
117
|
+
};
|
|
118
|
+
exports.MEDIA_TYPE_VIDEO = 1;
|
|
119
|
+
exports.MEDIA_TYPE_IMAGE = 2;
|
|
120
|
+
exports.MEDIA_TYPE_FILE = 3;
|
|
121
|
+
exports.MEDIA_TYPE_AUDIO = 4;
|
|
122
|
+
exports.APP_MEDIA_TYPE_FILE = "file";
|
|
123
|
+
exports.APP_MEDIA_TYPE_VIDEO = "video";
|
|
124
|
+
exports.APP_MEDIA_TYPE_IMAGE = "image";
|
|
125
|
+
exports.APP_MEDIA_TYPE_AUDIO = "audio";
|
|
126
|
+
exports.IMAGE_EXTENSIONS = new Set([".jpg", ".jpeg", ".png", ".webp", ".gif"]);
|
|
127
|
+
exports.VIDEO_EXTENSIONS = new Set([".mp4", ".mov", ".avi", ".mkv", ".webm", ".3gp"]);
|
|
128
|
+
exports.AUDIO_EXTENSIONS = new Set([".mp3", ".wav", ".amr", ".m4a", ".ogg", ".flac", ".aac"]);
|
|
129
|
+
exports.MAX_MESSAGE_LENGTH = 4000;
|
|
130
|
+
exports.TOKEN_REFRESH_MARGIN = 300;
|
|
131
|
+
exports.TODO_TODO_STATUS_PENDING_READ = "11";
|
|
132
|
+
exports.TODO_TODO_STATUS_READ = "12";
|
|
133
|
+
exports.TODO_TODO_STATUS_PENDING_DO = "21";
|
|
134
|
+
exports.TODO_TODO_STATUS_DONE = "22";
|
|
135
|
+
exports.TODO_TYPE_NOTIFICATION = 1;
|
|
136
|
+
exports.TODO_TYPE_APPROVAL = 2;
|
|
137
|
+
exports.REMINDER_TYPE_NONE = 0;
|
|
138
|
+
exports.REMINDER_TYPE_POPUP = 1;
|
|
139
|
+
exports.REMINDER_TYPE_SMS = 2;
|
|
140
|
+
exports.REMINDER_TYPE_PHONE = 3;
|
|
141
|
+
exports.CALLBACK_EVENT_TYPES = {
|
|
142
|
+
account_subscribe: "public_account",
|
|
143
|
+
account_unsubscribe: "public_account",
|
|
144
|
+
account_message: "public_account",
|
|
145
|
+
staff_info: "staff",
|
|
146
|
+
staff_modify: "staff",
|
|
147
|
+
staff_create: "staff",
|
|
148
|
+
staff_delete: "staff",
|
|
149
|
+
telephone_track: "telephone_track",
|
|
150
|
+
dept_create: "department",
|
|
151
|
+
dept_modify: "department",
|
|
152
|
+
dept_delete: "department",
|
|
153
|
+
tag_member: "tag",
|
|
154
|
+
app_install_org: "application",
|
|
155
|
+
app_uninstall_org: "application",
|
|
156
|
+
bot_private_message: "bot",
|
|
157
|
+
bot_group_message: "bot",
|
|
158
|
+
group_create_approve: "group",
|
|
159
|
+
ua_cert_create: "ua_cert",
|
|
160
|
+
ua_cert_delete: "ua_cert",
|
|
161
|
+
report_location: "location",
|
|
162
|
+
user_logout: "user",
|
|
163
|
+
data_scope: "data_scope",
|
|
164
|
+
wb_visible_config: "workbench",
|
|
165
|
+
schedule_modify: "schedule",
|
|
166
|
+
schedule_delete: "schedule",
|
|
167
|
+
};
|
|
168
|
+
function guessMediaType(filePath) {
|
|
169
|
+
const ext = filePath.substring(filePath.lastIndexOf(".")).toLowerCase();
|
|
170
|
+
if (exports.IMAGE_EXTENSIONS.has(ext))
|
|
171
|
+
return exports.MEDIA_TYPE_IMAGE;
|
|
172
|
+
if (exports.VIDEO_EXTENSIONS.has(ext))
|
|
173
|
+
return exports.MEDIA_TYPE_VIDEO;
|
|
174
|
+
return exports.MEDIA_TYPE_FILE;
|
|
175
|
+
}
|
|
176
|
+
function guessAppMediaType(filePath) {
|
|
177
|
+
const ext = filePath.substring(filePath.lastIndexOf(".")).toLowerCase();
|
|
178
|
+
if (exports.IMAGE_EXTENSIONS.has(ext))
|
|
179
|
+
return exports.APP_MEDIA_TYPE_IMAGE;
|
|
180
|
+
if (exports.VIDEO_EXTENSIONS.has(ext))
|
|
181
|
+
return exports.APP_MEDIA_TYPE_VIDEO;
|
|
182
|
+
if (exports.AUDIO_EXTENSIONS.has(ext))
|
|
183
|
+
return exports.APP_MEDIA_TYPE_AUDIO;
|
|
184
|
+
return exports.APP_MEDIA_TYPE_FILE;
|
|
185
|
+
}
|
|
186
|
+
exports.VERSION = "1.4.1";
|
|
187
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { LansengerConfig } from "./config";
|
|
2
|
+
import { FetchFn } from "./http";
|
|
3
|
+
import { StaffBasicInfoResult, StaffDetailResult, DepartmentAncestorsResult, StaffIdMappingResult, ExtraFieldIdsResult, StaffSearchResult, OrgInfoResult } from "./models";
|
|
4
|
+
export declare function fetchStaffBasicInfo(config: LansengerConfig, appToken: string, staffId: string, opts?: {
|
|
5
|
+
user_token?: string;
|
|
6
|
+
fetchFn?: FetchFn;
|
|
7
|
+
}): Promise<StaffBasicInfoResult>;
|
|
8
|
+
export declare function fetchStaffDetail(config: LansengerConfig, appToken: string, staffId: string, opts?: {
|
|
9
|
+
user_token?: string;
|
|
10
|
+
fetchFn?: FetchFn;
|
|
11
|
+
}): Promise<StaffDetailResult>;
|
|
12
|
+
export declare function fetchDepartmentAncestors(config: LansengerConfig, appToken: string, staffId: string, opts?: {
|
|
13
|
+
user_token?: string;
|
|
14
|
+
fetchFn?: FetchFn;
|
|
15
|
+
}): Promise<DepartmentAncestorsResult>;
|
|
16
|
+
export declare function fetchStaffIdMapping(config: LansengerConfig, appToken: string, orgId: string, idType: string, idValue: string, opts?: {
|
|
17
|
+
user_token?: string;
|
|
18
|
+
fetchFn?: FetchFn;
|
|
19
|
+
}): Promise<StaffIdMappingResult>;
|
|
20
|
+
export declare function fetchOrgExtraFieldIds(config: LansengerConfig, appToken: string, orgId: string, opts?: {
|
|
21
|
+
user_token?: string;
|
|
22
|
+
page?: number;
|
|
23
|
+
page_size?: number;
|
|
24
|
+
fetchFn?: FetchFn;
|
|
25
|
+
}): Promise<ExtraFieldIdsResult>;
|
|
26
|
+
export declare function searchStaff(config: LansengerConfig, appToken: string, keyword: string, opts?: {
|
|
27
|
+
user_token?: string;
|
|
28
|
+
user_id?: string;
|
|
29
|
+
recursive?: boolean;
|
|
30
|
+
sector_ids?: string[];
|
|
31
|
+
page?: number;
|
|
32
|
+
page_size?: number;
|
|
33
|
+
fetchFn?: FetchFn;
|
|
34
|
+
}): Promise<StaffSearchResult>;
|
|
35
|
+
export declare function fetchOrgInfo(config: LansengerConfig, appToken: string, orgId: string, opts?: {
|
|
36
|
+
user_token?: string;
|
|
37
|
+
fetchFn?: FetchFn;
|
|
38
|
+
}): Promise<OrgInfoResult>;
|
package/dist/contacts.js
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchStaffBasicInfo = fetchStaffBasicInfo;
|
|
4
|
+
exports.fetchStaffDetail = fetchStaffDetail;
|
|
5
|
+
exports.fetchDepartmentAncestors = fetchDepartmentAncestors;
|
|
6
|
+
exports.fetchStaffIdMapping = fetchStaffIdMapping;
|
|
7
|
+
exports.fetchOrgExtraFieldIds = fetchOrgExtraFieldIds;
|
|
8
|
+
exports.searchStaff = searchStaff;
|
|
9
|
+
exports.fetchOrgInfo = fetchOrgInfo;
|
|
10
|
+
const urlHelpers_1 = require("./urlHelpers");
|
|
11
|
+
const http_1 = require("./http");
|
|
12
|
+
const models_1 = require("./models");
|
|
13
|
+
async function fetchStaffBasicInfo(config, appToken, staffId, opts) {
|
|
14
|
+
if (!staffId)
|
|
15
|
+
return new models_1.StaffBasicInfoResult({ success: false, error: "staff_id is required" });
|
|
16
|
+
const userToken = opts?.user_token || "";
|
|
17
|
+
const url = (0, urlHelpers_1.buildApiUrl)(config, "staffs", "fetch", appToken, { userToken, pathVars: { staff_id: staffId } });
|
|
18
|
+
const [data, httpErr] = await (0, http_1.doGet)(url, opts?.fetchFn);
|
|
19
|
+
if (httpErr)
|
|
20
|
+
return new models_1.StaffBasicInfoResult({ success: false, error: httpErr });
|
|
21
|
+
const [ok, apiErr] = (0, http_1.parseApiResponse)(data);
|
|
22
|
+
if (!ok)
|
|
23
|
+
return new models_1.StaffBasicInfoResult({ success: false, error: apiErr });
|
|
24
|
+
const d = data.data || {};
|
|
25
|
+
return new models_1.StaffBasicInfoResult({
|
|
26
|
+
success: true, org_id: d.orgId, org_name: d.orgName, name: d.name,
|
|
27
|
+
gender: d.gender, signature: d.signature, avatar_url: d.avatarUrl,
|
|
28
|
+
avatar_id: d.avatarId, status: d.status, departments: d.departments,
|
|
29
|
+
raw_response: data,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
async function fetchStaffDetail(config, appToken, staffId, opts) {
|
|
33
|
+
if (!staffId)
|
|
34
|
+
return new models_1.StaffDetailResult({ success: false, error: "staff_id is required" });
|
|
35
|
+
const userToken = opts?.user_token || "";
|
|
36
|
+
const url = (0, urlHelpers_1.buildApiUrl)(config, "staffs", "detail_fetch", appToken, { userToken, pathVars: { staff_id: staffId } });
|
|
37
|
+
const [data, httpErr] = await (0, http_1.doGet)(url, opts?.fetchFn);
|
|
38
|
+
if (httpErr)
|
|
39
|
+
return new models_1.StaffDetailResult({ success: false, error: httpErr });
|
|
40
|
+
const [ok, apiErr] = (0, http_1.parseApiResponse)(data);
|
|
41
|
+
if (!ok)
|
|
42
|
+
return new models_1.StaffDetailResult({ success: false, error: apiErr });
|
|
43
|
+
const d = data.data || {};
|
|
44
|
+
return new models_1.StaffDetailResult({
|
|
45
|
+
success: true, name: d.name, signature: d.signature, avatar_id: d.avatarId,
|
|
46
|
+
avatar_url: d.avatarUrl, status: d.status, departments: d.departments,
|
|
47
|
+
gender: d.gender, org_id: d.orgId, org_name: d.orgName,
|
|
48
|
+
login_name: d.loginName, employee_number: d.employeeNumber, email: d.email,
|
|
49
|
+
external_id: d.externalId, nationality: d.nationality, birthdate: d.birthdate,
|
|
50
|
+
id_number: d.idNumber, native_place: d.nativePlace, duties: d.duties,
|
|
51
|
+
parties: d.parties, address: d.address, mobile_phone: d.mobilePhone,
|
|
52
|
+
extra_phones: d.extraPhones, introduction: d.introduction,
|
|
53
|
+
education: d.education, career: d.career, login_ways: d.loginWays,
|
|
54
|
+
tags: d.tags, extra_field_set: d.extraFieldSet, leaders: d.leaders,
|
|
55
|
+
join_date: d.joinDate, raw_response: data,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
async function fetchDepartmentAncestors(config, appToken, staffId, opts) {
|
|
59
|
+
if (!staffId)
|
|
60
|
+
return new models_1.DepartmentAncestorsResult({ success: false, error: "staff_id is required" });
|
|
61
|
+
const userToken = opts?.user_token || "";
|
|
62
|
+
const url = (0, urlHelpers_1.buildApiUrl)(config, "staffs", "department_ancestors", appToken, { userToken, pathVars: { staff_id: staffId } });
|
|
63
|
+
const [data, httpErr] = await (0, http_1.doGet)(url, opts?.fetchFn);
|
|
64
|
+
if (httpErr)
|
|
65
|
+
return new models_1.DepartmentAncestorsResult({ success: false, error: httpErr });
|
|
66
|
+
const [ok, apiErr] = (0, http_1.parseApiResponse)(data);
|
|
67
|
+
if (!ok)
|
|
68
|
+
return new models_1.DepartmentAncestorsResult({ success: false, error: apiErr });
|
|
69
|
+
const resultData = data.data || [];
|
|
70
|
+
const ancestorGroups = [];
|
|
71
|
+
for (const entry of resultData) {
|
|
72
|
+
ancestorGroups.push(entry.ancestorDepartments || []);
|
|
73
|
+
}
|
|
74
|
+
return new models_1.DepartmentAncestorsResult({ success: true, ancestor_groups: ancestorGroups, raw_response: data });
|
|
75
|
+
}
|
|
76
|
+
async function fetchStaffIdMapping(config, appToken, orgId, idType, idValue, opts) {
|
|
77
|
+
if (!orgId)
|
|
78
|
+
return new models_1.StaffIdMappingResult({ success: false, error: "org_id is required" });
|
|
79
|
+
if (!idType)
|
|
80
|
+
return new models_1.StaffIdMappingResult({ success: false, error: "id_type is required" });
|
|
81
|
+
if (!idValue)
|
|
82
|
+
return new models_1.StaffIdMappingResult({ success: false, error: "id_value is required" });
|
|
83
|
+
const userToken = opts?.user_token || "";
|
|
84
|
+
const url = (0, urlHelpers_1.buildApiUrl)(config, "staffs", "id_mapping", appToken, { userToken })
|
|
85
|
+
+ `&org_id=${encodeURIComponent(orgId)}&id_type=${encodeURIComponent(idType)}&id_value=${encodeURIComponent(idValue)}`;
|
|
86
|
+
const [data, httpErr] = await (0, http_1.doGet)(url, opts?.fetchFn);
|
|
87
|
+
if (httpErr)
|
|
88
|
+
return new models_1.StaffIdMappingResult({ success: false, error: httpErr });
|
|
89
|
+
const [ok, apiErr] = (0, http_1.parseApiResponse)(data);
|
|
90
|
+
if (!ok)
|
|
91
|
+
return new models_1.StaffIdMappingResult({ success: false, error: apiErr });
|
|
92
|
+
const d = data.data || {};
|
|
93
|
+
return new models_1.StaffIdMappingResult({ success: true, staff_id: d.staffId, raw_response: data });
|
|
94
|
+
}
|
|
95
|
+
async function fetchOrgExtraFieldIds(config, appToken, orgId, opts) {
|
|
96
|
+
if (!orgId)
|
|
97
|
+
return new models_1.ExtraFieldIdsResult({ success: false, error: "org_id is required" });
|
|
98
|
+
const userToken = opts?.user_token || "";
|
|
99
|
+
const page = opts?.page || 1;
|
|
100
|
+
const pageSize = opts?.page_size || 1000;
|
|
101
|
+
const url = (0, urlHelpers_1.buildApiUrl)(config, "org", "extra_field_ids", appToken, { userToken, pathVars: { org_id: orgId } })
|
|
102
|
+
+ `&page=${page}&page_size=${pageSize}`;
|
|
103
|
+
const [data, httpErr] = await (0, http_1.doGet)(url, opts?.fetchFn);
|
|
104
|
+
if (httpErr)
|
|
105
|
+
return new models_1.ExtraFieldIdsResult({ success: false, error: httpErr });
|
|
106
|
+
const [ok, apiErr] = (0, http_1.parseApiResponse)(data);
|
|
107
|
+
if (!ok)
|
|
108
|
+
return new models_1.ExtraFieldIdsResult({ success: false, error: apiErr });
|
|
109
|
+
const d = data.data || {};
|
|
110
|
+
return new models_1.ExtraFieldIdsResult({
|
|
111
|
+
success: true, has_more: d.hasMore || false, total: d.total || 0,
|
|
112
|
+
extra_field_ids: d.extraFieldIds, raw_response: data,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
async function searchStaff(config, appToken, keyword, opts) {
|
|
116
|
+
if (!keyword)
|
|
117
|
+
return new models_1.StaffSearchResult({ success: false, error: "keyword is required" });
|
|
118
|
+
const userToken = opts?.user_token || "";
|
|
119
|
+
const userId = opts?.user_id || "";
|
|
120
|
+
const recursive = opts?.recursive ?? true;
|
|
121
|
+
const sectorIds = opts?.sector_ids;
|
|
122
|
+
const page = opts?.page;
|
|
123
|
+
const pageSize = opts?.page_size;
|
|
124
|
+
let url = (0, urlHelpers_1.buildApiUrl)(config, "staffs", "search", appToken, { userToken, userId });
|
|
125
|
+
if (page != null && pageSize != null)
|
|
126
|
+
url += `&page=${page}&page_size=${pageSize}`;
|
|
127
|
+
const body = { keyword, recursive };
|
|
128
|
+
if (sectorIds)
|
|
129
|
+
body.searchScope = { sectorIds };
|
|
130
|
+
const [data, httpErr] = await (0, http_1.doPost)(url, body, opts?.fetchFn);
|
|
131
|
+
if (httpErr)
|
|
132
|
+
return new models_1.StaffSearchResult({ success: false, error: httpErr });
|
|
133
|
+
const [ok, apiErr] = (0, http_1.parseApiResponse)(data);
|
|
134
|
+
if (!ok)
|
|
135
|
+
return new models_1.StaffSearchResult({ success: false, error: apiErr });
|
|
136
|
+
const d = data.data || {};
|
|
137
|
+
return new models_1.StaffSearchResult({
|
|
138
|
+
success: true, has_more: d.hasMore || false, total: d.total || 0,
|
|
139
|
+
staff_info: d.staffInfo, raw_response: data,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
async function fetchOrgInfo(config, appToken, orgId, opts) {
|
|
143
|
+
if (!orgId)
|
|
144
|
+
return new models_1.OrgInfoResult({ success: false, error: "org_id is required" });
|
|
145
|
+
const userToken = opts?.user_token || "";
|
|
146
|
+
const url = (0, urlHelpers_1.buildApiUrl)(config, "org", "fetch", appToken, { userToken, pathVars: { org_id: orgId } });
|
|
147
|
+
const [data, httpErr] = await (0, http_1.doGet)(url, opts?.fetchFn);
|
|
148
|
+
if (httpErr)
|
|
149
|
+
return new models_1.OrgInfoResult({ success: false, error: httpErr });
|
|
150
|
+
const [ok, apiErr] = (0, http_1.parseApiResponse)(data);
|
|
151
|
+
if (!ok)
|
|
152
|
+
return new models_1.OrgInfoResult({ success: false, error: apiErr });
|
|
153
|
+
const d = data.data || {};
|
|
154
|
+
return new models_1.OrgInfoResult({
|
|
155
|
+
success: true, org_id: d.orgId, org_name: d.orgName, icon_url: d.iconUrl,
|
|
156
|
+
org_max_member_limit: d.orgMaxMemberLimit, org_order_type: d.orgOrderType,
|
|
157
|
+
org_days_limit: d.orgDaysLimit, org_billing_date: d.orgBillingDate,
|
|
158
|
+
raw_response: data,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=contacts.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { LansengerConfig } from "./config";
|
|
2
|
+
import { FetchFn } from "./http";
|
|
3
|
+
import { DepartmentDetailResult, DepartmentChildrenResult, DepartmentStaffsResult } from "./models";
|
|
4
|
+
export declare function fetchDepartmentDetail(config: LansengerConfig, appToken: string, departmentId: string, opts?: {
|
|
5
|
+
user_token?: string;
|
|
6
|
+
tag_id?: string;
|
|
7
|
+
fetchFn?: FetchFn;
|
|
8
|
+
}): Promise<DepartmentDetailResult>;
|
|
9
|
+
export declare function fetchDepartmentChildren(config: LansengerConfig, appToken: string, departmentId: string, opts?: {
|
|
10
|
+
user_token?: string;
|
|
11
|
+
fetchFn?: FetchFn;
|
|
12
|
+
}): Promise<DepartmentChildrenResult>;
|
|
13
|
+
export declare function fetchDepartmentStaffs(config: LansengerConfig, appToken: string, departmentId: string, opts?: {
|
|
14
|
+
user_token?: string;
|
|
15
|
+
page?: number;
|
|
16
|
+
page_size?: number;
|
|
17
|
+
fetchFn?: FetchFn;
|
|
18
|
+
}): Promise<DepartmentStaffsResult>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchDepartmentDetail = fetchDepartmentDetail;
|
|
4
|
+
exports.fetchDepartmentChildren = fetchDepartmentChildren;
|
|
5
|
+
exports.fetchDepartmentStaffs = fetchDepartmentStaffs;
|
|
6
|
+
const urlHelpers_1 = require("./urlHelpers");
|
|
7
|
+
const http_1 = require("./http");
|
|
8
|
+
const models_1 = require("./models");
|
|
9
|
+
async function fetchDepartmentDetail(config, appToken, departmentId, opts) {
|
|
10
|
+
if (!departmentId)
|
|
11
|
+
return new models_1.DepartmentDetailResult({ success: false, error: "department_id is required" });
|
|
12
|
+
const userToken = opts?.user_token || "";
|
|
13
|
+
const tagId = opts?.tag_id || "";
|
|
14
|
+
let url = (0, urlHelpers_1.buildApiUrl)(config, "departments", "fetch", appToken, { userToken, pathVars: { department_id: departmentId } });
|
|
15
|
+
if (tagId)
|
|
16
|
+
url += `&tag_id=${encodeURIComponent(tagId)}`;
|
|
17
|
+
const [data, httpErr] = await (0, http_1.doGet)(url, opts?.fetchFn);
|
|
18
|
+
if (httpErr)
|
|
19
|
+
return new models_1.DepartmentDetailResult({ success: false, error: httpErr });
|
|
20
|
+
const [ok, apiErr] = (0, http_1.parseApiResponse)(data);
|
|
21
|
+
if (!ok)
|
|
22
|
+
return new models_1.DepartmentDetailResult({ success: false, error: apiErr });
|
|
23
|
+
const d = data.data || {};
|
|
24
|
+
return new models_1.DepartmentDetailResult({
|
|
25
|
+
success: true, id: d.id, name: d.name, external_id: d.externalId,
|
|
26
|
+
parent_id: d.parentId, order: d.order, has_children: d.hasChildren,
|
|
27
|
+
normal_members: d.normalMembers, inactive_members: d.inactiveMembers,
|
|
28
|
+
frozen_members: d.frozenMembers, deleted_members: d.deletedMembers,
|
|
29
|
+
tags: d.tags, ancestor_departments: d.ancestorDepartments,
|
|
30
|
+
leaders: d.leaders, emails: d.emails, phones: d.phones,
|
|
31
|
+
addresses: d.addresses, introductions: d.introductions,
|
|
32
|
+
dept_type: d.deptType, raw_response: data,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
async function fetchDepartmentChildren(config, appToken, departmentId, opts) {
|
|
36
|
+
if (!departmentId)
|
|
37
|
+
return new models_1.DepartmentChildrenResult({ success: false, error: "department_id is required" });
|
|
38
|
+
const userToken = opts?.user_token || "";
|
|
39
|
+
const url = (0, urlHelpers_1.buildApiUrl)(config, "departments", "children_fetch", appToken, { userToken, pathVars: { department_id: departmentId } });
|
|
40
|
+
const [data, httpErr] = await (0, http_1.doGet)(url, opts?.fetchFn);
|
|
41
|
+
if (httpErr)
|
|
42
|
+
return new models_1.DepartmentChildrenResult({ success: false, error: httpErr });
|
|
43
|
+
const [ok, apiErr] = (0, http_1.parseApiResponse)(data);
|
|
44
|
+
if (!ok)
|
|
45
|
+
return new models_1.DepartmentChildrenResult({ success: false, error: apiErr });
|
|
46
|
+
const d = data.data || {};
|
|
47
|
+
return new models_1.DepartmentChildrenResult({ success: true, departments: d.departments, raw_response: data });
|
|
48
|
+
}
|
|
49
|
+
async function fetchDepartmentStaffs(config, appToken, departmentId, opts) {
|
|
50
|
+
if (!departmentId)
|
|
51
|
+
return new models_1.DepartmentStaffsResult({ success: false, error: "department_id is required" });
|
|
52
|
+
const userToken = opts?.user_token || "";
|
|
53
|
+
const page = opts?.page || 1;
|
|
54
|
+
const pageSize = opts?.page_size || 100;
|
|
55
|
+
const url = (0, urlHelpers_1.buildApiUrl)(config, "departments", "staffs_fetch", appToken, { userToken, pathVars: { department_id: departmentId } })
|
|
56
|
+
+ `&page=${page}&page_size=${pageSize}`;
|
|
57
|
+
const [data, httpErr] = await (0, http_1.doGet)(url, opts?.fetchFn);
|
|
58
|
+
if (httpErr)
|
|
59
|
+
return new models_1.DepartmentStaffsResult({ success: false, error: httpErr });
|
|
60
|
+
const [ok, apiErr] = (0, http_1.parseApiResponse)(data);
|
|
61
|
+
if (!ok)
|
|
62
|
+
return new models_1.DepartmentStaffsResult({ success: false, error: apiErr });
|
|
63
|
+
const d = data.data || {};
|
|
64
|
+
return new models_1.DepartmentStaffsResult({
|
|
65
|
+
success: true, has_more: d.hasMore || false, total: d.total || 0,
|
|
66
|
+
staffs: d.staffs, raw_response: data,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=departments.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare class LansengerError extends Error {
|
|
2
|
+
errCode?: number;
|
|
3
|
+
retryable: boolean;
|
|
4
|
+
constructor(message: string, errCode?: number, retryable?: boolean);
|
|
5
|
+
}
|
|
6
|
+
export declare class LansengerAuthError extends LansengerError {
|
|
7
|
+
constructor(message: string, errCode?: number);
|
|
8
|
+
}
|
|
9
|
+
export declare class LansengerConfigError extends LansengerError {
|
|
10
|
+
constructor(message: string);
|
|
11
|
+
}
|
|
12
|
+
export declare class LansengerAPIError extends LansengerError {
|
|
13
|
+
constructor(message: string, errCode?: number, retryable?: boolean);
|
|
14
|
+
}
|
|
15
|
+
export declare class LansengerNetworkError extends LansengerError {
|
|
16
|
+
constructor(message: string, retryable?: boolean);
|
|
17
|
+
}
|
|
18
|
+
export declare class LansengerFileError extends LansengerError {
|
|
19
|
+
constructor(message: string);
|
|
20
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LansengerFileError = exports.LansengerNetworkError = exports.LansengerAPIError = exports.LansengerConfigError = exports.LansengerAuthError = exports.LansengerError = void 0;
|
|
4
|
+
class LansengerError extends Error {
|
|
5
|
+
constructor(message, errCode, retryable = false) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.errCode = errCode;
|
|
8
|
+
this.retryable = retryable;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.LansengerError = LansengerError;
|
|
12
|
+
class LansengerAuthError extends LansengerError {
|
|
13
|
+
constructor(message, errCode) {
|
|
14
|
+
super(message, errCode, false);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.LansengerAuthError = LansengerAuthError;
|
|
18
|
+
class LansengerConfigError extends LansengerError {
|
|
19
|
+
constructor(message) {
|
|
20
|
+
super(message, undefined, false);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.LansengerConfigError = LansengerConfigError;
|
|
24
|
+
class LansengerAPIError extends LansengerError {
|
|
25
|
+
constructor(message, errCode, retryable = true) {
|
|
26
|
+
super(message, errCode, retryable);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.LansengerAPIError = LansengerAPIError;
|
|
30
|
+
class LansengerNetworkError extends LansengerError {
|
|
31
|
+
constructor(message, retryable = true) {
|
|
32
|
+
super(message, undefined, retryable);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.LansengerNetworkError = LansengerNetworkError;
|
|
36
|
+
class LansengerFileError extends LansengerError {
|
|
37
|
+
constructor(message) {
|
|
38
|
+
super(message, undefined, false);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.LansengerFileError = LansengerFileError;
|
|
42
|
+
//# sourceMappingURL=exceptions.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LansengerConfig } from "./config";
|
|
2
|
+
import { FetchFn } from "./http";
|
|
3
|
+
import { SendMessageResult } from "./models";
|
|
4
|
+
export declare function sendGroupMessage(config: LansengerConfig, appToken: string, groupId: string, msgType: string, msgData: Record<string, any>, opts?: {
|
|
5
|
+
user_token?: string;
|
|
6
|
+
sender_id?: string;
|
|
7
|
+
outlines?: string;
|
|
8
|
+
uuid?: string;
|
|
9
|
+
entry_id?: string;
|
|
10
|
+
fetchFn?: FetchFn;
|
|
11
|
+
}): Promise<SendMessageResult>;
|