uapi-browser-sdk 0.1.14 → 0.1.15
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 +1 -60
- package/dist/src/errors.d.ts +0 -16
- package/dist/src/errors.js +0 -22
- package/dist/src/index.d.ts +471 -2
- package/dist/src/index.js +504 -91
- package/package.json +1 -1
- package/src/errors.ts +0 -39
- package/src/index.ts +901 -4
package/dist/src/index.js
CHANGED
|
@@ -5,10 +5,28 @@ function normalizeBaseURL(baseURL) {
|
|
|
5
5
|
const trimmed = baseURL.replace(/\/+$/, '');
|
|
6
6
|
return trimmed.endsWith(API_PREFIX) ? trimmed.slice(0, -API_PREFIX.length) : trimmed;
|
|
7
7
|
}
|
|
8
|
+
function applyCacheControl(method, params, defaultDisableCache = false, requestDisableCache) {
|
|
9
|
+
if (method.toUpperCase() !== 'GET') {
|
|
10
|
+
return params;
|
|
11
|
+
}
|
|
12
|
+
if (params?.["_t"] !== undefined && params?.["_t"] !== null) {
|
|
13
|
+
return params;
|
|
14
|
+
}
|
|
15
|
+
const disableCache = requestDisableCache ?? defaultDisableCache;
|
|
16
|
+
if (!disableCache) {
|
|
17
|
+
return params;
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
...(params ?? {}),
|
|
21
|
+
_t: Date.now(),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
8
24
|
export class UapiClient {
|
|
9
|
-
constructor(baseURL,
|
|
25
|
+
constructor(baseURL, tokenOrOptions, maybeOptions = {}) {
|
|
10
26
|
this.baseURL = normalizeBaseURL(baseURL);
|
|
11
|
-
this.token =
|
|
27
|
+
this.token = typeof tokenOrOptions === 'string' ? tokenOrOptions : undefined;
|
|
28
|
+
const options = typeof tokenOrOptions === 'string' ? maybeOptions : (tokenOrOptions ?? {});
|
|
29
|
+
this.disableCache = options.disableCache ?? false;
|
|
12
30
|
const clipzyZaiXianJianTieBan = new ClipzyZaiXianJianTieBanApi(this);
|
|
13
31
|
this.clipzyZaiXianJianTieBan = clipzyZaiXianJianTieBan;
|
|
14
32
|
this["Clipzy 在线剪贴板"] = clipzyZaiXianJianTieBan;
|
|
@@ -61,10 +79,11 @@ export class UapiClient {
|
|
|
61
79
|
get lastResponseMeta() {
|
|
62
80
|
return this._lastResponseMeta;
|
|
63
81
|
}
|
|
64
|
-
async _request(method, path, params, body, headers, responseKind = 'json') {
|
|
82
|
+
async _request(method, path, params, body, headers, responseKind = 'json', requestOptions) {
|
|
83
|
+
const finalParams = applyCacheControl(method, params, this.disableCache, requestOptions?.disableCache);
|
|
65
84
|
const url = new URL(this.baseURL + path);
|
|
66
|
-
if (
|
|
67
|
-
Object.entries(
|
|
85
|
+
if (finalParams) {
|
|
86
|
+
Object.entries(finalParams).forEach(([key, value]) => {
|
|
68
87
|
if (value !== undefined) {
|
|
69
88
|
url.searchParams.set(key, String(value));
|
|
70
89
|
}
|
|
@@ -108,17 +127,27 @@ export class ClipzyZaiXianJianTieBanApi {
|
|
|
108
127
|
const query = {};
|
|
109
128
|
const headers = {};
|
|
110
129
|
const body = {};
|
|
130
|
+
let disableCache;
|
|
131
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
132
|
+
const argCacheBuster = args._t;
|
|
133
|
+
if (argCacheBuster !== undefined)
|
|
134
|
+
query["_t"] = argCacheBuster;
|
|
111
135
|
const argId = args.id;
|
|
112
136
|
if (argId !== undefined)
|
|
113
137
|
query["id"] = argId;
|
|
114
138
|
let requestPath = '/api/v1/api/get';
|
|
115
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
139
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
116
140
|
}
|
|
117
141
|
/** 步骤2 (方法二): 获取原始文本 */
|
|
118
142
|
async getClipzyRaw(args) {
|
|
119
143
|
const query = {};
|
|
120
144
|
const headers = {};
|
|
121
145
|
const body = {};
|
|
146
|
+
let disableCache;
|
|
147
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
148
|
+
const argCacheBuster = args._t;
|
|
149
|
+
if (argCacheBuster !== undefined)
|
|
150
|
+
query["_t"] = argCacheBuster;
|
|
122
151
|
const argId = args.id;
|
|
123
152
|
const argKey = args.key;
|
|
124
153
|
if (argKey !== undefined)
|
|
@@ -126,13 +155,18 @@ export class ClipzyZaiXianJianTieBanApi {
|
|
|
126
155
|
let requestPath = '/api/v1/api/raw/{id}';
|
|
127
156
|
if (argId !== undefined)
|
|
128
157
|
requestPath = requestPath.replace('{' + 'id' + '}', String(argId));
|
|
129
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'text');
|
|
158
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'text', disableCache !== undefined ? { disableCache } : undefined);
|
|
130
159
|
}
|
|
131
160
|
/** 步骤1:上传加密数据 */
|
|
132
161
|
async postClipzyStore(args) {
|
|
133
162
|
const query = {};
|
|
134
163
|
const headers = {};
|
|
135
164
|
const body = {};
|
|
165
|
+
let disableCache;
|
|
166
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
167
|
+
const argCacheBuster = args._t;
|
|
168
|
+
if (argCacheBuster !== undefined)
|
|
169
|
+
query["_t"] = argCacheBuster;
|
|
136
170
|
const argCompressedData = args.compressedData;
|
|
137
171
|
if (argCompressedData !== undefined)
|
|
138
172
|
body["compressedData"] = argCompressedData;
|
|
@@ -140,7 +174,7 @@ export class ClipzyZaiXianJianTieBanApi {
|
|
|
140
174
|
if (argTtl !== undefined)
|
|
141
175
|
body["ttl"] = argTtl;
|
|
142
176
|
let requestPath = '/api/v1/api/store';
|
|
143
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
177
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
144
178
|
}
|
|
145
179
|
}
|
|
146
180
|
export class ConvertApi {
|
|
@@ -152,22 +186,32 @@ export class ConvertApi {
|
|
|
152
186
|
const query = {};
|
|
153
187
|
const headers = {};
|
|
154
188
|
const body = {};
|
|
189
|
+
let disableCache;
|
|
190
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
191
|
+
const argCacheBuster = args._t;
|
|
192
|
+
if (argCacheBuster !== undefined)
|
|
193
|
+
query["_t"] = argCacheBuster;
|
|
155
194
|
const argTime = args.time;
|
|
156
195
|
if (argTime !== undefined)
|
|
157
196
|
query["time"] = argTime;
|
|
158
197
|
let requestPath = '/api/v1/convert/unixtime';
|
|
159
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
198
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
160
199
|
}
|
|
161
200
|
/** JSON 格式化 */
|
|
162
201
|
async postConvertJson(args) {
|
|
163
202
|
const query = {};
|
|
164
203
|
const headers = {};
|
|
165
204
|
const body = {};
|
|
205
|
+
let disableCache;
|
|
206
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
207
|
+
const argCacheBuster = args._t;
|
|
208
|
+
if (argCacheBuster !== undefined)
|
|
209
|
+
query["_t"] = argCacheBuster;
|
|
166
210
|
const argContent = args.content;
|
|
167
211
|
if (argContent !== undefined)
|
|
168
212
|
body["content"] = argContent;
|
|
169
213
|
let requestPath = '/api/v1/convert/json';
|
|
170
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
214
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
171
215
|
}
|
|
172
216
|
}
|
|
173
217
|
export class DailyApi {
|
|
@@ -179,8 +223,9 @@ export class DailyApi {
|
|
|
179
223
|
const query = {};
|
|
180
224
|
const headers = {};
|
|
181
225
|
const body = {};
|
|
226
|
+
let disableCache;
|
|
182
227
|
let requestPath = '/api/v1/daily/news-image';
|
|
183
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer');
|
|
228
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer', disableCache !== undefined ? { disableCache } : undefined);
|
|
184
229
|
}
|
|
185
230
|
}
|
|
186
231
|
export class GameApi {
|
|
@@ -192,14 +237,20 @@ export class GameApi {
|
|
|
192
237
|
const query = {};
|
|
193
238
|
const headers = {};
|
|
194
239
|
const body = {};
|
|
240
|
+
let disableCache;
|
|
195
241
|
let requestPath = '/api/v1/game/epic-free';
|
|
196
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
242
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
197
243
|
}
|
|
198
244
|
/** 查询 MC 曾用名 */
|
|
199
245
|
async getGameMinecraftHistoryid(args = {}) {
|
|
200
246
|
const query = {};
|
|
201
247
|
const headers = {};
|
|
202
248
|
const body = {};
|
|
249
|
+
let disableCache;
|
|
250
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
251
|
+
const argCacheBuster = args._t;
|
|
252
|
+
if (argCacheBuster !== undefined)
|
|
253
|
+
query["_t"] = argCacheBuster;
|
|
203
254
|
const argName = args.name;
|
|
204
255
|
if (argName !== undefined)
|
|
205
256
|
query["name"] = argName;
|
|
@@ -207,35 +258,50 @@ export class GameApi {
|
|
|
207
258
|
if (argUuid !== undefined)
|
|
208
259
|
query["uuid"] = argUuid;
|
|
209
260
|
let requestPath = '/api/v1/game/minecraft/historyid';
|
|
210
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
261
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
211
262
|
}
|
|
212
263
|
/** 查询 MC 服务器 */
|
|
213
264
|
async getGameMinecraftServerstatus(args) {
|
|
214
265
|
const query = {};
|
|
215
266
|
const headers = {};
|
|
216
267
|
const body = {};
|
|
268
|
+
let disableCache;
|
|
269
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
270
|
+
const argCacheBuster = args._t;
|
|
271
|
+
if (argCacheBuster !== undefined)
|
|
272
|
+
query["_t"] = argCacheBuster;
|
|
217
273
|
const argServer = args.server;
|
|
218
274
|
if (argServer !== undefined)
|
|
219
275
|
query["server"] = argServer;
|
|
220
276
|
let requestPath = '/api/v1/game/minecraft/serverstatus';
|
|
221
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
277
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
222
278
|
}
|
|
223
279
|
/** 查询 MC 玩家 */
|
|
224
280
|
async getGameMinecraftUserinfo(args) {
|
|
225
281
|
const query = {};
|
|
226
282
|
const headers = {};
|
|
227
283
|
const body = {};
|
|
284
|
+
let disableCache;
|
|
285
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
286
|
+
const argCacheBuster = args._t;
|
|
287
|
+
if (argCacheBuster !== undefined)
|
|
288
|
+
query["_t"] = argCacheBuster;
|
|
228
289
|
const argUsername = args.username;
|
|
229
290
|
if (argUsername !== undefined)
|
|
230
291
|
query["username"] = argUsername;
|
|
231
292
|
let requestPath = '/api/v1/game/minecraft/userinfo';
|
|
232
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
293
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
233
294
|
}
|
|
234
295
|
/** 查询 Steam 用户 */
|
|
235
296
|
async getGameSteamSummary(args = {}) {
|
|
236
297
|
const query = {};
|
|
237
298
|
const headers = {};
|
|
238
299
|
const body = {};
|
|
300
|
+
let disableCache;
|
|
301
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
302
|
+
const argCacheBuster = args._t;
|
|
303
|
+
if (argCacheBuster !== undefined)
|
|
304
|
+
query["_t"] = argCacheBuster;
|
|
239
305
|
const argSteamid = args.steamid;
|
|
240
306
|
if (argSteamid !== undefined)
|
|
241
307
|
query["steamid"] = argSteamid;
|
|
@@ -249,7 +315,7 @@ export class GameApi {
|
|
|
249
315
|
if (argKey !== undefined)
|
|
250
316
|
query["key"] = argKey;
|
|
251
317
|
let requestPath = '/api/v1/game/steam/summary';
|
|
252
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
318
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
253
319
|
}
|
|
254
320
|
}
|
|
255
321
|
export class ImageApi {
|
|
@@ -261,6 +327,11 @@ export class ImageApi {
|
|
|
261
327
|
const query = {};
|
|
262
328
|
const headers = {};
|
|
263
329
|
const body = {};
|
|
330
|
+
let disableCache;
|
|
331
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
332
|
+
const argCacheBuster = args._t;
|
|
333
|
+
if (argCacheBuster !== undefined)
|
|
334
|
+
query["_t"] = argCacheBuster;
|
|
264
335
|
const argEmail = args.email;
|
|
265
336
|
if (argEmail !== undefined)
|
|
266
337
|
query["email"] = argEmail;
|
|
@@ -277,21 +348,27 @@ export class ImageApi {
|
|
|
277
348
|
if (argR !== undefined)
|
|
278
349
|
query["r"] = argR;
|
|
279
350
|
let requestPath = '/api/v1/avatar/gravatar';
|
|
280
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer');
|
|
351
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer', disableCache !== undefined ? { disableCache } : undefined);
|
|
281
352
|
}
|
|
282
353
|
/** 必应壁纸 */
|
|
283
354
|
async getImageBingDaily() {
|
|
284
355
|
const query = {};
|
|
285
356
|
const headers = {};
|
|
286
357
|
const body = {};
|
|
358
|
+
let disableCache;
|
|
287
359
|
let requestPath = '/api/v1/image/bing-daily';
|
|
288
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer');
|
|
360
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer', disableCache !== undefined ? { disableCache } : undefined);
|
|
289
361
|
}
|
|
290
362
|
/** 生成摸摸头GIF (QQ号) */
|
|
291
363
|
async getImageMotou(args) {
|
|
292
364
|
const query = {};
|
|
293
365
|
const headers = {};
|
|
294
366
|
const body = {};
|
|
367
|
+
let disableCache;
|
|
368
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
369
|
+
const argCacheBuster = args._t;
|
|
370
|
+
if (argCacheBuster !== undefined)
|
|
371
|
+
query["_t"] = argCacheBuster;
|
|
295
372
|
const argQq = args.qq;
|
|
296
373
|
if (argQq !== undefined)
|
|
297
374
|
query["qq"] = argQq;
|
|
@@ -299,13 +376,18 @@ export class ImageApi {
|
|
|
299
376
|
if (argBgColor !== undefined)
|
|
300
377
|
query["bg_color"] = argBgColor;
|
|
301
378
|
let requestPath = '/api/v1/image/motou';
|
|
302
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer');
|
|
379
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer', disableCache !== undefined ? { disableCache } : undefined);
|
|
303
380
|
}
|
|
304
381
|
/** 生成二维码 */
|
|
305
382
|
async getImageQrcode(args) {
|
|
306
383
|
const query = {};
|
|
307
384
|
const headers = {};
|
|
308
385
|
const body = {};
|
|
386
|
+
let disableCache;
|
|
387
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
388
|
+
const argCacheBuster = args._t;
|
|
389
|
+
if (argCacheBuster !== undefined)
|
|
390
|
+
query["_t"] = argCacheBuster;
|
|
309
391
|
const argText = args.text;
|
|
310
392
|
if (argText !== undefined)
|
|
311
393
|
query["text"] = argText;
|
|
@@ -325,24 +407,34 @@ export class ImageApi {
|
|
|
325
407
|
if (argBgcolor !== undefined)
|
|
326
408
|
query["bgcolor"] = argBgcolor;
|
|
327
409
|
let requestPath = '/api/v1/image/qrcode';
|
|
328
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
410
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
329
411
|
}
|
|
330
412
|
/** 图片转 Base64 */
|
|
331
413
|
async getImageTobase64(args) {
|
|
332
414
|
const query = {};
|
|
333
415
|
const headers = {};
|
|
334
416
|
const body = {};
|
|
417
|
+
let disableCache;
|
|
418
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
419
|
+
const argCacheBuster = args._t;
|
|
420
|
+
if (argCacheBuster !== undefined)
|
|
421
|
+
query["_t"] = argCacheBuster;
|
|
335
422
|
const argUrl = args.url;
|
|
336
423
|
if (argUrl !== undefined)
|
|
337
424
|
query["url"] = argUrl;
|
|
338
425
|
let requestPath = '/api/v1/image/tobase64';
|
|
339
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
426
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
340
427
|
}
|
|
341
428
|
/** 无损压缩图片 */
|
|
342
429
|
async postImageCompress(args) {
|
|
343
430
|
const query = {};
|
|
344
431
|
const headers = {};
|
|
345
432
|
const body = {};
|
|
433
|
+
let disableCache;
|
|
434
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
435
|
+
const argCacheBuster = args._t;
|
|
436
|
+
if (argCacheBuster !== undefined)
|
|
437
|
+
query["_t"] = argCacheBuster;
|
|
346
438
|
const argLevel = args.level;
|
|
347
439
|
if (argLevel !== undefined)
|
|
348
440
|
query["level"] = argLevel;
|
|
@@ -353,24 +445,34 @@ export class ImageApi {
|
|
|
353
445
|
if (argFile !== undefined)
|
|
354
446
|
body["file"] = argFile;
|
|
355
447
|
let requestPath = '/api/v1/image/compress';
|
|
356
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer');
|
|
448
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer', disableCache !== undefined ? { disableCache } : undefined);
|
|
357
449
|
}
|
|
358
450
|
/** 通过Base64编码上传图片 */
|
|
359
451
|
async postImageFrombase64(args) {
|
|
360
452
|
const query = {};
|
|
361
453
|
const headers = {};
|
|
362
454
|
const body = {};
|
|
455
|
+
let disableCache;
|
|
456
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
457
|
+
const argCacheBuster = args._t;
|
|
458
|
+
if (argCacheBuster !== undefined)
|
|
459
|
+
query["_t"] = argCacheBuster;
|
|
363
460
|
const argImageData = args.imageData;
|
|
364
461
|
if (argImageData !== undefined)
|
|
365
462
|
body["imageData"] = argImageData;
|
|
366
463
|
let requestPath = '/api/v1/image/frombase64';
|
|
367
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
464
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
368
465
|
}
|
|
369
466
|
/** 生成摸摸头GIF */
|
|
370
467
|
async postImageMotou(args) {
|
|
371
468
|
const query = {};
|
|
372
469
|
const headers = {};
|
|
373
470
|
const body = {};
|
|
471
|
+
let disableCache;
|
|
472
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
473
|
+
const argCacheBuster = args._t;
|
|
474
|
+
if (argCacheBuster !== undefined)
|
|
475
|
+
query["_t"] = argCacheBuster;
|
|
374
476
|
const argBgColor = args.bgColor ?? args["bg_color"];
|
|
375
477
|
if (argBgColor !== undefined)
|
|
376
478
|
body["bg_color"] = argBgColor;
|
|
@@ -381,13 +483,18 @@ export class ImageApi {
|
|
|
381
483
|
if (argImageUrl !== undefined)
|
|
382
484
|
body["image_url"] = argImageUrl;
|
|
383
485
|
let requestPath = '/api/v1/image/motou';
|
|
384
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer');
|
|
486
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer', disableCache !== undefined ? { disableCache } : undefined);
|
|
385
487
|
}
|
|
386
488
|
/** 图片敏感检测 */
|
|
387
489
|
async postImageNsfw(args) {
|
|
388
490
|
const query = {};
|
|
389
491
|
const headers = {};
|
|
390
492
|
const body = {};
|
|
493
|
+
let disableCache;
|
|
494
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
495
|
+
const argCacheBuster = args._t;
|
|
496
|
+
if (argCacheBuster !== undefined)
|
|
497
|
+
query["_t"] = argCacheBuster;
|
|
391
498
|
const argFile = args.file;
|
|
392
499
|
if (argFile !== undefined)
|
|
393
500
|
body["file"] = argFile;
|
|
@@ -395,13 +502,18 @@ export class ImageApi {
|
|
|
395
502
|
if (argUrl !== undefined)
|
|
396
503
|
body["url"] = argUrl;
|
|
397
504
|
let requestPath = '/api/v1/image/nsfw';
|
|
398
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
505
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
399
506
|
}
|
|
400
507
|
/** 生成你们怎么不说话了表情包 */
|
|
401
508
|
async postImageSpeechless(args) {
|
|
402
509
|
const query = {};
|
|
403
510
|
const headers = {};
|
|
404
511
|
const body = {};
|
|
512
|
+
let disableCache;
|
|
513
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
514
|
+
const argCacheBuster = args._t;
|
|
515
|
+
if (argCacheBuster !== undefined)
|
|
516
|
+
query["_t"] = argCacheBuster;
|
|
405
517
|
const argBottomText = args.bottomText ?? args["bottom_text"];
|
|
406
518
|
if (argBottomText !== undefined)
|
|
407
519
|
body["bottom_text"] = argBottomText;
|
|
@@ -409,13 +521,18 @@ export class ImageApi {
|
|
|
409
521
|
if (argTopText !== undefined)
|
|
410
522
|
body["top_text"] = argTopText;
|
|
411
523
|
let requestPath = '/api/v1/image/speechless';
|
|
412
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer');
|
|
524
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer', disableCache !== undefined ? { disableCache } : undefined);
|
|
413
525
|
}
|
|
414
526
|
/** SVG转图片 */
|
|
415
527
|
async postImageSvg(args = {}) {
|
|
416
528
|
const query = {};
|
|
417
529
|
const headers = {};
|
|
418
530
|
const body = {};
|
|
531
|
+
let disableCache;
|
|
532
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
533
|
+
const argCacheBuster = args._t;
|
|
534
|
+
if (argCacheBuster !== undefined)
|
|
535
|
+
query["_t"] = argCacheBuster;
|
|
419
536
|
const argFormat = args.format;
|
|
420
537
|
if (argFormat !== undefined)
|
|
421
538
|
query["format"] = argFormat;
|
|
@@ -432,7 +549,7 @@ export class ImageApi {
|
|
|
432
549
|
if (argFile !== undefined)
|
|
433
550
|
body["file"] = argFile;
|
|
434
551
|
let requestPath = '/api/v1/image/svg';
|
|
435
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer');
|
|
552
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer', disableCache !== undefined ? { disableCache } : undefined);
|
|
436
553
|
}
|
|
437
554
|
}
|
|
438
555
|
export class MiscApi {
|
|
@@ -444,6 +561,11 @@ export class MiscApi {
|
|
|
444
561
|
const query = {};
|
|
445
562
|
const headers = {};
|
|
446
563
|
const body = {};
|
|
564
|
+
let disableCache;
|
|
565
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
566
|
+
const argCacheBuster = args._t;
|
|
567
|
+
if (argCacheBuster !== undefined)
|
|
568
|
+
query["_t"] = argCacheBuster;
|
|
447
569
|
const argMonth = args.month;
|
|
448
570
|
if (argMonth !== undefined)
|
|
449
571
|
query["month"] = argMonth;
|
|
@@ -451,21 +573,27 @@ export class MiscApi {
|
|
|
451
573
|
if (argDay !== undefined)
|
|
452
574
|
query["day"] = argDay;
|
|
453
575
|
let requestPath = '/api/v1/history/programmer';
|
|
454
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
576
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
455
577
|
}
|
|
456
578
|
/** 程序员历史上的今天 */
|
|
457
579
|
async getHistoryProgrammerToday() {
|
|
458
580
|
const query = {};
|
|
459
581
|
const headers = {};
|
|
460
582
|
const body = {};
|
|
583
|
+
let disableCache;
|
|
461
584
|
let requestPath = '/api/v1/history/programmer/today';
|
|
462
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
585
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
463
586
|
}
|
|
464
587
|
/** Adcode 国内外行政区域查询 */
|
|
465
588
|
async getMiscDistrict(args = {}) {
|
|
466
589
|
const query = {};
|
|
467
590
|
const headers = {};
|
|
468
591
|
const body = {};
|
|
592
|
+
let disableCache;
|
|
593
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
594
|
+
const argCacheBuster = args._t;
|
|
595
|
+
if (argCacheBuster !== undefined)
|
|
596
|
+
query["_t"] = argCacheBuster;
|
|
469
597
|
const argKeywords = args.keywords;
|
|
470
598
|
if (argKeywords !== undefined)
|
|
471
599
|
query["keywords"] = argKeywords;
|
|
@@ -488,13 +616,18 @@ export class MiscApi {
|
|
|
488
616
|
if (argLimit !== undefined)
|
|
489
617
|
query["limit"] = argLimit;
|
|
490
618
|
let requestPath = '/api/v1/misc/district';
|
|
491
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
619
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
492
620
|
}
|
|
493
621
|
/** 查询节假日与万年历 */
|
|
494
622
|
async getMiscHolidayCalendar(args = {}) {
|
|
495
623
|
const query = {};
|
|
496
624
|
const headers = {};
|
|
497
625
|
const body = {};
|
|
626
|
+
let disableCache;
|
|
627
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
628
|
+
const argCacheBuster = args._t;
|
|
629
|
+
if (argCacheBuster !== undefined)
|
|
630
|
+
query["_t"] = argCacheBuster;
|
|
498
631
|
const argDate = args.date;
|
|
499
632
|
if (argDate !== undefined)
|
|
500
633
|
query["date"] = argDate;
|
|
@@ -517,13 +650,18 @@ export class MiscApi {
|
|
|
517
650
|
if (argNearbyLimit !== undefined)
|
|
518
651
|
query["nearby_limit"] = argNearbyLimit;
|
|
519
652
|
let requestPath = '/api/v1/misc/holiday-calendar';
|
|
520
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
653
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
521
654
|
}
|
|
522
655
|
/** 查询热榜 */
|
|
523
656
|
async getMiscHotboard(args) {
|
|
524
657
|
const query = {};
|
|
525
658
|
const headers = {};
|
|
526
659
|
const body = {};
|
|
660
|
+
let disableCache;
|
|
661
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
662
|
+
const argCacheBuster = args._t;
|
|
663
|
+
if (argCacheBuster !== undefined)
|
|
664
|
+
query["_t"] = argCacheBuster;
|
|
527
665
|
const argType = args.type;
|
|
528
666
|
if (argType !== undefined)
|
|
529
667
|
query["type"] = argType;
|
|
@@ -546,13 +684,18 @@ export class MiscApi {
|
|
|
546
684
|
if (argSources !== undefined)
|
|
547
685
|
query["sources"] = argSources;
|
|
548
686
|
let requestPath = '/api/v1/misc/hotboard';
|
|
549
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
687
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
550
688
|
}
|
|
551
689
|
/** 查询农历时间 */
|
|
552
690
|
async getMiscLunartime(args = {}) {
|
|
553
691
|
const query = {};
|
|
554
692
|
const headers = {};
|
|
555
693
|
const body = {};
|
|
694
|
+
let disableCache;
|
|
695
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
696
|
+
const argCacheBuster = args._t;
|
|
697
|
+
if (argCacheBuster !== undefined)
|
|
698
|
+
query["_t"] = argCacheBuster;
|
|
556
699
|
const argTs = args.ts;
|
|
557
700
|
if (argTs !== undefined)
|
|
558
701
|
query["ts"] = argTs;
|
|
@@ -560,24 +703,34 @@ export class MiscApi {
|
|
|
560
703
|
if (argTimezone !== undefined)
|
|
561
704
|
query["timezone"] = argTimezone;
|
|
562
705
|
let requestPath = '/api/v1/misc/lunartime';
|
|
563
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
706
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
564
707
|
}
|
|
565
708
|
/** 查询手机归属地 */
|
|
566
709
|
async getMiscPhoneinfo(args) {
|
|
567
710
|
const query = {};
|
|
568
711
|
const headers = {};
|
|
569
712
|
const body = {};
|
|
713
|
+
let disableCache;
|
|
714
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
715
|
+
const argCacheBuster = args._t;
|
|
716
|
+
if (argCacheBuster !== undefined)
|
|
717
|
+
query["_t"] = argCacheBuster;
|
|
570
718
|
const argPhone = args.phone;
|
|
571
719
|
if (argPhone !== undefined)
|
|
572
720
|
query["phone"] = argPhone;
|
|
573
721
|
let requestPath = '/api/v1/misc/phoneinfo';
|
|
574
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
722
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
575
723
|
}
|
|
576
724
|
/** 随机数生成 */
|
|
577
725
|
async getMiscRandomnumber(args = {}) {
|
|
578
726
|
const query = {};
|
|
579
727
|
const headers = {};
|
|
580
728
|
const body = {};
|
|
729
|
+
let disableCache;
|
|
730
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
731
|
+
const argCacheBuster = args._t;
|
|
732
|
+
if (argCacheBuster !== undefined)
|
|
733
|
+
query["_t"] = argCacheBuster;
|
|
581
734
|
const argMin = args.min;
|
|
582
735
|
if (argMin !== undefined)
|
|
583
736
|
query["min"] = argMin;
|
|
@@ -597,43 +750,59 @@ export class MiscApi {
|
|
|
597
750
|
if (argDecimalPlaces !== undefined)
|
|
598
751
|
query["decimal_places"] = argDecimalPlaces;
|
|
599
752
|
let requestPath = '/api/v1/misc/randomnumber';
|
|
600
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
753
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
601
754
|
}
|
|
602
755
|
/** 转换时间戳 (旧版,推荐使用/convert/unixtime) */
|
|
603
756
|
async getMiscTimestamp(args) {
|
|
604
757
|
const query = {};
|
|
605
758
|
const headers = {};
|
|
606
759
|
const body = {};
|
|
760
|
+
let disableCache;
|
|
761
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
762
|
+
const argCacheBuster = args._t;
|
|
763
|
+
if (argCacheBuster !== undefined)
|
|
764
|
+
query["_t"] = argCacheBuster;
|
|
607
765
|
const argTs = args.ts;
|
|
608
766
|
if (argTs !== undefined)
|
|
609
767
|
query["ts"] = argTs;
|
|
610
768
|
let requestPath = '/api/v1/misc/timestamp';
|
|
611
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
769
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
612
770
|
}
|
|
613
771
|
/** 获取支持的快递公司列表 */
|
|
614
772
|
async getMiscTrackingCarriers() {
|
|
615
773
|
const query = {};
|
|
616
774
|
const headers = {};
|
|
617
775
|
const body = {};
|
|
776
|
+
let disableCache;
|
|
618
777
|
let requestPath = '/api/v1/misc/tracking/carriers';
|
|
619
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
778
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
620
779
|
}
|
|
621
780
|
/** 识别快递公司 */
|
|
622
781
|
async getMiscTrackingDetect(args) {
|
|
623
782
|
const query = {};
|
|
624
783
|
const headers = {};
|
|
625
784
|
const body = {};
|
|
785
|
+
let disableCache;
|
|
786
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
787
|
+
const argCacheBuster = args._t;
|
|
788
|
+
if (argCacheBuster !== undefined)
|
|
789
|
+
query["_t"] = argCacheBuster;
|
|
626
790
|
const argTrackingNumber = args.trackingNumber ?? args["tracking_number"];
|
|
627
791
|
if (argTrackingNumber !== undefined)
|
|
628
792
|
query["tracking_number"] = argTrackingNumber;
|
|
629
793
|
let requestPath = '/api/v1/misc/tracking/detect';
|
|
630
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
794
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
631
795
|
}
|
|
632
796
|
/** 查询快递物流信息 */
|
|
633
797
|
async getMiscTrackingQuery(args) {
|
|
634
798
|
const query = {};
|
|
635
799
|
const headers = {};
|
|
636
800
|
const body = {};
|
|
801
|
+
let disableCache;
|
|
802
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
803
|
+
const argCacheBuster = args._t;
|
|
804
|
+
if (argCacheBuster !== undefined)
|
|
805
|
+
query["_t"] = argCacheBuster;
|
|
637
806
|
const argTrackingNumber = args.trackingNumber ?? args["tracking_number"];
|
|
638
807
|
if (argTrackingNumber !== undefined)
|
|
639
808
|
query["tracking_number"] = argTrackingNumber;
|
|
@@ -644,13 +813,18 @@ export class MiscApi {
|
|
|
644
813
|
if (argPhone !== undefined)
|
|
645
814
|
query["phone"] = argPhone;
|
|
646
815
|
let requestPath = '/api/v1/misc/tracking/query';
|
|
647
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
816
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
648
817
|
}
|
|
649
818
|
/** 查询天气 */
|
|
650
819
|
async getMiscWeather(args = {}) {
|
|
651
820
|
const query = {};
|
|
652
821
|
const headers = {};
|
|
653
822
|
const body = {};
|
|
823
|
+
let disableCache;
|
|
824
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
825
|
+
const argCacheBuster = args._t;
|
|
826
|
+
if (argCacheBuster !== undefined)
|
|
827
|
+
query["_t"] = argCacheBuster;
|
|
654
828
|
const argCity = args.city;
|
|
655
829
|
if (argCity !== undefined)
|
|
656
830
|
query["city"] = argCity;
|
|
@@ -676,24 +850,34 @@ export class MiscApi {
|
|
|
676
850
|
if (argLang !== undefined)
|
|
677
851
|
query["lang"] = argLang;
|
|
678
852
|
let requestPath = '/api/v1/misc/weather';
|
|
679
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
853
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
680
854
|
}
|
|
681
855
|
/** 查询世界时间 */
|
|
682
856
|
async getMiscWorldtime(args) {
|
|
683
857
|
const query = {};
|
|
684
858
|
const headers = {};
|
|
685
859
|
const body = {};
|
|
860
|
+
let disableCache;
|
|
861
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
862
|
+
const argCacheBuster = args._t;
|
|
863
|
+
if (argCacheBuster !== undefined)
|
|
864
|
+
query["_t"] = argCacheBuster;
|
|
686
865
|
const argCity = args.city;
|
|
687
866
|
if (argCity !== undefined)
|
|
688
867
|
query["city"] = argCity;
|
|
689
868
|
let requestPath = '/api/v1/misc/worldtime';
|
|
690
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
869
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
691
870
|
}
|
|
692
871
|
/** 计算两个日期之间的时间差值 */
|
|
693
872
|
async postMiscDateDiff(args) {
|
|
694
873
|
const query = {};
|
|
695
874
|
const headers = {};
|
|
696
875
|
const body = {};
|
|
876
|
+
let disableCache;
|
|
877
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
878
|
+
const argCacheBuster = args._t;
|
|
879
|
+
if (argCacheBuster !== undefined)
|
|
880
|
+
query["_t"] = argCacheBuster;
|
|
697
881
|
const argEndDate = args.endDate ?? args["end_date"];
|
|
698
882
|
if (argEndDate !== undefined)
|
|
699
883
|
body["end_date"] = argEndDate;
|
|
@@ -704,7 +888,7 @@ export class MiscApi {
|
|
|
704
888
|
if (argStartDate !== undefined)
|
|
705
889
|
body["start_date"] = argStartDate;
|
|
706
890
|
let requestPath = '/api/v1/misc/date-diff';
|
|
707
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
891
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
708
892
|
}
|
|
709
893
|
}
|
|
710
894
|
export class NetworkApi {
|
|
@@ -716,6 +900,11 @@ export class NetworkApi {
|
|
|
716
900
|
const query = {};
|
|
717
901
|
const headers = {};
|
|
718
902
|
const body = {};
|
|
903
|
+
let disableCache;
|
|
904
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
905
|
+
const argCacheBuster = args._t;
|
|
906
|
+
if (argCacheBuster !== undefined)
|
|
907
|
+
query["_t"] = argCacheBuster;
|
|
719
908
|
const argDomain = args.domain;
|
|
720
909
|
if (argDomain !== undefined)
|
|
721
910
|
query["domain"] = argDomain;
|
|
@@ -723,24 +912,34 @@ export class NetworkApi {
|
|
|
723
912
|
if (argType !== undefined)
|
|
724
913
|
query["type"] = argType;
|
|
725
914
|
let requestPath = '/api/v1/network/dns';
|
|
726
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
915
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
727
916
|
}
|
|
728
917
|
/** 查询域名ICP备案信息 */
|
|
729
918
|
async getNetworkIcp(args) {
|
|
730
919
|
const query = {};
|
|
731
920
|
const headers = {};
|
|
732
921
|
const body = {};
|
|
922
|
+
let disableCache;
|
|
923
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
924
|
+
const argCacheBuster = args._t;
|
|
925
|
+
if (argCacheBuster !== undefined)
|
|
926
|
+
query["_t"] = argCacheBuster;
|
|
733
927
|
const argDomain = args.domain;
|
|
734
928
|
if (argDomain !== undefined)
|
|
735
929
|
query["domain"] = argDomain;
|
|
736
930
|
let requestPath = '/api/v1/network/icp';
|
|
737
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
931
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
738
932
|
}
|
|
739
933
|
/** 查询 IP */
|
|
740
934
|
async getNetworkIpinfo(args) {
|
|
741
935
|
const query = {};
|
|
742
936
|
const headers = {};
|
|
743
937
|
const body = {};
|
|
938
|
+
let disableCache;
|
|
939
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
940
|
+
const argCacheBuster = args._t;
|
|
941
|
+
if (argCacheBuster !== undefined)
|
|
942
|
+
query["_t"] = argCacheBuster;
|
|
744
943
|
const argIp = args.ip;
|
|
745
944
|
if (argIp !== undefined)
|
|
746
945
|
query["ip"] = argIp;
|
|
@@ -748,43 +947,59 @@ export class NetworkApi {
|
|
|
748
947
|
if (argSource !== undefined)
|
|
749
948
|
query["source"] = argSource;
|
|
750
949
|
let requestPath = '/api/v1/network/ipinfo';
|
|
751
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
950
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
752
951
|
}
|
|
753
952
|
/** 查询我的 IP */
|
|
754
953
|
async getNetworkMyip(args = {}) {
|
|
755
954
|
const query = {};
|
|
756
955
|
const headers = {};
|
|
757
956
|
const body = {};
|
|
957
|
+
let disableCache;
|
|
958
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
959
|
+
const argCacheBuster = args._t;
|
|
960
|
+
if (argCacheBuster !== undefined)
|
|
961
|
+
query["_t"] = argCacheBuster;
|
|
758
962
|
const argSource = args.source;
|
|
759
963
|
if (argSource !== undefined)
|
|
760
964
|
query["source"] = argSource;
|
|
761
965
|
let requestPath = '/api/v1/network/myip';
|
|
762
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
966
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
763
967
|
}
|
|
764
968
|
/** Ping 主机 */
|
|
765
969
|
async getNetworkPing(args) {
|
|
766
970
|
const query = {};
|
|
767
971
|
const headers = {};
|
|
768
972
|
const body = {};
|
|
973
|
+
let disableCache;
|
|
974
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
975
|
+
const argCacheBuster = args._t;
|
|
976
|
+
if (argCacheBuster !== undefined)
|
|
977
|
+
query["_t"] = argCacheBuster;
|
|
769
978
|
const argHost = args.host;
|
|
770
979
|
if (argHost !== undefined)
|
|
771
980
|
query["host"] = argHost;
|
|
772
981
|
let requestPath = '/api/v1/network/ping';
|
|
773
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
982
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
774
983
|
}
|
|
775
984
|
/** Ping 我的 IP */
|
|
776
985
|
async getNetworkPingmyip() {
|
|
777
986
|
const query = {};
|
|
778
987
|
const headers = {};
|
|
779
988
|
const body = {};
|
|
989
|
+
let disableCache;
|
|
780
990
|
let requestPath = '/api/v1/network/pingmyip';
|
|
781
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
991
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
782
992
|
}
|
|
783
993
|
/** 端口扫描 */
|
|
784
994
|
async getNetworkPortscan(args) {
|
|
785
995
|
const query = {};
|
|
786
996
|
const headers = {};
|
|
787
997
|
const body = {};
|
|
998
|
+
let disableCache;
|
|
999
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1000
|
+
const argCacheBuster = args._t;
|
|
1001
|
+
if (argCacheBuster !== undefined)
|
|
1002
|
+
query["_t"] = argCacheBuster;
|
|
788
1003
|
const argHost = args.host;
|
|
789
1004
|
if (argHost !== undefined)
|
|
790
1005
|
query["host"] = argHost;
|
|
@@ -795,24 +1010,34 @@ export class NetworkApi {
|
|
|
795
1010
|
if (argProtocol !== undefined)
|
|
796
1011
|
query["protocol"] = argProtocol;
|
|
797
1012
|
let requestPath = '/api/v1/network/portscan';
|
|
798
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1013
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
799
1014
|
}
|
|
800
1015
|
/** 检查URL的可访问性状态 */
|
|
801
1016
|
async getNetworkUrlstatus(args) {
|
|
802
1017
|
const query = {};
|
|
803
1018
|
const headers = {};
|
|
804
1019
|
const body = {};
|
|
1020
|
+
let disableCache;
|
|
1021
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1022
|
+
const argCacheBuster = args._t;
|
|
1023
|
+
if (argCacheBuster !== undefined)
|
|
1024
|
+
query["_t"] = argCacheBuster;
|
|
805
1025
|
const argUrl = args.url;
|
|
806
1026
|
if (argUrl !== undefined)
|
|
807
1027
|
query["url"] = argUrl;
|
|
808
1028
|
let requestPath = '/api/v1/network/urlstatus';
|
|
809
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1029
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
810
1030
|
}
|
|
811
1031
|
/** 查询域名的WHOIS注册信息 */
|
|
812
1032
|
async getNetworkWhois(args) {
|
|
813
1033
|
const query = {};
|
|
814
1034
|
const headers = {};
|
|
815
1035
|
const body = {};
|
|
1036
|
+
let disableCache;
|
|
1037
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1038
|
+
const argCacheBuster = args._t;
|
|
1039
|
+
if (argCacheBuster !== undefined)
|
|
1040
|
+
query["_t"] = argCacheBuster;
|
|
816
1041
|
const argDomain = args.domain;
|
|
817
1042
|
if (argDomain !== undefined)
|
|
818
1043
|
query["domain"] = argDomain;
|
|
@@ -820,18 +1045,23 @@ export class NetworkApi {
|
|
|
820
1045
|
if (argFormat !== undefined)
|
|
821
1046
|
query["format"] = argFormat;
|
|
822
1047
|
let requestPath = '/api/v1/network/whois';
|
|
823
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1048
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
824
1049
|
}
|
|
825
1050
|
/** 检查域名在微信中的访问状态 */
|
|
826
1051
|
async getNetworkWxdomain(args) {
|
|
827
1052
|
const query = {};
|
|
828
1053
|
const headers = {};
|
|
829
1054
|
const body = {};
|
|
1055
|
+
let disableCache;
|
|
1056
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1057
|
+
const argCacheBuster = args._t;
|
|
1058
|
+
if (argCacheBuster !== undefined)
|
|
1059
|
+
query["_t"] = argCacheBuster;
|
|
830
1060
|
const argDomain = args.domain;
|
|
831
1061
|
if (argDomain !== undefined)
|
|
832
1062
|
query["domain"] = argDomain;
|
|
833
1063
|
let requestPath = '/api/v1/network/wxdomain';
|
|
834
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1064
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
835
1065
|
}
|
|
836
1066
|
}
|
|
837
1067
|
export class PoemApi {
|
|
@@ -843,8 +1073,9 @@ export class PoemApi {
|
|
|
843
1073
|
const query = {};
|
|
844
1074
|
const headers = {};
|
|
845
1075
|
const body = {};
|
|
1076
|
+
let disableCache;
|
|
846
1077
|
let requestPath = '/api/v1/saying';
|
|
847
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1078
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
848
1079
|
}
|
|
849
1080
|
}
|
|
850
1081
|
export class RandomApi {
|
|
@@ -856,17 +1087,27 @@ export class RandomApi {
|
|
|
856
1087
|
const query = {};
|
|
857
1088
|
const headers = {};
|
|
858
1089
|
const body = {};
|
|
1090
|
+
let disableCache;
|
|
1091
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1092
|
+
const argCacheBuster = args._t;
|
|
1093
|
+
if (argCacheBuster !== undefined)
|
|
1094
|
+
query["_t"] = argCacheBuster;
|
|
859
1095
|
const argQuestion = args.question;
|
|
860
1096
|
if (argQuestion !== undefined)
|
|
861
1097
|
query["question"] = argQuestion;
|
|
862
1098
|
let requestPath = '/api/v1/answerbook/ask';
|
|
863
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1099
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
864
1100
|
}
|
|
865
1101
|
/** 随机图片 */
|
|
866
1102
|
async getRandomImage(args = {}) {
|
|
867
1103
|
const query = {};
|
|
868
1104
|
const headers = {};
|
|
869
1105
|
const body = {};
|
|
1106
|
+
let disableCache;
|
|
1107
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1108
|
+
const argCacheBuster = args._t;
|
|
1109
|
+
if (argCacheBuster !== undefined)
|
|
1110
|
+
query["_t"] = argCacheBuster;
|
|
870
1111
|
const argCategory = args.category;
|
|
871
1112
|
if (argCategory !== undefined)
|
|
872
1113
|
query["category"] = argCategory;
|
|
@@ -874,13 +1115,18 @@ export class RandomApi {
|
|
|
874
1115
|
if (argType !== undefined)
|
|
875
1116
|
query["type"] = argType;
|
|
876
1117
|
let requestPath = '/api/v1/random/image';
|
|
877
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer');
|
|
1118
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'arrayBuffer', disableCache !== undefined ? { disableCache } : undefined);
|
|
878
1119
|
}
|
|
879
1120
|
/** 随机字符串 */
|
|
880
1121
|
async getRandomString(args = {}) {
|
|
881
1122
|
const query = {};
|
|
882
1123
|
const headers = {};
|
|
883
1124
|
const body = {};
|
|
1125
|
+
let disableCache;
|
|
1126
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1127
|
+
const argCacheBuster = args._t;
|
|
1128
|
+
if (argCacheBuster !== undefined)
|
|
1129
|
+
query["_t"] = argCacheBuster;
|
|
884
1130
|
const argLength = args.length;
|
|
885
1131
|
if (argLength !== undefined)
|
|
886
1132
|
query["length"] = argLength;
|
|
@@ -888,18 +1134,23 @@ export class RandomApi {
|
|
|
888
1134
|
if (argType !== undefined)
|
|
889
1135
|
query["type"] = argType;
|
|
890
1136
|
let requestPath = '/api/v1/random/string';
|
|
891
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1137
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
892
1138
|
}
|
|
893
1139
|
/** 答案之书 (POST) */
|
|
894
1140
|
async postAnswerbookAsk(args) {
|
|
895
1141
|
const query = {};
|
|
896
1142
|
const headers = {};
|
|
897
1143
|
const body = {};
|
|
1144
|
+
let disableCache;
|
|
1145
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1146
|
+
const argCacheBuster = args._t;
|
|
1147
|
+
if (argCacheBuster !== undefined)
|
|
1148
|
+
query["_t"] = argCacheBuster;
|
|
898
1149
|
const argQuestion = args.question;
|
|
899
1150
|
if (argQuestion !== undefined)
|
|
900
1151
|
body["question"] = argQuestion;
|
|
901
1152
|
let requestPath = '/api/v1/answerbook/ask';
|
|
902
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1153
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
903
1154
|
}
|
|
904
1155
|
}
|
|
905
1156
|
export class SocialApi {
|
|
@@ -911,17 +1162,27 @@ export class SocialApi {
|
|
|
911
1162
|
const query = {};
|
|
912
1163
|
const headers = {};
|
|
913
1164
|
const body = {};
|
|
1165
|
+
let disableCache;
|
|
1166
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1167
|
+
const argCacheBuster = args._t;
|
|
1168
|
+
if (argCacheBuster !== undefined)
|
|
1169
|
+
query["_t"] = argCacheBuster;
|
|
914
1170
|
const argRepo = args.repo;
|
|
915
1171
|
if (argRepo !== undefined)
|
|
916
1172
|
query["repo"] = argRepo;
|
|
917
1173
|
let requestPath = '/api/v1/github/repo';
|
|
918
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1174
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
919
1175
|
}
|
|
920
1176
|
/** 查询 B站投稿 */
|
|
921
1177
|
async getSocialBilibiliArchives(args) {
|
|
922
1178
|
const query = {};
|
|
923
1179
|
const headers = {};
|
|
924
1180
|
const body = {};
|
|
1181
|
+
let disableCache;
|
|
1182
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1183
|
+
const argCacheBuster = args._t;
|
|
1184
|
+
if (argCacheBuster !== undefined)
|
|
1185
|
+
query["_t"] = argCacheBuster;
|
|
925
1186
|
const argMid = args.mid;
|
|
926
1187
|
if (argMid !== undefined)
|
|
927
1188
|
query["mid"] = argMid;
|
|
@@ -938,13 +1199,18 @@ export class SocialApi {
|
|
|
938
1199
|
if (argPn !== undefined)
|
|
939
1200
|
query["pn"] = argPn;
|
|
940
1201
|
let requestPath = '/api/v1/social/bilibili/archives';
|
|
941
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1202
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
942
1203
|
}
|
|
943
1204
|
/** 查询 B站直播间 */
|
|
944
1205
|
async getSocialBilibiliLiveroom(args = {}) {
|
|
945
1206
|
const query = {};
|
|
946
1207
|
const headers = {};
|
|
947
1208
|
const body = {};
|
|
1209
|
+
let disableCache;
|
|
1210
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1211
|
+
const argCacheBuster = args._t;
|
|
1212
|
+
if (argCacheBuster !== undefined)
|
|
1213
|
+
query["_t"] = argCacheBuster;
|
|
948
1214
|
const argMid = args.mid;
|
|
949
1215
|
if (argMid !== undefined)
|
|
950
1216
|
query["mid"] = argMid;
|
|
@@ -952,13 +1218,18 @@ export class SocialApi {
|
|
|
952
1218
|
if (argRoomId !== undefined)
|
|
953
1219
|
query["room_id"] = argRoomId;
|
|
954
1220
|
let requestPath = '/api/v1/social/bilibili/liveroom';
|
|
955
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1221
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
956
1222
|
}
|
|
957
1223
|
/** 查询 B站评论 */
|
|
958
1224
|
async getSocialBilibiliReplies(args) {
|
|
959
1225
|
const query = {};
|
|
960
1226
|
const headers = {};
|
|
961
1227
|
const body = {};
|
|
1228
|
+
let disableCache;
|
|
1229
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1230
|
+
const argCacheBuster = args._t;
|
|
1231
|
+
if (argCacheBuster !== undefined)
|
|
1232
|
+
query["_t"] = argCacheBuster;
|
|
962
1233
|
const argOid = args.oid;
|
|
963
1234
|
if (argOid !== undefined)
|
|
964
1235
|
query["oid"] = argOid;
|
|
@@ -972,24 +1243,34 @@ export class SocialApi {
|
|
|
972
1243
|
if (argPn !== undefined)
|
|
973
1244
|
query["pn"] = argPn;
|
|
974
1245
|
let requestPath = '/api/v1/social/bilibili/replies';
|
|
975
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1246
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
976
1247
|
}
|
|
977
1248
|
/** 查询 B站用户 */
|
|
978
1249
|
async getSocialBilibiliUserinfo(args) {
|
|
979
1250
|
const query = {};
|
|
980
1251
|
const headers = {};
|
|
981
1252
|
const body = {};
|
|
1253
|
+
let disableCache;
|
|
1254
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1255
|
+
const argCacheBuster = args._t;
|
|
1256
|
+
if (argCacheBuster !== undefined)
|
|
1257
|
+
query["_t"] = argCacheBuster;
|
|
982
1258
|
const argUid = args.uid;
|
|
983
1259
|
if (argUid !== undefined)
|
|
984
1260
|
query["uid"] = argUid;
|
|
985
1261
|
let requestPath = '/api/v1/social/bilibili/userinfo';
|
|
986
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1262
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
987
1263
|
}
|
|
988
1264
|
/** 查询 B站视频 */
|
|
989
1265
|
async getSocialBilibiliVideoinfo(args = {}) {
|
|
990
1266
|
const query = {};
|
|
991
1267
|
const headers = {};
|
|
992
1268
|
const body = {};
|
|
1269
|
+
let disableCache;
|
|
1270
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1271
|
+
const argCacheBuster = args._t;
|
|
1272
|
+
if (argCacheBuster !== undefined)
|
|
1273
|
+
query["_t"] = argCacheBuster;
|
|
993
1274
|
const argAid = args.aid;
|
|
994
1275
|
if (argAid !== undefined)
|
|
995
1276
|
query["aid"] = argAid;
|
|
@@ -997,29 +1278,39 @@ export class SocialApi {
|
|
|
997
1278
|
if (argBvid !== undefined)
|
|
998
1279
|
query["bvid"] = argBvid;
|
|
999
1280
|
let requestPath = '/api/v1/social/bilibili/videoinfo';
|
|
1000
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1281
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1001
1282
|
}
|
|
1002
1283
|
/** 查询 QQ 群信息 */
|
|
1003
1284
|
async getSocialQqGroupinfo(args) {
|
|
1004
1285
|
const query = {};
|
|
1005
1286
|
const headers = {};
|
|
1006
1287
|
const body = {};
|
|
1288
|
+
let disableCache;
|
|
1289
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1290
|
+
const argCacheBuster = args._t;
|
|
1291
|
+
if (argCacheBuster !== undefined)
|
|
1292
|
+
query["_t"] = argCacheBuster;
|
|
1007
1293
|
const argGroupId = args.groupId ?? args["group_id"];
|
|
1008
1294
|
if (argGroupId !== undefined)
|
|
1009
1295
|
query["group_id"] = argGroupId;
|
|
1010
1296
|
let requestPath = '/api/v1/social/qq/groupinfo';
|
|
1011
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1297
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1012
1298
|
}
|
|
1013
1299
|
/** 查询 QQ 信息 */
|
|
1014
1300
|
async getSocialQqUserinfo(args) {
|
|
1015
1301
|
const query = {};
|
|
1016
1302
|
const headers = {};
|
|
1017
1303
|
const body = {};
|
|
1304
|
+
let disableCache;
|
|
1305
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1306
|
+
const argCacheBuster = args._t;
|
|
1307
|
+
if (argCacheBuster !== undefined)
|
|
1308
|
+
query["_t"] = argCacheBuster;
|
|
1018
1309
|
const argQq = args.qq;
|
|
1019
1310
|
if (argQq !== undefined)
|
|
1020
1311
|
query["qq"] = argQq;
|
|
1021
1312
|
let requestPath = '/api/v1/social/qq/userinfo';
|
|
1022
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1313
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1023
1314
|
}
|
|
1024
1315
|
}
|
|
1025
1316
|
export class StatusApi {
|
|
@@ -1031,22 +1322,32 @@ export class StatusApi {
|
|
|
1031
1322
|
const query = {};
|
|
1032
1323
|
const headers = {};
|
|
1033
1324
|
const body = {};
|
|
1325
|
+
let disableCache;
|
|
1326
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1327
|
+
const argCacheBuster = args._t;
|
|
1328
|
+
if (argCacheBuster !== undefined)
|
|
1329
|
+
query["_t"] = argCacheBuster;
|
|
1034
1330
|
const argAuthorization = args.authorization ?? args["Authorization"];
|
|
1035
1331
|
if (argAuthorization !== undefined)
|
|
1036
1332
|
headers["Authorization"] = String(argAuthorization);
|
|
1037
1333
|
let requestPath = '/api/v1/status/ratelimit';
|
|
1038
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1334
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1039
1335
|
}
|
|
1040
1336
|
/** 获取API端点使用统计 */
|
|
1041
1337
|
async getStatusUsage(args = {}) {
|
|
1042
1338
|
const query = {};
|
|
1043
1339
|
const headers = {};
|
|
1044
1340
|
const body = {};
|
|
1341
|
+
let disableCache;
|
|
1342
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1343
|
+
const argCacheBuster = args._t;
|
|
1344
|
+
if (argCacheBuster !== undefined)
|
|
1345
|
+
query["_t"] = argCacheBuster;
|
|
1045
1346
|
const argPath = args.path;
|
|
1046
1347
|
if (argPath !== undefined)
|
|
1047
1348
|
query["path"] = argPath;
|
|
1048
1349
|
let requestPath = '/api/v1/status/usage';
|
|
1049
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1350
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1050
1351
|
}
|
|
1051
1352
|
}
|
|
1052
1353
|
export class TextApi {
|
|
@@ -1058,17 +1359,27 @@ export class TextApi {
|
|
|
1058
1359
|
const query = {};
|
|
1059
1360
|
const headers = {};
|
|
1060
1361
|
const body = {};
|
|
1362
|
+
let disableCache;
|
|
1363
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1364
|
+
const argCacheBuster = args._t;
|
|
1365
|
+
if (argCacheBuster !== undefined)
|
|
1366
|
+
query["_t"] = argCacheBuster;
|
|
1061
1367
|
const argText = args.text;
|
|
1062
1368
|
if (argText !== undefined)
|
|
1063
1369
|
query["text"] = argText;
|
|
1064
1370
|
let requestPath = '/api/v1/text/md5';
|
|
1065
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1371
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1066
1372
|
}
|
|
1067
1373
|
/** AES 解密 */
|
|
1068
1374
|
async postTextAesDecrypt(args) {
|
|
1069
1375
|
const query = {};
|
|
1070
1376
|
const headers = {};
|
|
1071
1377
|
const body = {};
|
|
1378
|
+
let disableCache;
|
|
1379
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1380
|
+
const argCacheBuster = args._t;
|
|
1381
|
+
if (argCacheBuster !== undefined)
|
|
1382
|
+
query["_t"] = argCacheBuster;
|
|
1072
1383
|
const argKey = args.key;
|
|
1073
1384
|
if (argKey !== undefined)
|
|
1074
1385
|
body["key"] = argKey;
|
|
@@ -1079,13 +1390,18 @@ export class TextApi {
|
|
|
1079
1390
|
if (argText !== undefined)
|
|
1080
1391
|
body["text"] = argText;
|
|
1081
1392
|
let requestPath = '/api/v1/text/aes/decrypt';
|
|
1082
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1393
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1083
1394
|
}
|
|
1084
1395
|
/** AES高级解密 */
|
|
1085
1396
|
async postTextAesDecryptAdvanced(args) {
|
|
1086
1397
|
const query = {};
|
|
1087
1398
|
const headers = {};
|
|
1088
1399
|
const body = {};
|
|
1400
|
+
let disableCache;
|
|
1401
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1402
|
+
const argCacheBuster = args._t;
|
|
1403
|
+
if (argCacheBuster !== undefined)
|
|
1404
|
+
query["_t"] = argCacheBuster;
|
|
1089
1405
|
const argIv = args.iv;
|
|
1090
1406
|
if (argIv !== undefined)
|
|
1091
1407
|
body["iv"] = argIv;
|
|
@@ -1102,13 +1418,18 @@ export class TextApi {
|
|
|
1102
1418
|
if (argText !== undefined)
|
|
1103
1419
|
body["text"] = argText;
|
|
1104
1420
|
let requestPath = '/api/v1/text/aes/decrypt-advanced';
|
|
1105
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1421
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1106
1422
|
}
|
|
1107
1423
|
/** AES 加密 */
|
|
1108
1424
|
async postTextAesEncrypt(args) {
|
|
1109
1425
|
const query = {};
|
|
1110
1426
|
const headers = {};
|
|
1111
1427
|
const body = {};
|
|
1428
|
+
let disableCache;
|
|
1429
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1430
|
+
const argCacheBuster = args._t;
|
|
1431
|
+
if (argCacheBuster !== undefined)
|
|
1432
|
+
query["_t"] = argCacheBuster;
|
|
1112
1433
|
const argKey = args.key;
|
|
1113
1434
|
if (argKey !== undefined)
|
|
1114
1435
|
body["key"] = argKey;
|
|
@@ -1116,13 +1437,18 @@ export class TextApi {
|
|
|
1116
1437
|
if (argText !== undefined)
|
|
1117
1438
|
body["text"] = argText;
|
|
1118
1439
|
let requestPath = '/api/v1/text/aes/encrypt';
|
|
1119
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1440
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1120
1441
|
}
|
|
1121
1442
|
/** AES高级加密 */
|
|
1122
1443
|
async postTextAesEncryptAdvanced(args) {
|
|
1123
1444
|
const query = {};
|
|
1124
1445
|
const headers = {};
|
|
1125
1446
|
const body = {};
|
|
1447
|
+
let disableCache;
|
|
1448
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1449
|
+
const argCacheBuster = args._t;
|
|
1450
|
+
if (argCacheBuster !== undefined)
|
|
1451
|
+
query["_t"] = argCacheBuster;
|
|
1126
1452
|
const argIv = args.iv;
|
|
1127
1453
|
if (argIv !== undefined)
|
|
1128
1454
|
body["iv"] = argIv;
|
|
@@ -1142,46 +1468,66 @@ export class TextApi {
|
|
|
1142
1468
|
if (argText !== undefined)
|
|
1143
1469
|
body["text"] = argText;
|
|
1144
1470
|
let requestPath = '/api/v1/text/aes/encrypt-advanced';
|
|
1145
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1471
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1146
1472
|
}
|
|
1147
1473
|
/** 文本分析 */
|
|
1148
1474
|
async postTextAnalyze(args) {
|
|
1149
1475
|
const query = {};
|
|
1150
1476
|
const headers = {};
|
|
1151
1477
|
const body = {};
|
|
1478
|
+
let disableCache;
|
|
1479
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1480
|
+
const argCacheBuster = args._t;
|
|
1481
|
+
if (argCacheBuster !== undefined)
|
|
1482
|
+
query["_t"] = argCacheBuster;
|
|
1152
1483
|
const argText = args.text;
|
|
1153
1484
|
if (argText !== undefined)
|
|
1154
1485
|
body["text"] = argText;
|
|
1155
1486
|
let requestPath = '/api/v1/text/analyze';
|
|
1156
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1487
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1157
1488
|
}
|
|
1158
1489
|
/** Base64 解码 */
|
|
1159
1490
|
async postTextBase64Decode(args) {
|
|
1160
1491
|
const query = {};
|
|
1161
1492
|
const headers = {};
|
|
1162
1493
|
const body = {};
|
|
1494
|
+
let disableCache;
|
|
1495
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1496
|
+
const argCacheBuster = args._t;
|
|
1497
|
+
if (argCacheBuster !== undefined)
|
|
1498
|
+
query["_t"] = argCacheBuster;
|
|
1163
1499
|
const argText = args.text;
|
|
1164
1500
|
if (argText !== undefined)
|
|
1165
1501
|
body["text"] = argText;
|
|
1166
1502
|
let requestPath = '/api/v1/text/base64/decode';
|
|
1167
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1503
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1168
1504
|
}
|
|
1169
1505
|
/** Base64 编码 */
|
|
1170
1506
|
async postTextBase64Encode(args) {
|
|
1171
1507
|
const query = {};
|
|
1172
1508
|
const headers = {};
|
|
1173
1509
|
const body = {};
|
|
1510
|
+
let disableCache;
|
|
1511
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1512
|
+
const argCacheBuster = args._t;
|
|
1513
|
+
if (argCacheBuster !== undefined)
|
|
1514
|
+
query["_t"] = argCacheBuster;
|
|
1174
1515
|
const argText = args.text;
|
|
1175
1516
|
if (argText !== undefined)
|
|
1176
1517
|
body["text"] = argText;
|
|
1177
1518
|
let requestPath = '/api/v1/text/base64/encode';
|
|
1178
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1519
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1179
1520
|
}
|
|
1180
1521
|
/** 格式转换 */
|
|
1181
1522
|
async postTextConvert(args) {
|
|
1182
1523
|
const query = {};
|
|
1183
1524
|
const headers = {};
|
|
1184
1525
|
const body = {};
|
|
1526
|
+
let disableCache;
|
|
1527
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1528
|
+
const argCacheBuster = args._t;
|
|
1529
|
+
if (argCacheBuster !== undefined)
|
|
1530
|
+
query["_t"] = argCacheBuster;
|
|
1185
1531
|
const argFrom = args.from;
|
|
1186
1532
|
if (argFrom !== undefined)
|
|
1187
1533
|
body["from"] = argFrom;
|
|
@@ -1195,24 +1541,34 @@ export class TextApi {
|
|
|
1195
1541
|
if (argTo !== undefined)
|
|
1196
1542
|
body["to"] = argTo;
|
|
1197
1543
|
let requestPath = '/api/v1/text/convert';
|
|
1198
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1544
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1199
1545
|
}
|
|
1200
1546
|
/** MD5 哈希 (POST) */
|
|
1201
1547
|
async postTextMd5(args) {
|
|
1202
1548
|
const query = {};
|
|
1203
1549
|
const headers = {};
|
|
1204
1550
|
const body = {};
|
|
1551
|
+
let disableCache;
|
|
1552
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1553
|
+
const argCacheBuster = args._t;
|
|
1554
|
+
if (argCacheBuster !== undefined)
|
|
1555
|
+
query["_t"] = argCacheBuster;
|
|
1205
1556
|
const argText = args.text;
|
|
1206
1557
|
if (argText !== undefined)
|
|
1207
1558
|
body["text"] = argText;
|
|
1208
1559
|
let requestPath = '/api/v1/text/md5';
|
|
1209
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1560
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1210
1561
|
}
|
|
1211
1562
|
/** MD5 校验 */
|
|
1212
1563
|
async postTextMd5Verify(args) {
|
|
1213
1564
|
const query = {};
|
|
1214
1565
|
const headers = {};
|
|
1215
1566
|
const body = {};
|
|
1567
|
+
let disableCache;
|
|
1568
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1569
|
+
const argCacheBuster = args._t;
|
|
1570
|
+
if (argCacheBuster !== undefined)
|
|
1571
|
+
query["_t"] = argCacheBuster;
|
|
1216
1572
|
const argHash = args.hash;
|
|
1217
1573
|
if (argHash !== undefined)
|
|
1218
1574
|
body["hash"] = argHash;
|
|
@@ -1220,7 +1576,7 @@ export class TextApi {
|
|
|
1220
1576
|
if (argText !== undefined)
|
|
1221
1577
|
body["text"] = argText;
|
|
1222
1578
|
let requestPath = '/api/v1/text/md5/verify';
|
|
1223
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1579
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1224
1580
|
}
|
|
1225
1581
|
}
|
|
1226
1582
|
export class TranslateApi {
|
|
@@ -1232,14 +1588,20 @@ export class TranslateApi {
|
|
|
1232
1588
|
const query = {};
|
|
1233
1589
|
const headers = {};
|
|
1234
1590
|
const body = {};
|
|
1591
|
+
let disableCache;
|
|
1235
1592
|
let requestPath = '/api/v1/ai/translate/languages';
|
|
1236
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1593
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1237
1594
|
}
|
|
1238
1595
|
/** AI智能翻译 */
|
|
1239
1596
|
async postAiTranslate(args) {
|
|
1240
1597
|
const query = {};
|
|
1241
1598
|
const headers = {};
|
|
1242
1599
|
const body = {};
|
|
1600
|
+
let disableCache;
|
|
1601
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1602
|
+
const argCacheBuster = args._t;
|
|
1603
|
+
if (argCacheBuster !== undefined)
|
|
1604
|
+
query["_t"] = argCacheBuster;
|
|
1243
1605
|
const argTargetLang = args.targetLang ?? args["target_lang"];
|
|
1244
1606
|
if (argTargetLang !== undefined)
|
|
1245
1607
|
query["target_lang"] = argTargetLang;
|
|
@@ -1259,13 +1621,18 @@ export class TranslateApi {
|
|
|
1259
1621
|
if (argText !== undefined)
|
|
1260
1622
|
body["text"] = argText;
|
|
1261
1623
|
let requestPath = '/api/v1/ai/translate';
|
|
1262
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1624
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1263
1625
|
}
|
|
1264
1626
|
/** 流式翻译(中英互译) */
|
|
1265
1627
|
async postTranslateStream(args) {
|
|
1266
1628
|
const query = {};
|
|
1267
1629
|
const headers = {};
|
|
1268
1630
|
const body = {};
|
|
1631
|
+
let disableCache;
|
|
1632
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1633
|
+
const argCacheBuster = args._t;
|
|
1634
|
+
if (argCacheBuster !== undefined)
|
|
1635
|
+
query["_t"] = argCacheBuster;
|
|
1269
1636
|
const argFromLang = args.fromLang ?? args["from_lang"];
|
|
1270
1637
|
if (argFromLang !== undefined)
|
|
1271
1638
|
body["from_lang"] = argFromLang;
|
|
@@ -1279,13 +1646,18 @@ export class TranslateApi {
|
|
|
1279
1646
|
if (argTone !== undefined)
|
|
1280
1647
|
body["tone"] = argTone;
|
|
1281
1648
|
let requestPath = '/api/v1/translate/stream';
|
|
1282
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1649
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1283
1650
|
}
|
|
1284
1651
|
/** 翻译 */
|
|
1285
1652
|
async postTranslateText(args) {
|
|
1286
1653
|
const query = {};
|
|
1287
1654
|
const headers = {};
|
|
1288
1655
|
const body = {};
|
|
1656
|
+
let disableCache;
|
|
1657
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1658
|
+
const argCacheBuster = args._t;
|
|
1659
|
+
if (argCacheBuster !== undefined)
|
|
1660
|
+
query["_t"] = argCacheBuster;
|
|
1289
1661
|
const argToLang = args.toLang ?? args["to_lang"];
|
|
1290
1662
|
if (argToLang !== undefined)
|
|
1291
1663
|
query["to_lang"] = argToLang;
|
|
@@ -1293,7 +1665,7 @@ export class TranslateApi {
|
|
|
1293
1665
|
if (argText !== undefined)
|
|
1294
1666
|
body["text"] = argText;
|
|
1295
1667
|
let requestPath = '/api/v1/translate/text';
|
|
1296
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1668
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1297
1669
|
}
|
|
1298
1670
|
}
|
|
1299
1671
|
export class WebparseApi {
|
|
@@ -1305,44 +1677,64 @@ export class WebparseApi {
|
|
|
1305
1677
|
const query = {};
|
|
1306
1678
|
const headers = {};
|
|
1307
1679
|
const body = {};
|
|
1680
|
+
let disableCache;
|
|
1681
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1682
|
+
const argCacheBuster = args._t;
|
|
1683
|
+
if (argCacheBuster !== undefined)
|
|
1684
|
+
query["_t"] = argCacheBuster;
|
|
1308
1685
|
const argTaskId = args.taskId ?? args["task_id"];
|
|
1309
1686
|
let requestPath = '/api/v1/web/tomarkdown/async/{task_id}';
|
|
1310
1687
|
if (argTaskId !== undefined)
|
|
1311
1688
|
requestPath = requestPath.replace('{' + 'task_id' + '}', String(argTaskId));
|
|
1312
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1689
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1313
1690
|
}
|
|
1314
1691
|
/** 提取网页图片 */
|
|
1315
1692
|
async getWebparseExtractimages(args) {
|
|
1316
1693
|
const query = {};
|
|
1317
1694
|
const headers = {};
|
|
1318
1695
|
const body = {};
|
|
1696
|
+
let disableCache;
|
|
1697
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1698
|
+
const argCacheBuster = args._t;
|
|
1699
|
+
if (argCacheBuster !== undefined)
|
|
1700
|
+
query["_t"] = argCacheBuster;
|
|
1319
1701
|
const argUrl = args.url;
|
|
1320
1702
|
if (argUrl !== undefined)
|
|
1321
1703
|
query["url"] = argUrl;
|
|
1322
1704
|
let requestPath = '/api/v1/webparse/extractimages';
|
|
1323
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1705
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1324
1706
|
}
|
|
1325
1707
|
/** 提取网页元数据 */
|
|
1326
1708
|
async getWebparseMetadata(args) {
|
|
1327
1709
|
const query = {};
|
|
1328
1710
|
const headers = {};
|
|
1329
1711
|
const body = {};
|
|
1712
|
+
let disableCache;
|
|
1713
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1714
|
+
const argCacheBuster = args._t;
|
|
1715
|
+
if (argCacheBuster !== undefined)
|
|
1716
|
+
query["_t"] = argCacheBuster;
|
|
1330
1717
|
const argUrl = args.url;
|
|
1331
1718
|
if (argUrl !== undefined)
|
|
1332
1719
|
query["url"] = argUrl;
|
|
1333
1720
|
let requestPath = '/api/v1/webparse/metadata';
|
|
1334
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1721
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1335
1722
|
}
|
|
1336
1723
|
/** 网页转 Markdown */
|
|
1337
1724
|
async postWebTomarkdownAsync(args) {
|
|
1338
1725
|
const query = {};
|
|
1339
1726
|
const headers = {};
|
|
1340
1727
|
const body = {};
|
|
1728
|
+
let disableCache;
|
|
1729
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1730
|
+
const argCacheBuster = args._t;
|
|
1731
|
+
if (argCacheBuster !== undefined)
|
|
1732
|
+
query["_t"] = argCacheBuster;
|
|
1341
1733
|
const argUrl = args.url;
|
|
1342
1734
|
if (argUrl !== undefined)
|
|
1343
1735
|
query["url"] = argUrl;
|
|
1344
1736
|
let requestPath = '/api/v1/web/tomarkdown/async';
|
|
1345
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1737
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1346
1738
|
}
|
|
1347
1739
|
}
|
|
1348
1740
|
export class MinGanCiShiBieApi {
|
|
@@ -1354,33 +1746,48 @@ export class MinGanCiShiBieApi {
|
|
|
1354
1746
|
const query = {};
|
|
1355
1747
|
const headers = {};
|
|
1356
1748
|
const body = {};
|
|
1749
|
+
let disableCache;
|
|
1750
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1751
|
+
const argCacheBuster = args._t;
|
|
1752
|
+
if (argCacheBuster !== undefined)
|
|
1753
|
+
query["_t"] = argCacheBuster;
|
|
1357
1754
|
const argKeyword = args.keyword;
|
|
1358
1755
|
if (argKeyword !== undefined)
|
|
1359
1756
|
query["keyword"] = argKeyword;
|
|
1360
1757
|
let requestPath = '/api/v1/sensitive-word/analyze-query';
|
|
1361
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1758
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1362
1759
|
}
|
|
1363
1760
|
/** 分析敏感词 */
|
|
1364
1761
|
async postSensitiveWordAnalyze(args) {
|
|
1365
1762
|
const query = {};
|
|
1366
1763
|
const headers = {};
|
|
1367
1764
|
const body = {};
|
|
1765
|
+
let disableCache;
|
|
1766
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1767
|
+
const argCacheBuster = args._t;
|
|
1768
|
+
if (argCacheBuster !== undefined)
|
|
1769
|
+
query["_t"] = argCacheBuster;
|
|
1368
1770
|
const argKeywords = args.keywords;
|
|
1369
1771
|
if (argKeywords !== undefined)
|
|
1370
1772
|
body["keywords"] = argKeywords;
|
|
1371
1773
|
let requestPath = '/api/v1/sensitive-word/analyze';
|
|
1372
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1774
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1373
1775
|
}
|
|
1374
1776
|
/** 敏感词检测(快速) */
|
|
1375
1777
|
async postSensitiveWordQuickCheck(args) {
|
|
1376
1778
|
const query = {};
|
|
1377
1779
|
const headers = {};
|
|
1378
1780
|
const body = {};
|
|
1781
|
+
let disableCache;
|
|
1782
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1783
|
+
const argCacheBuster = args._t;
|
|
1784
|
+
if (argCacheBuster !== undefined)
|
|
1785
|
+
query["_t"] = argCacheBuster;
|
|
1379
1786
|
const argText = args.text;
|
|
1380
1787
|
if (argText !== undefined)
|
|
1381
1788
|
body["text"] = argText;
|
|
1382
1789
|
let requestPath = '/api/v1/text/profanitycheck';
|
|
1383
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1790
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1384
1791
|
}
|
|
1385
1792
|
}
|
|
1386
1793
|
export class ZhiNengSouSuoApi {
|
|
@@ -1392,14 +1799,20 @@ export class ZhiNengSouSuoApi {
|
|
|
1392
1799
|
const query = {};
|
|
1393
1800
|
const headers = {};
|
|
1394
1801
|
const body = {};
|
|
1802
|
+
let disableCache;
|
|
1395
1803
|
let requestPath = '/api/v1/search/engines';
|
|
1396
|
-
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1804
|
+
return await this.c._request('GET', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1397
1805
|
}
|
|
1398
1806
|
/** 智能搜索 */
|
|
1399
1807
|
async postSearchAggregate(args) {
|
|
1400
1808
|
const query = {};
|
|
1401
1809
|
const headers = {};
|
|
1402
1810
|
const body = {};
|
|
1811
|
+
let disableCache;
|
|
1812
|
+
disableCache = args.disableCache ?? args["disable_cache"];
|
|
1813
|
+
const argCacheBuster = args._t;
|
|
1814
|
+
if (argCacheBuster !== undefined)
|
|
1815
|
+
query["_t"] = argCacheBuster;
|
|
1403
1816
|
const argFetchFull = args.fetchFull ?? args["fetch_full"];
|
|
1404
1817
|
if (argFetchFull !== undefined)
|
|
1405
1818
|
body["fetch_full"] = argFetchFull;
|
|
@@ -1422,6 +1835,6 @@ export class ZhiNengSouSuoApi {
|
|
|
1422
1835
|
if (argTimeoutMs !== undefined)
|
|
1423
1836
|
body["timeout_ms"] = argTimeoutMs;
|
|
1424
1837
|
let requestPath = '/api/v1/search/aggregate';
|
|
1425
|
-
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json');
|
|
1838
|
+
return await this.c._request('POST', requestPath, Object.keys(query).length > 0 ? query : undefined, Object.keys(body).length > 0 ? body : undefined, Object.keys(headers).length > 0 ? headers : undefined, 'json', disableCache !== undefined ? { disableCache } : undefined);
|
|
1426
1839
|
}
|
|
1427
1840
|
}
|