@larksuiteoapi/node-sdk 1.12.0 → 1.13.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/README.md +2 -1
- package/README.zh.md +1 -0
- package/es/index.js +714 -709
- package/lib/index.js +714 -708
- package/package.json +1 -1
- package/types/index.d.ts +37 -8
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { AxiosRequestConfig } from 'axios';
|
|
13
|
+
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
14
|
+
|
|
15
|
+
declare const defaultHttpInstance: AxiosInstance;
|
|
14
16
|
|
|
15
17
|
interface Cache {
|
|
16
18
|
set: (key: string | Symbol, value: any, expire?: number, options?: {
|
|
@@ -60,6 +62,26 @@ interface IRequestOptions$1 {
|
|
|
60
62
|
headers?: Record<string, string>;
|
|
61
63
|
}
|
|
62
64
|
|
|
65
|
+
interface HttpInstance {
|
|
66
|
+
request<T = any, R = T, D = any>(opts: HttpRequestOptions<D>): Promise<R>;
|
|
67
|
+
get<T = any, R = T, D = any>(url: string, opts?: HttpRequestOptions<D>): Promise<R>;
|
|
68
|
+
delete<T = any, R = T, D = any>(url: string, opts?: HttpRequestOptions<D>): Promise<R>;
|
|
69
|
+
head<T = any, R = T, D = any>(url: string, opts?: HttpRequestOptions<D>): Promise<R>;
|
|
70
|
+
options<T = any, R = T, D = any>(url: string, opts?: HttpRequestOptions<D>): Promise<R>;
|
|
71
|
+
post<T = any, R = T, D = any>(url: string, data?: D, opts?: HttpRequestOptions<D>): Promise<R>;
|
|
72
|
+
put<T = any, R = T, D = any>(url: string, data?: D, opts?: HttpRequestOptions<D>): Promise<R>;
|
|
73
|
+
patch<T = any, R = T, D = any>(url: string, data?: D, opts?: HttpRequestOptions<D>): Promise<R>;
|
|
74
|
+
}
|
|
75
|
+
declare type ResponseType = 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
|
76
|
+
interface HttpRequestOptions<D> {
|
|
77
|
+
url?: string;
|
|
78
|
+
method?: string;
|
|
79
|
+
headers?: Record<string, any>;
|
|
80
|
+
params?: Record<string, any>;
|
|
81
|
+
data?: D;
|
|
82
|
+
responseType?: ResponseType;
|
|
83
|
+
}
|
|
84
|
+
|
|
63
85
|
interface IRequestOptions {
|
|
64
86
|
lark?: {
|
|
65
87
|
[CTenantKey]?: string;
|
|
@@ -82,6 +104,7 @@ interface IClientParams {
|
|
|
82
104
|
appType?: AppType;
|
|
83
105
|
helpDeskId?: string;
|
|
84
106
|
helpDeskToken?: string;
|
|
107
|
+
httpInstance?: HttpInstance;
|
|
85
108
|
}
|
|
86
109
|
interface IPayload {
|
|
87
110
|
params?: Record<string, any>;
|
|
@@ -94,6 +117,7 @@ declare abstract class Client$1 {
|
|
|
94
117
|
tokenManager: any;
|
|
95
118
|
domain: any;
|
|
96
119
|
logger: Logger;
|
|
120
|
+
httpInstance: HttpInstance;
|
|
97
121
|
abstract formatPayload(payload?: IPayload, options?: IRequestOptions$1): Promise<Required<IPayload>>;
|
|
98
122
|
/**
|
|
99
123
|
* 智能门禁
|
|
@@ -1042,7 +1066,7 @@ declare abstract class Client$1 {
|
|
|
1042
1066
|
} | undefined;
|
|
1043
1067
|
recommend_item_infos?: {
|
|
1044
1068
|
item_id?: string | undefined;
|
|
1045
|
-
item_type?: "
|
|
1069
|
+
item_type?: "application" | "link" | undefined;
|
|
1046
1070
|
name?: string | undefined;
|
|
1047
1071
|
description?: string | undefined;
|
|
1048
1072
|
link_url?: string | undefined;
|
|
@@ -1059,7 +1083,7 @@ declare abstract class Client$1 {
|
|
|
1059
1083
|
}[] | undefined;
|
|
1060
1084
|
distributed_recommend_item_infos?: {
|
|
1061
1085
|
item_id?: string | undefined;
|
|
1062
|
-
item_type?: "
|
|
1086
|
+
item_type?: "application" | "link" | undefined;
|
|
1063
1087
|
name?: string | undefined;
|
|
1064
1088
|
description?: string | undefined;
|
|
1065
1089
|
link_url?: string | undefined;
|
|
@@ -1108,7 +1132,7 @@ declare abstract class Client$1 {
|
|
|
1108
1132
|
} | undefined;
|
|
1109
1133
|
recommend_item_infos?: {
|
|
1110
1134
|
item_id?: string | undefined;
|
|
1111
|
-
item_type?: "
|
|
1135
|
+
item_type?: "application" | "link" | undefined;
|
|
1112
1136
|
name?: string | undefined;
|
|
1113
1137
|
description?: string | undefined;
|
|
1114
1138
|
link_url?: string | undefined;
|
|
@@ -1125,7 +1149,7 @@ declare abstract class Client$1 {
|
|
|
1125
1149
|
}[] | undefined;
|
|
1126
1150
|
distributed_recommend_item_infos?: {
|
|
1127
1151
|
item_id?: string | undefined;
|
|
1128
|
-
item_type?: "
|
|
1152
|
+
item_type?: "application" | "link" | undefined;
|
|
1129
1153
|
name?: string | undefined;
|
|
1130
1154
|
description?: string | undefined;
|
|
1131
1155
|
link_url?: string | undefined;
|
|
@@ -38981,7 +39005,7 @@ declare abstract class Client$1 {
|
|
|
38981
39005
|
custom_fields?: {
|
|
38982
39006
|
key?: string | undefined;
|
|
38983
39007
|
label?: string | undefined;
|
|
38984
|
-
type?: "
|
|
39008
|
+
type?: "text" | "file" | "date" | "option" | undefined;
|
|
38985
39009
|
value?: string | undefined;
|
|
38986
39010
|
}[] | undefined;
|
|
38987
39011
|
}[] | undefined;
|
|
@@ -39170,7 +39194,7 @@ declare abstract class Client$1 {
|
|
|
39170
39194
|
custom_fields?: {
|
|
39171
39195
|
key?: string | undefined;
|
|
39172
39196
|
label?: string | undefined;
|
|
39173
|
-
type?: "
|
|
39197
|
+
type?: "text" | "file" | "date" | "option" | undefined;
|
|
39174
39198
|
value?: string | undefined;
|
|
39175
39199
|
}[] | undefined;
|
|
39176
39200
|
}[] | undefined;
|
|
@@ -53532,6 +53556,7 @@ interface IParams$1 {
|
|
|
53532
53556
|
domain: string;
|
|
53533
53557
|
logger: Logger;
|
|
53534
53558
|
appType: AppType;
|
|
53559
|
+
httpInstance: HttpInstance;
|
|
53535
53560
|
}
|
|
53536
53561
|
declare class AppTicketManager {
|
|
53537
53562
|
appId: string;
|
|
@@ -53540,6 +53565,7 @@ declare class AppTicketManager {
|
|
|
53540
53565
|
domain: string;
|
|
53541
53566
|
logger: Logger;
|
|
53542
53567
|
appType: AppType;
|
|
53568
|
+
httpInstance: HttpInstance;
|
|
53543
53569
|
constructor(params: IParams$1);
|
|
53544
53570
|
checkAppTicket(): Promise<void>;
|
|
53545
53571
|
requestAppTicket(): Promise<void>;
|
|
@@ -53553,6 +53579,7 @@ interface IParams {
|
|
|
53553
53579
|
domain: string;
|
|
53554
53580
|
logger: Logger;
|
|
53555
53581
|
appType: AppType;
|
|
53582
|
+
httpInstance: HttpInstance;
|
|
53556
53583
|
}
|
|
53557
53584
|
declare class TokenManager {
|
|
53558
53585
|
appId: string;
|
|
@@ -53562,6 +53589,7 @@ declare class TokenManager {
|
|
|
53562
53589
|
domain: string;
|
|
53563
53590
|
logger: Logger;
|
|
53564
53591
|
appType: AppType;
|
|
53592
|
+
httpInstance: HttpInstance;
|
|
53565
53593
|
constructor(params: IParams);
|
|
53566
53594
|
getCustomTenantAccessToken(): Promise<any>;
|
|
53567
53595
|
getMarketTenantAccessToken(tenantKey: string): Promise<any>;
|
|
@@ -53581,6 +53609,7 @@ declare class Client extends Client$1 {
|
|
|
53581
53609
|
disableTokenCache?: boolean;
|
|
53582
53610
|
appType: AppType;
|
|
53583
53611
|
domain: string;
|
|
53612
|
+
httpInstance: HttpInstance;
|
|
53584
53613
|
constructor(params: IClientParams);
|
|
53585
53614
|
formatPayload(payload?: IPayload, options?: IRequestOptions): Promise<Required<IPayload>>;
|
|
53586
53615
|
request<T = any>(payload: AxiosRequestConfig, options?: IRequestOptions): Promise<T>;
|
|
@@ -57754,4 +57783,4 @@ interface InteractiveCardSelectMenuActionItem extends InteractiveCardActionBaseI
|
|
|
57754
57783
|
value?: Record<string, any>;
|
|
57755
57784
|
}
|
|
57756
57785
|
|
|
57757
|
-
export { AESCipher, AppType, CAppTicket, CTenantAccessToken, Cache, CardActionHandler, Client, Domain, EventDispatcher, IHandles as EventHandles, InteractiveCard, InteractiveCardActionEvent, InteractiveCardActionItem, InteractiveCardButtonActionItem, InteractiveCardDatePickerActionItem, InteractiveCardDivElement, InteractiveCardDividerElement, InteractiveCardElement, InteractiveCardField, InteractiveCardImageElement, InteractiveCardImageItem, InteractiveCardLarkMdItem, InteractiveCardMarkdownElement, InteractiveCardNoteElement, InteractiveCardOverflowActionItem, InteractiveCardPlainTextItem, InteractiveCardSelectMenuActionItem, InteractiveCardTextItem, InteractiveCardTitle, InteractiveCardUrlItem, InterfaceCardActionElement, LoggerLevel, adaptDefault, adaptExpress, adaptKoa, adaptKoaRouter, generateChallenge, withAll, withHelpDeskCredential, withTenantKey, withTenantToken, withUserAccessToken };
|
|
57786
|
+
export { AESCipher, AppType, CAppTicket, CTenantAccessToken, Cache, CardActionHandler, Client, Domain, EventDispatcher, IHandles as EventHandles, HttpInstance, HttpRequestOptions, InteractiveCard, InteractiveCardActionEvent, InteractiveCardActionItem, InteractiveCardButtonActionItem, InteractiveCardDatePickerActionItem, InteractiveCardDivElement, InteractiveCardDividerElement, InteractiveCardElement, InteractiveCardField, InteractiveCardImageElement, InteractiveCardImageItem, InteractiveCardLarkMdItem, InteractiveCardMarkdownElement, InteractiveCardNoteElement, InteractiveCardOverflowActionItem, InteractiveCardPlainTextItem, InteractiveCardSelectMenuActionItem, InteractiveCardTextItem, InteractiveCardTitle, InteractiveCardUrlItem, InterfaceCardActionElement, LoggerLevel, adaptDefault, adaptExpress, adaptKoa, adaptKoaRouter, defaultHttpInstance, generateChallenge, withAll, withHelpDeskCredential, withTenantKey, withTenantToken, withUserAccessToken };
|