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