uapi-browser-sdk 0.1.3 → 0.1.4
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 +55 -55
- package/dist/index.d.ts +4 -0
- package/dist/index.js +314 -78
- package/internal/.openapi-generator/FILES +563 -563
- package/package.json +11 -13
- package/src/index.ts +751 -582
package/src/index.ts
CHANGED
|
@@ -1,582 +1,751 @@
|
|
|
1
|
-
export class UapiError extends Error {
|
|
2
|
-
constructor(public code: string, public status: number, public details?: any) {
|
|
3
|
-
super(`${status} ${code}`)
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export class UapiClient {
|
|
8
|
-
constructor(private baseURL: string, private token?: string) {
|
|
9
|
-
;(this as any)["Clipzy 在线剪贴板"] = this.clipzyZaiXianJianTieBan
|
|
10
|
-
;(this as any)["Convert"] = this.convert
|
|
11
|
-
;(this as any)["Daily"] = this.daily
|
|
12
|
-
;(this as any)["Game"] = this.game
|
|
13
|
-
;(this as any)["Image"] = this.image
|
|
14
|
-
;(this as any)["Misc"] = this.misc
|
|
15
|
-
;(this as any)["Network"] = this.network
|
|
16
|
-
;(this as any)["Poem"] = this.poem
|
|
17
|
-
;(this as any)["Random"] = this.random
|
|
18
|
-
;(this as any)["Social"] = this.social
|
|
19
|
-
;(this as any)["Status"] = this.status
|
|
20
|
-
;(this as any)["Text"] = this.text
|
|
21
|
-
;(this as any)["Translate"] = this.translate
|
|
22
|
-
;(this as any)["WebParse"] = this.webparse
|
|
23
|
-
;(this as any)["敏感词识别"] = this.minGanCiShiBie
|
|
24
|
-
;(this as any)["智能搜索"] = this.zhiNengSouSuo
|
|
25
|
-
}
|
|
26
|
-
clipzyZaiXianJianTieBan = new ClipzyZaiXianJianTieBanApi(this)
|
|
27
|
-
convert = new ConvertApi(this)
|
|
28
|
-
daily = new DailyApi(this)
|
|
29
|
-
game = new GameApi(this)
|
|
30
|
-
image = new ImageApi(this)
|
|
31
|
-
misc = new MiscApi(this)
|
|
32
|
-
network = new NetworkApi(this)
|
|
33
|
-
poem = new PoemApi(this)
|
|
34
|
-
random = new RandomApi(this)
|
|
35
|
-
social = new SocialApi(this)
|
|
36
|
-
status = new StatusApi(this)
|
|
37
|
-
text = new TextApi(this)
|
|
38
|
-
translate = new TranslateApi(this)
|
|
39
|
-
webparse = new WebparseApi(this)
|
|
40
|
-
minGanCiShiBie = new MinGanCiShiBieApi(this)
|
|
41
|
-
zhiNengSouSuo = new ZhiNengSouSuoApi(this)
|
|
42
|
-
async _request(method: string, path: string, params?: Record<string,any>, body?: any) {
|
|
43
|
-
const url = new URL(this.baseURL.replace(/\/$/, '') + path)
|
|
44
|
-
if (params) Object.entries(params).forEach(([k,v]) => url.searchParams.set(k, String(v)))
|
|
45
|
-
const res = await fetch(url.toString(), { method, headers: { 'Content-Type':'application/json', ...(this.token ? { Authorization: `Bearer ${this.token}` } : {}) }, body: body ? JSON.stringify(body) : undefined })
|
|
46
|
-
if (!res.ok) {
|
|
47
|
-
let data:any=null; try { data = await res.json() } catch {}
|
|
48
|
-
const code = (data?.code || 'API_ERROR').toUpperCase()
|
|
49
|
-
throw new UapiError(code, res.status, data?.details)
|
|
50
|
-
}
|
|
51
|
-
const ct = res.headers.get('content-type') || ''
|
|
52
|
-
return ct.includes('application/json') ? res.json() : res.arrayBuffer()
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
class ClipzyZaiXianJianTieBanApi {
|
|
56
|
-
constructor(private c: UapiClient) {}
|
|
57
|
-
async getClipzyGet(args: any = {}): Promise<any> {
|
|
58
|
-
const params:any = {}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (args[
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
let path = '/api/v1/
|
|
95
|
-
return this.c._request('
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
class
|
|
99
|
-
constructor(private c: UapiClient) {}
|
|
100
|
-
async
|
|
101
|
-
const params:any = {}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (args["
|
|
120
|
-
let path = '/api/v1/game/minecraft/
|
|
121
|
-
return this.c._request('GET', path, params)
|
|
122
|
-
}
|
|
123
|
-
async
|
|
124
|
-
const params:any = {}
|
|
125
|
-
|
|
126
|
-
if (args["
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if (args["
|
|
141
|
-
if (args["
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
async
|
|
151
|
-
const params:any = {}
|
|
152
|
-
|
|
153
|
-
if (args["
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
if (args["format"] !== undefined) params["format"] = args["format"]
|
|
196
|
-
if (args["
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
if (args["
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
if (args["
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
if (args["
|
|
243
|
-
let path = '/api/v1/
|
|
244
|
-
return this.c._request('GET', path, params)
|
|
245
|
-
}
|
|
246
|
-
async
|
|
247
|
-
const params:any = {}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
if (args["
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
if (args["
|
|
303
|
-
let path = '/api/v1/
|
|
304
|
-
return this.c._request('GET', path, params)
|
|
305
|
-
}
|
|
306
|
-
async
|
|
307
|
-
const params:any = {}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
let path = '/api/v1/
|
|
315
|
-
return this.c._request('GET', path, params)
|
|
316
|
-
}
|
|
317
|
-
async
|
|
318
|
-
const params:any = {}
|
|
319
|
-
|
|
320
|
-
if (args["
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
const
|
|
327
|
-
if (args["
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
if (args["
|
|
341
|
-
let path = '/api/v1/network/
|
|
342
|
-
return this.c._request('GET', path, params)
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
const
|
|
391
|
-
if (args["
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
let path = '/api/v1/
|
|
471
|
-
return this.c._request('
|
|
472
|
-
}
|
|
473
|
-
async
|
|
474
|
-
const params:any = {}
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
let path = '/api/v1/
|
|
496
|
-
return this.c._request('
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
let path = '/api/v1/
|
|
504
|
-
return this.c._request('GET', path, params)
|
|
505
|
-
}
|
|
506
|
-
async
|
|
507
|
-
const params:any = {}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
1
|
+
export class UapiError extends Error {
|
|
2
|
+
constructor(public code: string, public status: number, public details?: any) {
|
|
3
|
+
super(`${status} ${code}`)
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export class UapiClient {
|
|
8
|
+
constructor(private baseURL: string, private token?: string) {
|
|
9
|
+
;(this as any)["Clipzy 在线剪贴板"] = this.clipzyZaiXianJianTieBan
|
|
10
|
+
;(this as any)["Convert"] = this.convert
|
|
11
|
+
;(this as any)["Daily"] = this.daily
|
|
12
|
+
;(this as any)["Game"] = this.game
|
|
13
|
+
;(this as any)["Image"] = this.image
|
|
14
|
+
;(this as any)["Misc"] = this.misc
|
|
15
|
+
;(this as any)["Network"] = this.network
|
|
16
|
+
;(this as any)["Poem"] = this.poem
|
|
17
|
+
;(this as any)["Random"] = this.random
|
|
18
|
+
;(this as any)["Social"] = this.social
|
|
19
|
+
;(this as any)["Status"] = this.status
|
|
20
|
+
;(this as any)["Text"] = this.text
|
|
21
|
+
;(this as any)["Translate"] = this.translate
|
|
22
|
+
;(this as any)["WebParse"] = this.webparse
|
|
23
|
+
;(this as any)["敏感词识别"] = this.minGanCiShiBie
|
|
24
|
+
;(this as any)["智能搜索"] = this.zhiNengSouSuo
|
|
25
|
+
}
|
|
26
|
+
clipzyZaiXianJianTieBan = new ClipzyZaiXianJianTieBanApi(this)
|
|
27
|
+
convert = new ConvertApi(this)
|
|
28
|
+
daily = new DailyApi(this)
|
|
29
|
+
game = new GameApi(this)
|
|
30
|
+
image = new ImageApi(this)
|
|
31
|
+
misc = new MiscApi(this)
|
|
32
|
+
network = new NetworkApi(this)
|
|
33
|
+
poem = new PoemApi(this)
|
|
34
|
+
random = new RandomApi(this)
|
|
35
|
+
social = new SocialApi(this)
|
|
36
|
+
status = new StatusApi(this)
|
|
37
|
+
text = new TextApi(this)
|
|
38
|
+
translate = new TranslateApi(this)
|
|
39
|
+
webparse = new WebparseApi(this)
|
|
40
|
+
minGanCiShiBie = new MinGanCiShiBieApi(this)
|
|
41
|
+
zhiNengSouSuo = new ZhiNengSouSuoApi(this)
|
|
42
|
+
async _request(method: string, path: string, params?: Record<string,any>, body?: any) {
|
|
43
|
+
const url = new URL(this.baseURL.replace(/\/$/, '') + path)
|
|
44
|
+
if (params) Object.entries(params).forEach(([k,v]) => url.searchParams.set(k, String(v)))
|
|
45
|
+
const res = await fetch(url.toString(), { method, headers: { 'Content-Type':'application/json', ...(this.token ? { Authorization: `Bearer ${this.token}` } : {}) }, body: body ? JSON.stringify(body) : undefined })
|
|
46
|
+
if (!res.ok) {
|
|
47
|
+
let data:any=null; try { data = await res.json() } catch {}
|
|
48
|
+
const code = (data?.code || 'API_ERROR').toUpperCase()
|
|
49
|
+
throw new UapiError(code, res.status, data?.details)
|
|
50
|
+
}
|
|
51
|
+
const ct = res.headers.get('content-type') || ''
|
|
52
|
+
return ct.includes('application/json') ? res.json() : res.arrayBuffer()
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class ClipzyZaiXianJianTieBanApi {
|
|
56
|
+
constructor(private c: UapiClient) {}
|
|
57
|
+
async getClipzyGet(args: any = {}): Promise<any> {
|
|
58
|
+
const params:any = {}
|
|
59
|
+
const body:any = {}
|
|
60
|
+
if (args["id"] !== undefined) params["id"] = args["id"]
|
|
61
|
+
let path = '/api/v1/api/get'
|
|
62
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
63
|
+
}
|
|
64
|
+
async getClipzyRaw(args: any = {}): Promise<any> {
|
|
65
|
+
const params:any = {}
|
|
66
|
+
const body:any = {}
|
|
67
|
+
if (args["key"] !== undefined) params["key"] = args["key"]
|
|
68
|
+
let path = '/api/v1/api/raw/{id}'
|
|
69
|
+
if (args['id'] !== undefined) path = path.replace('{' + 'id' + '}', String(args['id']))
|
|
70
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
71
|
+
}
|
|
72
|
+
async postClipzyStore(args: any = {}): Promise<any> {
|
|
73
|
+
const params:any = {}
|
|
74
|
+
const body:any = {}
|
|
75
|
+
if (args["compressedData"] !== undefined) body["compressedData"] = args["compressedData"]
|
|
76
|
+
if (args["ttl"] !== undefined) body["ttl"] = args["ttl"]
|
|
77
|
+
let path = '/api/v1/api/store'
|
|
78
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
class ConvertApi {
|
|
82
|
+
constructor(private c: UapiClient) {}
|
|
83
|
+
async getConvertUnixtime(args: any = {}): Promise<any> {
|
|
84
|
+
const params:any = {}
|
|
85
|
+
const body:any = {}
|
|
86
|
+
if (args["time"] !== undefined) params["time"] = args["time"]
|
|
87
|
+
let path = '/api/v1/convert/unixtime'
|
|
88
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
89
|
+
}
|
|
90
|
+
async postConvertJson(args: any = {}): Promise<any> {
|
|
91
|
+
const params:any = {}
|
|
92
|
+
const body:any = {}
|
|
93
|
+
if (args["content"] !== undefined) body["content"] = args["content"]
|
|
94
|
+
let path = '/api/v1/convert/json'
|
|
95
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
class DailyApi {
|
|
99
|
+
constructor(private c: UapiClient) {}
|
|
100
|
+
async getDailyNewsImage(args: any = {}): Promise<any> {
|
|
101
|
+
const params:any = {}
|
|
102
|
+
const body:any = {}
|
|
103
|
+
let path = '/api/v1/daily/news-image'
|
|
104
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
class GameApi {
|
|
108
|
+
constructor(private c: UapiClient) {}
|
|
109
|
+
async getGameEpicFree(args: any = {}): Promise<any> {
|
|
110
|
+
const params:any = {}
|
|
111
|
+
const body:any = {}
|
|
112
|
+
let path = '/api/v1/game/epic-free'
|
|
113
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
114
|
+
}
|
|
115
|
+
async getGameMinecraftHistoryid(args: any = {}): Promise<any> {
|
|
116
|
+
const params:any = {}
|
|
117
|
+
const body:any = {}
|
|
118
|
+
if (args["name"] !== undefined) params["name"] = args["name"]
|
|
119
|
+
if (args["uuid"] !== undefined) params["uuid"] = args["uuid"]
|
|
120
|
+
let path = '/api/v1/game/minecraft/historyid'
|
|
121
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
122
|
+
}
|
|
123
|
+
async getGameMinecraftServerstatus(args: any = {}): Promise<any> {
|
|
124
|
+
const params:any = {}
|
|
125
|
+
const body:any = {}
|
|
126
|
+
if (args["server"] !== undefined) params["server"] = args["server"]
|
|
127
|
+
let path = '/api/v1/game/minecraft/serverstatus'
|
|
128
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
129
|
+
}
|
|
130
|
+
async getGameMinecraftUserinfo(args: any = {}): Promise<any> {
|
|
131
|
+
const params:any = {}
|
|
132
|
+
const body:any = {}
|
|
133
|
+
if (args["username"] !== undefined) params["username"] = args["username"]
|
|
134
|
+
let path = '/api/v1/game/minecraft/userinfo'
|
|
135
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
136
|
+
}
|
|
137
|
+
async getGameSteamSummary(args: any = {}): Promise<any> {
|
|
138
|
+
const params:any = {}
|
|
139
|
+
const body:any = {}
|
|
140
|
+
if (args["steamid"] !== undefined) params["steamid"] = args["steamid"]
|
|
141
|
+
if (args["id"] !== undefined) params["id"] = args["id"]
|
|
142
|
+
if (args["id3"] !== undefined) params["id3"] = args["id3"]
|
|
143
|
+
if (args["key"] !== undefined) params["key"] = args["key"]
|
|
144
|
+
let path = '/api/v1/game/steam/summary'
|
|
145
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
class ImageApi {
|
|
149
|
+
constructor(private c: UapiClient) {}
|
|
150
|
+
async getAvatarGravatar(args: any = {}): Promise<any> {
|
|
151
|
+
const params:any = {}
|
|
152
|
+
const body:any = {}
|
|
153
|
+
if (args["email"] !== undefined) params["email"] = args["email"]
|
|
154
|
+
if (args["hash"] !== undefined) params["hash"] = args["hash"]
|
|
155
|
+
if (args["s"] !== undefined) params["s"] = args["s"]
|
|
156
|
+
if (args["d"] !== undefined) params["d"] = args["d"]
|
|
157
|
+
if (args["r"] !== undefined) params["r"] = args["r"]
|
|
158
|
+
let path = '/api/v1/avatar/gravatar'
|
|
159
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
160
|
+
}
|
|
161
|
+
async getImageBingDaily(args: any = {}): Promise<any> {
|
|
162
|
+
const params:any = {}
|
|
163
|
+
const body:any = {}
|
|
164
|
+
let path = '/api/v1/image/bing-daily'
|
|
165
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
166
|
+
}
|
|
167
|
+
async getImageMotou(args: any = {}): Promise<any> {
|
|
168
|
+
const params:any = {}
|
|
169
|
+
const body:any = {}
|
|
170
|
+
if (args["qq"] !== undefined) params["qq"] = args["qq"]
|
|
171
|
+
if (args["bg_color"] !== undefined) params["bg_color"] = args["bg_color"]
|
|
172
|
+
let path = '/api/v1/image/motou'
|
|
173
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
174
|
+
}
|
|
175
|
+
async getImageQrcode(args: any = {}): Promise<any> {
|
|
176
|
+
const params:any = {}
|
|
177
|
+
const body:any = {}
|
|
178
|
+
if (args["text"] !== undefined) params["text"] = args["text"]
|
|
179
|
+
if (args["size"] !== undefined) params["size"] = args["size"]
|
|
180
|
+
if (args["format"] !== undefined) params["format"] = args["format"]
|
|
181
|
+
let path = '/api/v1/image/qrcode'
|
|
182
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
183
|
+
}
|
|
184
|
+
async getImageTobase64(args: any = {}): Promise<any> {
|
|
185
|
+
const params:any = {}
|
|
186
|
+
const body:any = {}
|
|
187
|
+
if (args["url"] !== undefined) params["url"] = args["url"]
|
|
188
|
+
let path = '/api/v1/image/tobase64'
|
|
189
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
190
|
+
}
|
|
191
|
+
async postImageCompress(args: any = {}): Promise<any> {
|
|
192
|
+
const params:any = {}
|
|
193
|
+
const body:any = {}
|
|
194
|
+
if (args["level"] !== undefined) params["level"] = args["level"]
|
|
195
|
+
if (args["format"] !== undefined) params["format"] = args["format"]
|
|
196
|
+
if (args["file"] !== undefined) body["file"] = args["file"]
|
|
197
|
+
let path = '/api/v1/image/compress'
|
|
198
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
199
|
+
}
|
|
200
|
+
async postImageFrombase64(args: any = {}): Promise<any> {
|
|
201
|
+
const params:any = {}
|
|
202
|
+
const body:any = {}
|
|
203
|
+
if (args["imageData"] !== undefined) body["imageData"] = args["imageData"]
|
|
204
|
+
let path = '/api/v1/image/frombase64'
|
|
205
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
206
|
+
}
|
|
207
|
+
async postImageMotou(args: any = {}): Promise<any> {
|
|
208
|
+
const params:any = {}
|
|
209
|
+
const body:any = {}
|
|
210
|
+
if (args["bg_color"] !== undefined) body["bg_color"] = args["bg_color"]
|
|
211
|
+
if (args["file"] !== undefined) body["file"] = args["file"]
|
|
212
|
+
if (args["image_url"] !== undefined) body["image_url"] = args["image_url"]
|
|
213
|
+
let path = '/api/v1/image/motou'
|
|
214
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
215
|
+
}
|
|
216
|
+
async postImageSpeechless(args: any = {}): Promise<any> {
|
|
217
|
+
const params:any = {}
|
|
218
|
+
const body:any = {}
|
|
219
|
+
if (args["bottom_text"] !== undefined) body["bottom_text"] = args["bottom_text"]
|
|
220
|
+
if (args["top_text"] !== undefined) body["top_text"] = args["top_text"]
|
|
221
|
+
let path = '/api/v1/image/speechless'
|
|
222
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
223
|
+
}
|
|
224
|
+
async postImageSvg(args: any = {}): Promise<any> {
|
|
225
|
+
const params:any = {}
|
|
226
|
+
const body:any = {}
|
|
227
|
+
if (args["format"] !== undefined) params["format"] = args["format"]
|
|
228
|
+
if (args["width"] !== undefined) params["width"] = args["width"]
|
|
229
|
+
if (args["height"] !== undefined) params["height"] = args["height"]
|
|
230
|
+
if (args["quality"] !== undefined) params["quality"] = args["quality"]
|
|
231
|
+
if (args["file"] !== undefined) body["file"] = args["file"]
|
|
232
|
+
let path = '/api/v1/image/svg'
|
|
233
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
class MiscApi {
|
|
237
|
+
constructor(private c: UapiClient) {}
|
|
238
|
+
async getHistoryProgrammer(args: any = {}): Promise<any> {
|
|
239
|
+
const params:any = {}
|
|
240
|
+
const body:any = {}
|
|
241
|
+
if (args["month"] !== undefined) params["month"] = args["month"]
|
|
242
|
+
if (args["day"] !== undefined) params["day"] = args["day"]
|
|
243
|
+
let path = '/api/v1/history/programmer'
|
|
244
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
245
|
+
}
|
|
246
|
+
async getHistoryProgrammerToday(args: any = {}): Promise<any> {
|
|
247
|
+
const params:any = {}
|
|
248
|
+
const body:any = {}
|
|
249
|
+
let path = '/api/v1/history/programmer/today'
|
|
250
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
251
|
+
}
|
|
252
|
+
async getMiscHotboard(args: any = {}): Promise<any> {
|
|
253
|
+
const params:any = {}
|
|
254
|
+
const body:any = {}
|
|
255
|
+
if (args["type"] !== undefined) params["type"] = args["type"]
|
|
256
|
+
let path = '/api/v1/misc/hotboard'
|
|
257
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
258
|
+
}
|
|
259
|
+
async getMiscPhoneinfo(args: any = {}): Promise<any> {
|
|
260
|
+
const params:any = {}
|
|
261
|
+
const body:any = {}
|
|
262
|
+
if (args["phone"] !== undefined) params["phone"] = args["phone"]
|
|
263
|
+
let path = '/api/v1/misc/phoneinfo'
|
|
264
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
265
|
+
}
|
|
266
|
+
async getMiscRandomnumber(args: any = {}): Promise<any> {
|
|
267
|
+
const params:any = {}
|
|
268
|
+
const body:any = {}
|
|
269
|
+
if (args["min"] !== undefined) params["min"] = args["min"]
|
|
270
|
+
if (args["max"] !== undefined) params["max"] = args["max"]
|
|
271
|
+
if (args["count"] !== undefined) params["count"] = args["count"]
|
|
272
|
+
if (args["allow_repeat"] !== undefined) params["allow_repeat"] = args["allow_repeat"]
|
|
273
|
+
if (args["allow_decimal"] !== undefined) params["allow_decimal"] = args["allow_decimal"]
|
|
274
|
+
if (args["decimal_places"] !== undefined) params["decimal_places"] = args["decimal_places"]
|
|
275
|
+
let path = '/api/v1/misc/randomnumber'
|
|
276
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
277
|
+
}
|
|
278
|
+
async getMiscTimestamp(args: any = {}): Promise<any> {
|
|
279
|
+
const params:any = {}
|
|
280
|
+
const body:any = {}
|
|
281
|
+
if (args["ts"] !== undefined) params["ts"] = args["ts"]
|
|
282
|
+
let path = '/api/v1/misc/timestamp'
|
|
283
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
284
|
+
}
|
|
285
|
+
async getMiscTrackingCarriers(args: any = {}): Promise<any> {
|
|
286
|
+
const params:any = {}
|
|
287
|
+
const body:any = {}
|
|
288
|
+
let path = '/api/v1/misc/tracking/carriers'
|
|
289
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
290
|
+
}
|
|
291
|
+
async getMiscTrackingDetect(args: any = {}): Promise<any> {
|
|
292
|
+
const params:any = {}
|
|
293
|
+
const body:any = {}
|
|
294
|
+
if (args["tracking_number"] !== undefined) params["tracking_number"] = args["tracking_number"]
|
|
295
|
+
let path = '/api/v1/misc/tracking/detect'
|
|
296
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
297
|
+
}
|
|
298
|
+
async getMiscTrackingQuery(args: any = {}): Promise<any> {
|
|
299
|
+
const params:any = {}
|
|
300
|
+
const body:any = {}
|
|
301
|
+
if (args["tracking_number"] !== undefined) params["tracking_number"] = args["tracking_number"]
|
|
302
|
+
if (args["carrier_code"] !== undefined) params["carrier_code"] = args["carrier_code"]
|
|
303
|
+
let path = '/api/v1/misc/tracking/query'
|
|
304
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
305
|
+
}
|
|
306
|
+
async getMiscWeather(args: any = {}): Promise<any> {
|
|
307
|
+
const params:any = {}
|
|
308
|
+
const body:any = {}
|
|
309
|
+
if (args["city"] !== undefined) params["city"] = args["city"]
|
|
310
|
+
if (args["adcode"] !== undefined) params["adcode"] = args["adcode"]
|
|
311
|
+
if (args["extended"] !== undefined) params["extended"] = args["extended"]
|
|
312
|
+
if (args["indices"] !== undefined) params["indices"] = args["indices"]
|
|
313
|
+
if (args["forecast"] !== undefined) params["forecast"] = args["forecast"]
|
|
314
|
+
let path = '/api/v1/misc/weather'
|
|
315
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
316
|
+
}
|
|
317
|
+
async getMiscWorldtime(args: any = {}): Promise<any> {
|
|
318
|
+
const params:any = {}
|
|
319
|
+
const body:any = {}
|
|
320
|
+
if (args["city"] !== undefined) params["city"] = args["city"]
|
|
321
|
+
let path = '/api/v1/misc/worldtime'
|
|
322
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
323
|
+
}
|
|
324
|
+
async postMiscDateDiff(args: any = {}): Promise<any> {
|
|
325
|
+
const params:any = {}
|
|
326
|
+
const body:any = {}
|
|
327
|
+
if (args["end_date"] !== undefined) body["end_date"] = args["end_date"]
|
|
328
|
+
if (args["format"] !== undefined) body["format"] = args["format"]
|
|
329
|
+
if (args["start_date"] !== undefined) body["start_date"] = args["start_date"]
|
|
330
|
+
let path = '/api/v1/misc/date-diff'
|
|
331
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
class NetworkApi {
|
|
335
|
+
constructor(private c: UapiClient) {}
|
|
336
|
+
async getNetworkDns(args: any = {}): Promise<any> {
|
|
337
|
+
const params:any = {}
|
|
338
|
+
const body:any = {}
|
|
339
|
+
if (args["domain"] !== undefined) params["domain"] = args["domain"]
|
|
340
|
+
if (args["type"] !== undefined) params["type"] = args["type"]
|
|
341
|
+
let path = '/api/v1/network/dns'
|
|
342
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
343
|
+
}
|
|
344
|
+
async getNetworkIcp(args: any = {}): Promise<any> {
|
|
345
|
+
const params:any = {}
|
|
346
|
+
const body:any = {}
|
|
347
|
+
if (args["domain"] !== undefined) params["domain"] = args["domain"]
|
|
348
|
+
let path = '/api/v1/network/icp'
|
|
349
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
350
|
+
}
|
|
351
|
+
async getNetworkIpinfo(args: any = {}): Promise<any> {
|
|
352
|
+
const params:any = {}
|
|
353
|
+
const body:any = {}
|
|
354
|
+
if (args["ip"] !== undefined) params["ip"] = args["ip"]
|
|
355
|
+
if (args["source"] !== undefined) params["source"] = args["source"]
|
|
356
|
+
let path = '/api/v1/network/ipinfo'
|
|
357
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
358
|
+
}
|
|
359
|
+
async getNetworkMyip(args: any = {}): Promise<any> {
|
|
360
|
+
const params:any = {}
|
|
361
|
+
const body:any = {}
|
|
362
|
+
if (args["source"] !== undefined) params["source"] = args["source"]
|
|
363
|
+
let path = '/api/v1/network/myip'
|
|
364
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
365
|
+
}
|
|
366
|
+
async getNetworkPing(args: any = {}): Promise<any> {
|
|
367
|
+
const params:any = {}
|
|
368
|
+
const body:any = {}
|
|
369
|
+
if (args["host"] !== undefined) params["host"] = args["host"]
|
|
370
|
+
let path = '/api/v1/network/ping'
|
|
371
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
372
|
+
}
|
|
373
|
+
async getNetworkPingmyip(args: any = {}): Promise<any> {
|
|
374
|
+
const params:any = {}
|
|
375
|
+
const body:any = {}
|
|
376
|
+
let path = '/api/v1/network/pingmyip'
|
|
377
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
378
|
+
}
|
|
379
|
+
async getNetworkPortscan(args: any = {}): Promise<any> {
|
|
380
|
+
const params:any = {}
|
|
381
|
+
const body:any = {}
|
|
382
|
+
if (args["host"] !== undefined) params["host"] = args["host"]
|
|
383
|
+
if (args["port"] !== undefined) params["port"] = args["port"]
|
|
384
|
+
if (args["protocol"] !== undefined) params["protocol"] = args["protocol"]
|
|
385
|
+
let path = '/api/v1/network/portscan'
|
|
386
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
387
|
+
}
|
|
388
|
+
async getNetworkUrlstatus(args: any = {}): Promise<any> {
|
|
389
|
+
const params:any = {}
|
|
390
|
+
const body:any = {}
|
|
391
|
+
if (args["url"] !== undefined) params["url"] = args["url"]
|
|
392
|
+
let path = '/api/v1/network/urlstatus'
|
|
393
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
394
|
+
}
|
|
395
|
+
async getNetworkWhois(args: any = {}): Promise<any> {
|
|
396
|
+
const params:any = {}
|
|
397
|
+
const body:any = {}
|
|
398
|
+
if (args["domain"] !== undefined) params["domain"] = args["domain"]
|
|
399
|
+
if (args["format"] !== undefined) params["format"] = args["format"]
|
|
400
|
+
let path = '/api/v1/network/whois'
|
|
401
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
402
|
+
}
|
|
403
|
+
async getNetworkWxdomain(args: any = {}): Promise<any> {
|
|
404
|
+
const params:any = {}
|
|
405
|
+
const body:any = {}
|
|
406
|
+
if (args["domain"] !== undefined) params["domain"] = args["domain"]
|
|
407
|
+
let path = '/api/v1/network/wxdomain'
|
|
408
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
class PoemApi {
|
|
412
|
+
constructor(private c: UapiClient) {}
|
|
413
|
+
async getSaying(args: any = {}): Promise<any> {
|
|
414
|
+
const params:any = {}
|
|
415
|
+
const body:any = {}
|
|
416
|
+
let path = '/api/v1/saying'
|
|
417
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
class RandomApi {
|
|
421
|
+
constructor(private c: UapiClient) {}
|
|
422
|
+
async getAnswerbookAsk(args: any = {}): Promise<any> {
|
|
423
|
+
const params:any = {}
|
|
424
|
+
const body:any = {}
|
|
425
|
+
if (args["question"] !== undefined) params["question"] = args["question"]
|
|
426
|
+
let path = '/api/v1/answerbook/ask'
|
|
427
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
428
|
+
}
|
|
429
|
+
async getRandomImage(args: any = {}): Promise<any> {
|
|
430
|
+
const params:any = {}
|
|
431
|
+
const body:any = {}
|
|
432
|
+
if (args["category"] !== undefined) params["category"] = args["category"]
|
|
433
|
+
if (args["type"] !== undefined) params["type"] = args["type"]
|
|
434
|
+
let path = '/api/v1/random/image'
|
|
435
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
436
|
+
}
|
|
437
|
+
async getRandomString(args: any = {}): Promise<any> {
|
|
438
|
+
const params:any = {}
|
|
439
|
+
const body:any = {}
|
|
440
|
+
if (args["length"] !== undefined) params["length"] = args["length"]
|
|
441
|
+
if (args["type"] !== undefined) params["type"] = args["type"]
|
|
442
|
+
let path = '/api/v1/random/string'
|
|
443
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
444
|
+
}
|
|
445
|
+
async postAnswerbookAsk(args: any = {}): Promise<any> {
|
|
446
|
+
const params:any = {}
|
|
447
|
+
const body:any = {}
|
|
448
|
+
if (args["question"] !== undefined) body["question"] = args["question"]
|
|
449
|
+
let path = '/api/v1/answerbook/ask'
|
|
450
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
class SocialApi {
|
|
454
|
+
constructor(private c: UapiClient) {}
|
|
455
|
+
async getGithubRepo(args: any = {}): Promise<any> {
|
|
456
|
+
const params:any = {}
|
|
457
|
+
const body:any = {}
|
|
458
|
+
if (args["repo"] !== undefined) params["repo"] = args["repo"]
|
|
459
|
+
let path = '/api/v1/github/repo'
|
|
460
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
461
|
+
}
|
|
462
|
+
async getSocialBilibiliArchives(args: any = {}): Promise<any> {
|
|
463
|
+
const params:any = {}
|
|
464
|
+
const body:any = {}
|
|
465
|
+
if (args["mid"] !== undefined) params["mid"] = args["mid"]
|
|
466
|
+
if (args["keywords"] !== undefined) params["keywords"] = args["keywords"]
|
|
467
|
+
if (args["orderby"] !== undefined) params["orderby"] = args["orderby"]
|
|
468
|
+
if (args["ps"] !== undefined) params["ps"] = args["ps"]
|
|
469
|
+
if (args["pn"] !== undefined) params["pn"] = args["pn"]
|
|
470
|
+
let path = '/api/v1/social/bilibili/archives'
|
|
471
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
472
|
+
}
|
|
473
|
+
async getSocialBilibiliLiveroom(args: any = {}): Promise<any> {
|
|
474
|
+
const params:any = {}
|
|
475
|
+
const body:any = {}
|
|
476
|
+
if (args["mid"] !== undefined) params["mid"] = args["mid"]
|
|
477
|
+
if (args["room_id"] !== undefined) params["room_id"] = args["room_id"]
|
|
478
|
+
let path = '/api/v1/social/bilibili/liveroom'
|
|
479
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
480
|
+
}
|
|
481
|
+
async getSocialBilibiliReplies(args: any = {}): Promise<any> {
|
|
482
|
+
const params:any = {}
|
|
483
|
+
const body:any = {}
|
|
484
|
+
if (args["oid"] !== undefined) params["oid"] = args["oid"]
|
|
485
|
+
if (args["sort"] !== undefined) params["sort"] = args["sort"]
|
|
486
|
+
if (args["ps"] !== undefined) params["ps"] = args["ps"]
|
|
487
|
+
if (args["pn"] !== undefined) params["pn"] = args["pn"]
|
|
488
|
+
let path = '/api/v1/social/bilibili/replies'
|
|
489
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
490
|
+
}
|
|
491
|
+
async getSocialBilibiliUserinfo(args: any = {}): Promise<any> {
|
|
492
|
+
const params:any = {}
|
|
493
|
+
const body:any = {}
|
|
494
|
+
if (args["uid"] !== undefined) params["uid"] = args["uid"]
|
|
495
|
+
let path = '/api/v1/social/bilibili/userinfo'
|
|
496
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
497
|
+
}
|
|
498
|
+
async getSocialBilibiliVideoinfo(args: any = {}): Promise<any> {
|
|
499
|
+
const params:any = {}
|
|
500
|
+
const body:any = {}
|
|
501
|
+
if (args["aid"] !== undefined) params["aid"] = args["aid"]
|
|
502
|
+
if (args["bvid"] !== undefined) params["bvid"] = args["bvid"]
|
|
503
|
+
let path = '/api/v1/social/bilibili/videoinfo'
|
|
504
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
505
|
+
}
|
|
506
|
+
async getSocialQqGroupinfo(args: any = {}): Promise<any> {
|
|
507
|
+
const params:any = {}
|
|
508
|
+
const body:any = {}
|
|
509
|
+
if (args["group_id"] !== undefined) params["group_id"] = args["group_id"]
|
|
510
|
+
let path = '/api/v1/social/qq/groupinfo'
|
|
511
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
512
|
+
}
|
|
513
|
+
async getSocialQqUserinfo(args: any = {}): Promise<any> {
|
|
514
|
+
const params:any = {}
|
|
515
|
+
const body:any = {}
|
|
516
|
+
if (args["qq"] !== undefined) params["qq"] = args["qq"]
|
|
517
|
+
let path = '/api/v1/social/qq/userinfo'
|
|
518
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
class StatusApi {
|
|
522
|
+
constructor(private c: UapiClient) {}
|
|
523
|
+
async getStatusRatelimit(args: any = {}): Promise<any> {
|
|
524
|
+
const params:any = {}
|
|
525
|
+
const body:any = {}
|
|
526
|
+
let path = '/api/v1/status/ratelimit'
|
|
527
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
528
|
+
}
|
|
529
|
+
async getStatusUsage(args: any = {}): Promise<any> {
|
|
530
|
+
const params:any = {}
|
|
531
|
+
const body:any = {}
|
|
532
|
+
if (args["path"] !== undefined) params["path"] = args["path"]
|
|
533
|
+
let path = '/api/v1/status/usage'
|
|
534
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
class TextApi {
|
|
538
|
+
constructor(private c: UapiClient) {}
|
|
539
|
+
async getTextMd5(args: any = {}): Promise<any> {
|
|
540
|
+
const params:any = {}
|
|
541
|
+
const body:any = {}
|
|
542
|
+
if (args["text"] !== undefined) params["text"] = args["text"]
|
|
543
|
+
let path = '/api/v1/text/md5'
|
|
544
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
545
|
+
}
|
|
546
|
+
async postTextAesDecrypt(args: any = {}): Promise<any> {
|
|
547
|
+
const params:any = {}
|
|
548
|
+
const body:any = {}
|
|
549
|
+
if (args["key"] !== undefined) body["key"] = args["key"]
|
|
550
|
+
if (args["nonce"] !== undefined) body["nonce"] = args["nonce"]
|
|
551
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
552
|
+
let path = '/api/v1/text/aes/decrypt'
|
|
553
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
554
|
+
}
|
|
555
|
+
async postTextAesDecryptAdvanced(args: any = {}): Promise<any> {
|
|
556
|
+
const params:any = {}
|
|
557
|
+
const body:any = {}
|
|
558
|
+
if (args["iv"] !== undefined) body["iv"] = args["iv"]
|
|
559
|
+
if (args["key"] !== undefined) body["key"] = args["key"]
|
|
560
|
+
if (args["mode"] !== undefined) body["mode"] = args["mode"]
|
|
561
|
+
if (args["padding"] !== undefined) body["padding"] = args["padding"]
|
|
562
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
563
|
+
let path = '/api/v1/text/aes/decrypt-advanced'
|
|
564
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
565
|
+
}
|
|
566
|
+
async postTextAesEncrypt(args: any = {}): Promise<any> {
|
|
567
|
+
const params:any = {}
|
|
568
|
+
const body:any = {}
|
|
569
|
+
if (args["key"] !== undefined) body["key"] = args["key"]
|
|
570
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
571
|
+
let path = '/api/v1/text/aes/encrypt'
|
|
572
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
573
|
+
}
|
|
574
|
+
async postTextAesEncryptAdvanced(args: any = {}): Promise<any> {
|
|
575
|
+
const params:any = {}
|
|
576
|
+
const body:any = {}
|
|
577
|
+
if (args["iv"] !== undefined) body["iv"] = args["iv"]
|
|
578
|
+
if (args["key"] !== undefined) body["key"] = args["key"]
|
|
579
|
+
if (args["mode"] !== undefined) body["mode"] = args["mode"]
|
|
580
|
+
if (args["output_format"] !== undefined) body["output_format"] = args["output_format"]
|
|
581
|
+
if (args["padding"] !== undefined) body["padding"] = args["padding"]
|
|
582
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
583
|
+
let path = '/api/v1/text/aes/encrypt-advanced'
|
|
584
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
585
|
+
}
|
|
586
|
+
async postTextAnalyze(args: any = {}): Promise<any> {
|
|
587
|
+
const params:any = {}
|
|
588
|
+
const body:any = {}
|
|
589
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
590
|
+
let path = '/api/v1/text/analyze'
|
|
591
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
592
|
+
}
|
|
593
|
+
async postTextBase64Decode(args: any = {}): Promise<any> {
|
|
594
|
+
const params:any = {}
|
|
595
|
+
const body:any = {}
|
|
596
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
597
|
+
let path = '/api/v1/text/base64/decode'
|
|
598
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
599
|
+
}
|
|
600
|
+
async postTextBase64Encode(args: any = {}): Promise<any> {
|
|
601
|
+
const params:any = {}
|
|
602
|
+
const body:any = {}
|
|
603
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
604
|
+
let path = '/api/v1/text/base64/encode'
|
|
605
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
606
|
+
}
|
|
607
|
+
async postTextConvert(args: any = {}): Promise<any> {
|
|
608
|
+
const params:any = {}
|
|
609
|
+
const body:any = {}
|
|
610
|
+
if (args["from"] !== undefined) body["from"] = args["from"]
|
|
611
|
+
if (args["options"] !== undefined) body["options"] = args["options"]
|
|
612
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
613
|
+
if (args["to"] !== undefined) body["to"] = args["to"]
|
|
614
|
+
let path = '/api/v1/text/convert'
|
|
615
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
616
|
+
}
|
|
617
|
+
async postTextMd5(args: any = {}): Promise<any> {
|
|
618
|
+
const params:any = {}
|
|
619
|
+
const body:any = {}
|
|
620
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
621
|
+
let path = '/api/v1/text/md5'
|
|
622
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
623
|
+
}
|
|
624
|
+
async postTextMd5Verify(args: any = {}): Promise<any> {
|
|
625
|
+
const params:any = {}
|
|
626
|
+
const body:any = {}
|
|
627
|
+
if (args["hash"] !== undefined) body["hash"] = args["hash"]
|
|
628
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
629
|
+
let path = '/api/v1/text/md5/verify'
|
|
630
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
class TranslateApi {
|
|
634
|
+
constructor(private c: UapiClient) {}
|
|
635
|
+
async getAiTranslateLanguages(args: any = {}): Promise<any> {
|
|
636
|
+
const params:any = {}
|
|
637
|
+
const body:any = {}
|
|
638
|
+
let path = '/api/v1/ai/translate/languages'
|
|
639
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
640
|
+
}
|
|
641
|
+
async postAiTranslate(args: any = {}): Promise<any> {
|
|
642
|
+
const params:any = {}
|
|
643
|
+
const body:any = {}
|
|
644
|
+
if (args["target_lang"] !== undefined) params["target_lang"] = args["target_lang"]
|
|
645
|
+
if (args["context"] !== undefined) body["context"] = args["context"]
|
|
646
|
+
if (args["fast_mode"] !== undefined) body["fast_mode"] = args["fast_mode"]
|
|
647
|
+
if (args["max_concurrency"] !== undefined) body["max_concurrency"] = args["max_concurrency"]
|
|
648
|
+
if (args["preserve_format"] !== undefined) body["preserve_format"] = args["preserve_format"]
|
|
649
|
+
if (args["source_lang"] !== undefined) body["source_lang"] = args["source_lang"]
|
|
650
|
+
if (args["style"] !== undefined) body["style"] = args["style"]
|
|
651
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
652
|
+
if (args["texts"] !== undefined) body["texts"] = args["texts"]
|
|
653
|
+
let path = '/api/v1/ai/translate'
|
|
654
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
655
|
+
}
|
|
656
|
+
async postTranslateStream(args: any = {}): Promise<any> {
|
|
657
|
+
const params:any = {}
|
|
658
|
+
const body:any = {}
|
|
659
|
+
if (args["from_lang"] !== undefined) body["from_lang"] = args["from_lang"]
|
|
660
|
+
if (args["query"] !== undefined) body["query"] = args["query"]
|
|
661
|
+
if (args["to_lang"] !== undefined) body["to_lang"] = args["to_lang"]
|
|
662
|
+
if (args["tone"] !== undefined) body["tone"] = args["tone"]
|
|
663
|
+
let path = '/api/v1/translate/stream'
|
|
664
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
665
|
+
}
|
|
666
|
+
async postTranslateText(args: any = {}): Promise<any> {
|
|
667
|
+
const params:any = {}
|
|
668
|
+
const body:any = {}
|
|
669
|
+
if (args["to_lang"] !== undefined) params["to_lang"] = args["to_lang"]
|
|
670
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
671
|
+
let path = '/api/v1/translate/text'
|
|
672
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
class WebparseApi {
|
|
676
|
+
constructor(private c: UapiClient) {}
|
|
677
|
+
async getWebTomarkdownAsyncStatus(args: any = {}): Promise<any> {
|
|
678
|
+
const params:any = {}
|
|
679
|
+
const body:any = {}
|
|
680
|
+
let path = '/api/v1/web/tomarkdown/async/{task_id}'
|
|
681
|
+
if (args['task_id'] !== undefined) path = path.replace('{' + 'task_id' + '}', String(args['task_id']))
|
|
682
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
683
|
+
}
|
|
684
|
+
async getWebparseExtractimages(args: any = {}): Promise<any> {
|
|
685
|
+
const params:any = {}
|
|
686
|
+
const body:any = {}
|
|
687
|
+
if (args["url"] !== undefined) params["url"] = args["url"]
|
|
688
|
+
let path = '/api/v1/webparse/extractimages'
|
|
689
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
690
|
+
}
|
|
691
|
+
async getWebparseMetadata(args: any = {}): Promise<any> {
|
|
692
|
+
const params:any = {}
|
|
693
|
+
const body:any = {}
|
|
694
|
+
if (args["url"] !== undefined) params["url"] = args["url"]
|
|
695
|
+
let path = '/api/v1/webparse/metadata'
|
|
696
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
697
|
+
}
|
|
698
|
+
async postWebTomarkdownAsync(args: any = {}): Promise<any> {
|
|
699
|
+
const params:any = {}
|
|
700
|
+
const body:any = {}
|
|
701
|
+
if (args["url"] !== undefined) params["url"] = args["url"]
|
|
702
|
+
let path = '/api/v1/web/tomarkdown/async'
|
|
703
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
class MinGanCiShiBieApi {
|
|
707
|
+
constructor(private c: UapiClient) {}
|
|
708
|
+
async getSensitiveWordAnalyzeQuery(args: any = {}): Promise<any> {
|
|
709
|
+
const params:any = {}
|
|
710
|
+
const body:any = {}
|
|
711
|
+
if (args["keyword"] !== undefined) params["keyword"] = args["keyword"]
|
|
712
|
+
let path = '/api/v1/sensitive-word/analyze-query'
|
|
713
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
714
|
+
}
|
|
715
|
+
async postSensitiveWordAnalyze(args: any = {}): Promise<any> {
|
|
716
|
+
const params:any = {}
|
|
717
|
+
const body:any = {}
|
|
718
|
+
if (args["keywords"] !== undefined) body["keywords"] = args["keywords"]
|
|
719
|
+
let path = '/api/v1/sensitive-word/analyze'
|
|
720
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
721
|
+
}
|
|
722
|
+
async postSensitiveWordQuickCheck(args: any = {}): Promise<any> {
|
|
723
|
+
const params:any = {}
|
|
724
|
+
const body:any = {}
|
|
725
|
+
if (args["text"] !== undefined) body["text"] = args["text"]
|
|
726
|
+
let path = '/api/v1/text/profanitycheck'
|
|
727
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
class ZhiNengSouSuoApi {
|
|
731
|
+
constructor(private c: UapiClient) {}
|
|
732
|
+
async getSearchEngines(args: any = {}): Promise<any> {
|
|
733
|
+
const params:any = {}
|
|
734
|
+
const body:any = {}
|
|
735
|
+
let path = '/api/v1/search/engines'
|
|
736
|
+
return this.c._request('GET', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
737
|
+
}
|
|
738
|
+
async postSearchAggregate(args: any = {}): Promise<any> {
|
|
739
|
+
const params:any = {}
|
|
740
|
+
const body:any = {}
|
|
741
|
+
if (args["fetch_full"] !== undefined) body["fetch_full"] = args["fetch_full"]
|
|
742
|
+
if (args["filetype"] !== undefined) body["filetype"] = args["filetype"]
|
|
743
|
+
if (args["query"] !== undefined) body["query"] = args["query"]
|
|
744
|
+
if (args["site"] !== undefined) body["site"] = args["site"]
|
|
745
|
+
if (args["sort"] !== undefined) body["sort"] = args["sort"]
|
|
746
|
+
if (args["time_range"] !== undefined) body["time_range"] = args["time_range"]
|
|
747
|
+
if (args["timeout_ms"] !== undefined) body["timeout_ms"] = args["timeout_ms"]
|
|
748
|
+
let path = '/api/v1/search/aggregate'
|
|
749
|
+
return this.c._request('POST', path, params, Object.keys(body).length > 0 ? body : undefined)
|
|
750
|
+
}
|
|
751
|
+
}
|