baja-lite 1.6.4 → 1.6.5
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/boot-remote.d.ts +2 -0
- package/{src/boot-remote.ts → boot-remote.js} +63 -64
- package/boot.d.ts +2 -0
- package/{src/boot.ts → boot.js} +163 -170
- package/code.d.ts +2 -0
- package/{src/code.ts → code.js} +405 -414
- package/convert-xml.d.ts +10 -0
- package/{src/convert-xml.ts → convert-xml.js} +410 -460
- package/error.d.ts +5 -0
- package/error.js +13 -0
- package/event.d.ts +10 -0
- package/event.js +38 -0
- package/fn.d.ts +128 -0
- package/fn.js +172 -0
- package/{src/index.ts → index.d.ts} +10 -11
- package/index.js +10 -0
- package/math.d.ts +83 -0
- package/math.js +451 -0
- package/object.d.ts +126 -0
- package/object.js +321 -0
- package/package.json +1 -1
- package/snowflake.d.ts +12 -0
- package/{src/snowflake.ts → snowflake.js} +108 -127
- package/sql.d.ts +2148 -0
- package/sql.js +5370 -0
- package/sqlite.d.ts +32 -0
- package/{src/sqlite.ts → sqlite.js} +156 -157
- package/string.d.ts +17 -0
- package/string.js +105 -0
- package/test-mysql.d.ts +2 -0
- package/test-mysql.js +114 -0
- package/test-postgresql.d.ts +2 -0
- package/{src/test-postgresql.ts → test-postgresql.js} +91 -80
- package/test-sqlite.d.ts +1 -0
- package/{src/test-sqlite.ts → test-sqlite.js} +90 -80
- package/test-xml.d.ts +1 -0
- package/{src/test-xml.ts → test-xml.js} +2 -2
- package/test.d.ts +1 -0
- package/{src/test.ts → test.js} +2 -3
- package/wx/base.d.ts +11 -0
- package/wx/base.js +78 -0
- package/wx/mini.d.ts +52 -0
- package/wx/mini.js +112 -0
- package/wx/organ.d.ts +65 -0
- package/wx/organ.js +171 -0
- package/{src/wx/types.ts → wx/types.d.ts} +560 -549
- package/wx/types.js +1 -0
- package/{src/wx.ts → wx.d.ts} +3 -3
- package/wx.js +3 -0
- package/.eslintignore +0 -7
- package/.eslintrc.cjs +0 -89
- package/.prettierrc +0 -7
- package/.vscode/settings.json +0 -9
- package/ci.js +0 -33
- package/package-cjs.json +0 -17
- package/pnpm-lock.yaml +0 -2840
- package/pnpm-workspace.yaml +0 -2
- package/src/error.ts +0 -11
- package/src/event.ts +0 -34
- package/src/fn.ts +0 -295
- package/src/math.ts +0 -405
- package/src/object.ts +0 -342
- package/src/sql.ts +0 -5529
- package/src/string.ts +0 -111
- package/src/test-mysql.ts +0 -148
- package/src/wx/base.ts +0 -77
- package/src/wx/mini.ts +0 -147
- package/src/wx/organ.ts +0 -290
- package/tsconfig.cjs.json +0 -42
- package/tsconfig.json +0 -44
- package/xml/event-report.xml +0 -13
- package/yarn.lock +0 -1977
- /package/{Readme.md → README.md} +0 -0
|
@@ -1,549 +1,560 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 企业微信员工
|
|
3
|
-
*/
|
|
4
|
-
export interface WxOrganUser {
|
|
5
|
-
userid: number;
|
|
6
|
-
name: string;
|
|
7
|
-
alias?: string;
|
|
8
|
-
mobile: string;
|
|
9
|
-
department: number[];
|
|
10
|
-
order?: number[];
|
|
11
|
-
is_leader_in_dept?: Array<0 | 1>;
|
|
12
|
-
position?: string;
|
|
13
|
-
gender?: 1 | 0;
|
|
14
|
-
email?: string;
|
|
15
|
-
telephone?: string;
|
|
16
|
-
avatar_mediaid?: string;
|
|
17
|
-
enable?: 1 | 0;
|
|
18
|
-
extattr?: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
export
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
303
|
-
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
*
|
|
329
|
-
* @param
|
|
330
|
-
* @
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
*
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
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
|
-
|
|
391
|
-
|
|
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
|
-
*
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
}
|
|
480
|
-
export interface
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
}
|
|
491
|
-
export interface
|
|
492
|
-
media_id: string;
|
|
493
|
-
}
|
|
494
|
-
export interface
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
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
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 企业微信员工
|
|
3
|
+
*/
|
|
4
|
+
export interface WxOrganUser {
|
|
5
|
+
userid: number;
|
|
6
|
+
name: string;
|
|
7
|
+
alias?: string;
|
|
8
|
+
mobile: string;
|
|
9
|
+
department: number[];
|
|
10
|
+
order?: number[];
|
|
11
|
+
is_leader_in_dept?: Array<0 | 1>;
|
|
12
|
+
position?: string;
|
|
13
|
+
gender?: 1 | 0;
|
|
14
|
+
email?: string;
|
|
15
|
+
telephone?: string;
|
|
16
|
+
avatar_mediaid?: string;
|
|
17
|
+
enable?: 1 | 0;
|
|
18
|
+
extattr?: {
|
|
19
|
+
[key: string]: string | number;
|
|
20
|
+
};
|
|
21
|
+
to_invite?: boolean;
|
|
22
|
+
external_profile?: {
|
|
23
|
+
[key: string]: string | number;
|
|
24
|
+
};
|
|
25
|
+
external_position?: string;
|
|
26
|
+
address?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface WxOrganUserRead extends WxOrganUser {
|
|
29
|
+
status?: 1 | 2 | 4;
|
|
30
|
+
avatar?: string;
|
|
31
|
+
thumb_avatar?: string;
|
|
32
|
+
qr_code?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface WxOrganUserSimply {
|
|
35
|
+
userid: number;
|
|
36
|
+
name: string;
|
|
37
|
+
department: number[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* 企业微信部门
|
|
42
|
+
* @interface WxDepartment
|
|
43
|
+
*/
|
|
44
|
+
export interface WxDepartment {
|
|
45
|
+
name: string;
|
|
46
|
+
parentid: number;
|
|
47
|
+
order?: number;
|
|
48
|
+
id: number;
|
|
49
|
+
}
|
|
50
|
+
export interface WxLiveReplay {
|
|
51
|
+
expire_time: string;
|
|
52
|
+
create_time: string;
|
|
53
|
+
media_url: string;
|
|
54
|
+
}
|
|
55
|
+
export interface WxConfig {
|
|
56
|
+
corpid: string;
|
|
57
|
+
appSecret: string;
|
|
58
|
+
}
|
|
59
|
+
export type WxPayType = 'JSAPI' | 'NATIVE' | 'APP' | 'MWEB';
|
|
60
|
+
export interface WxPayOption {
|
|
61
|
+
/** 小程序id、公众号id、企业微信id */
|
|
62
|
+
appid: string;
|
|
63
|
+
/** 商户号 */
|
|
64
|
+
mch_id: string;
|
|
65
|
+
/** 商户平台密钥 */
|
|
66
|
+
appSecret: string;
|
|
67
|
+
/** 证书名称(文件名+后缀),需要放在 app/cert 目录中 */
|
|
68
|
+
cert: string;
|
|
69
|
+
/** 支付方式:微信内网页环境使用JSAPI,微信外网页环境使用MWEB;用户扫码使用NATIVE */
|
|
70
|
+
trade_type: WxPayType;
|
|
71
|
+
}
|
|
72
|
+
export interface WxCreatedorder {
|
|
73
|
+
device_info?: string;
|
|
74
|
+
body: string;
|
|
75
|
+
detail?: string;
|
|
76
|
+
out_trade_no: string;
|
|
77
|
+
total_fee: number;
|
|
78
|
+
spbill_create_ip: string;
|
|
79
|
+
time_start?: string;
|
|
80
|
+
time_expire?: string;
|
|
81
|
+
goods_tag?: string;
|
|
82
|
+
product_id?: string;
|
|
83
|
+
limit_pay?: string;
|
|
84
|
+
openid: string;
|
|
85
|
+
receipt?: string;
|
|
86
|
+
scene_info?: {
|
|
87
|
+
store_info: {
|
|
88
|
+
id: string;
|
|
89
|
+
name: string;
|
|
90
|
+
area_code: string;
|
|
91
|
+
address: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export interface WxPayToUserResponse {
|
|
96
|
+
payment_no: string;
|
|
97
|
+
partner_trade_no: string;
|
|
98
|
+
payment_time: string;
|
|
99
|
+
}
|
|
100
|
+
export interface WxPayToUser {
|
|
101
|
+
partner_trade_no: string;
|
|
102
|
+
openid: string;
|
|
103
|
+
check_name: 'NO_CHECK' | 'FORCE_CHECK';
|
|
104
|
+
re_user_name?: string;
|
|
105
|
+
amount: number;
|
|
106
|
+
desc?: string;
|
|
107
|
+
spbill_create_ip?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface WxCreateOrderJSAPI {
|
|
110
|
+
appId: string;
|
|
111
|
+
timeStamp: string;
|
|
112
|
+
nonceStr: string;
|
|
113
|
+
package: string;
|
|
114
|
+
signType: string;
|
|
115
|
+
paySign: string;
|
|
116
|
+
}
|
|
117
|
+
export interface WxCreateOrderAPP {
|
|
118
|
+
appid: string;
|
|
119
|
+
partnerid: string;
|
|
120
|
+
prepayid: string;
|
|
121
|
+
package: string;
|
|
122
|
+
noncestr: string;
|
|
123
|
+
timestamp: string;
|
|
124
|
+
sign: string;
|
|
125
|
+
}
|
|
126
|
+
/** 微信支付预创建订单返回结果 */
|
|
127
|
+
export interface WxCreateOrderResult {
|
|
128
|
+
/** jsapi支付方式 */
|
|
129
|
+
jsapi?: WxCreateOrderJSAPI;
|
|
130
|
+
/** app支付方式 */
|
|
131
|
+
app?: WxCreateOrderAPP;
|
|
132
|
+
prepay_id: string;
|
|
133
|
+
code_url?: string;
|
|
134
|
+
mweb_url?: string;
|
|
135
|
+
dataCacheId?: string;
|
|
136
|
+
devCacheId?: string;
|
|
137
|
+
} /** 微信退款返回结果 */
|
|
138
|
+
export interface WxRefResult {
|
|
139
|
+
dataCacheId?: string;
|
|
140
|
+
devCacheId?: string;
|
|
141
|
+
}
|
|
142
|
+
export interface WxOrderQuery {
|
|
143
|
+
transaction_id?: string;
|
|
144
|
+
out_trade_no?: string;
|
|
145
|
+
}
|
|
146
|
+
export interface WxOrder {
|
|
147
|
+
device_info?: string;
|
|
148
|
+
openid: string;
|
|
149
|
+
is_subscribe: 'Y' | 'N';
|
|
150
|
+
trade_type: WxPayType;
|
|
151
|
+
trade_state: 'SUCCESS' | 'REFUND' | 'NOTPAY' | 'CLOSED' | 'REVOKED' | 'USERPAYING' | 'PAYERROR';
|
|
152
|
+
bank_type: string;
|
|
153
|
+
total_fee: number;
|
|
154
|
+
settlement_total_fee?: number;
|
|
155
|
+
fee_type?: string;
|
|
156
|
+
cash_fee: number;
|
|
157
|
+
cash_fee_type?: string;
|
|
158
|
+
coupon_fee?: number;
|
|
159
|
+
coupon_count?: number;
|
|
160
|
+
transaction_id: string;
|
|
161
|
+
out_trade_no: string;
|
|
162
|
+
attach?: string;
|
|
163
|
+
time_end: string;
|
|
164
|
+
trade_state_desc: string;
|
|
165
|
+
children?: Array<{
|
|
166
|
+
coupon_type: string;
|
|
167
|
+
coupon_id: string;
|
|
168
|
+
coupon_fee: number;
|
|
169
|
+
}>;
|
|
170
|
+
}
|
|
171
|
+
export interface WxCreateRefundOrder {
|
|
172
|
+
transaction_id?: string;
|
|
173
|
+
out_trade_no?: string;
|
|
174
|
+
out_refund_no: string;
|
|
175
|
+
total_fee: number;
|
|
176
|
+
refund_fee: number;
|
|
177
|
+
refund_desc: string;
|
|
178
|
+
refund_account?: 'REFUND_SOURCE_UNSETTLED_FUNDS' | 'REFUND_SOURCE_RECHARGE_FUNDS';
|
|
179
|
+
}
|
|
180
|
+
export interface WxRefundOrderQuery {
|
|
181
|
+
transaction_id?: string;
|
|
182
|
+
out_trade_no?: string;
|
|
183
|
+
out_refund_no?: string;
|
|
184
|
+
refund_id?: string;
|
|
185
|
+
offset?: number;
|
|
186
|
+
}
|
|
187
|
+
export interface WxRefundOrder {
|
|
188
|
+
total_refund_count?: number;
|
|
189
|
+
transaction_id: string;
|
|
190
|
+
out_trade_no: string;
|
|
191
|
+
total_fee: number;
|
|
192
|
+
settlement_total_fee?: number;
|
|
193
|
+
fee_type?: string;
|
|
194
|
+
cash_fee: number;
|
|
195
|
+
refund_count: number;
|
|
196
|
+
children?: Array<{
|
|
197
|
+
out_refund_no: string;
|
|
198
|
+
refund_id: string;
|
|
199
|
+
refund_channel?: 'ORIGINAL' | 'BALANCE' | 'OTHER_BALANCE' | 'OTHER_BANKCARD';
|
|
200
|
+
refund_fee: number;
|
|
201
|
+
settlement_refund_fee?: number;
|
|
202
|
+
coupon_refund_fee?: number;
|
|
203
|
+
coupon_refund_count?: number;
|
|
204
|
+
refund_status: 'SUCCESS' | 'REFUNDCLOSE' | 'PROCESSING' | 'CHANGE';
|
|
205
|
+
refund_account?: 'REFUND_SOURCE_RECHARGE_FUNDS' | 'REFUND_SOURCE_UNSETTLED_FUNDS';
|
|
206
|
+
refund_recv_accout: string;
|
|
207
|
+
refund_success_time?: string;
|
|
208
|
+
children?: Array<{
|
|
209
|
+
coupon_type: string;
|
|
210
|
+
coupon_refund_id: string;
|
|
211
|
+
coupon_refund_fee: number;
|
|
212
|
+
}>;
|
|
213
|
+
}>;
|
|
214
|
+
}
|
|
215
|
+
export interface WxPayHook {
|
|
216
|
+
device_info?: string;
|
|
217
|
+
openid: string;
|
|
218
|
+
is_subscribe: 'Y' | 'N';
|
|
219
|
+
bank_type: string;
|
|
220
|
+
total_fee: number;
|
|
221
|
+
settlement_total_fee?: number;
|
|
222
|
+
fee_type?: string;
|
|
223
|
+
cash_fee: number;
|
|
224
|
+
cash_fee_type?: string;
|
|
225
|
+
coupon_fee?: string;
|
|
226
|
+
coupon_count?: number;
|
|
227
|
+
children?: Array<{
|
|
228
|
+
coupon_type: string;
|
|
229
|
+
coupon_id: string;
|
|
230
|
+
coupon_fee: number;
|
|
231
|
+
}>;
|
|
232
|
+
transaction_id: string;
|
|
233
|
+
out_trade_no: string;
|
|
234
|
+
attach?: string;
|
|
235
|
+
time_end: string;
|
|
236
|
+
}
|
|
237
|
+
export interface WxRefHook {
|
|
238
|
+
transaction_id: string;
|
|
239
|
+
out_trade_no: string;
|
|
240
|
+
refund_id: string;
|
|
241
|
+
out_refund_no: string;
|
|
242
|
+
total_fee: number;
|
|
243
|
+
settlement_total_fee?: number;
|
|
244
|
+
refund_fee: number;
|
|
245
|
+
settlement_refund_fee: string;
|
|
246
|
+
refund_status: 'SUCCESS' | 'CHANGE' | 'REFUNDCLOSE';
|
|
247
|
+
success_time?: string;
|
|
248
|
+
refund_recv_accout: string;
|
|
249
|
+
refund_account: 'REFUND_SOURCE_RECHARGE_FUNDS' | 'REFUND_SOURCE_UNSETTLED_FUNDS';
|
|
250
|
+
refund_request_source: 'API' | 'VENDOR_PLATFORM';
|
|
251
|
+
}
|
|
252
|
+
export interface WxPay {
|
|
253
|
+
/**
|
|
254
|
+
* 企业付款到零钱
|
|
255
|
+
* https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2
|
|
256
|
+
*
|
|
257
|
+
* option中的amount单位是元
|
|
258
|
+
* 处理失败时返回异常
|
|
259
|
+
* @memberof WxPay
|
|
260
|
+
*/
|
|
261
|
+
transfers(option: WxPayToUser): Promise<WxPayToUserResponse>;
|
|
262
|
+
/**
|
|
263
|
+
* 统一下单接口参数定义
|
|
264
|
+
* https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1
|
|
265
|
+
* 其中未定义到此处的参数,说明框架会给出默认值
|
|
266
|
+
*
|
|
267
|
+
* 会将dataCache存放到redis中
|
|
268
|
+
* 在支付回调中将dataCache取出传回业务方法
|
|
269
|
+
*
|
|
270
|
+
* 每一个支付应用都有自己的:支付成功、支付失败、退款成功、退款失败回调
|
|
271
|
+
* 所以如果有不同的业务,最好将这些业务都分层不同的支付应用
|
|
272
|
+
* 每个应用实现独立的同步消息通知(sub-async)
|
|
273
|
+
*
|
|
274
|
+
* devid 是当前支付发起的用户token
|
|
275
|
+
* 在支付回调时,由于请求是由微信服务器发起的,因此上下文中不存在 用户对象
|
|
276
|
+
* 通过这个参数可以将 当前支付发起时用户 追加到回调的上下文中
|
|
277
|
+
* @memberof WxPay
|
|
278
|
+
*/
|
|
279
|
+
unifiedorder(wxOrderOption: WxCreatedorder, dataCache?: {
|
|
280
|
+
[key: string]: any;
|
|
281
|
+
}, devid?: string): Promise<WxCreateOrderResult>;
|
|
282
|
+
/**
|
|
283
|
+
*
|
|
284
|
+
* https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_2
|
|
285
|
+
* @param {WxOrderQuery} option
|
|
286
|
+
* @returns {Promise<WxOrder>}
|
|
287
|
+
* @memberof WxPay
|
|
288
|
+
*/
|
|
289
|
+
orderquery(option: WxOrderQuery): Promise<WxOrder>;
|
|
290
|
+
/**
|
|
291
|
+
*
|
|
292
|
+
* https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_3
|
|
293
|
+
* @param {string} out_trade_no
|
|
294
|
+
* @returns {Promise<void>}
|
|
295
|
+
* @memberof WxPay
|
|
296
|
+
*/
|
|
297
|
+
closeorder(out_trade_no: string): Promise<void>;
|
|
298
|
+
/**
|
|
299
|
+
* 取消订单
|
|
300
|
+
* 用于用户取消支付导致的取消订单场景
|
|
301
|
+
* 此方法会清除调起支付时缓存的dataCache
|
|
302
|
+
* 同时会向微信提交关闭订单的申请
|
|
303
|
+
* @param {string} out_trade_no
|
|
304
|
+
* @returns {Promise<void>}
|
|
305
|
+
* @memberof WxPay
|
|
306
|
+
*/
|
|
307
|
+
cancelorder(out_trade_no: string): Promise<void>;
|
|
308
|
+
/**
|
|
309
|
+
*
|
|
310
|
+
* https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_4
|
|
311
|
+
*
|
|
312
|
+
* 会将dataCache存放到redis中
|
|
313
|
+
* 在回调中将dataCache取出传回业务方法
|
|
314
|
+
*
|
|
315
|
+
* devid 是当前退款发起的用户token
|
|
316
|
+
* 在退款回调时,由于请求是由微信服务器发起的,因此上下文中不存在 用户对象
|
|
317
|
+
* 通过这个参数可以将 当前退款发起时用户 追加到回调的上下文中
|
|
318
|
+
*
|
|
319
|
+
* @param {WxCreateRefundOrder} option
|
|
320
|
+
* @returns {Promise<void>}
|
|
321
|
+
* @memberof WxPay
|
|
322
|
+
*/
|
|
323
|
+
refund(option: WxCreateRefundOrder, dataCache?: {
|
|
324
|
+
[key: string]: any;
|
|
325
|
+
}, devid?: string): Promise<WxRefResult>;
|
|
326
|
+
/**
|
|
327
|
+
*
|
|
328
|
+
* https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_5
|
|
329
|
+
* @param {WxRefundOrderQuery} option
|
|
330
|
+
* @returns {Promise<void>}
|
|
331
|
+
* @memberof WxPay
|
|
332
|
+
*/
|
|
333
|
+
refundquery(option: WxRefundOrderQuery): Promise<WxRefundOrder>;
|
|
334
|
+
/**
|
|
335
|
+
* 修改支付、退款时缓存的业务对象
|
|
336
|
+
* @param dataCache
|
|
337
|
+
* @param dataCacheId
|
|
338
|
+
*/
|
|
339
|
+
resetDataCache(dataCache: {
|
|
340
|
+
[key: string]: any;
|
|
341
|
+
}, dataCacheId: string): Promise<void>;
|
|
342
|
+
/**
|
|
343
|
+
* 修改支付、退款时缓存的会话id
|
|
344
|
+
* @param devid
|
|
345
|
+
* @param devCacheId
|
|
346
|
+
*/
|
|
347
|
+
resetDevIdCache(devid: string, devCacheId: string): Promise<void>;
|
|
348
|
+
}
|
|
349
|
+
export interface WxMiniConfig {
|
|
350
|
+
appId: string;
|
|
351
|
+
appSecret: string;
|
|
352
|
+
/** 小程序二维码设置 */
|
|
353
|
+
qrcode?: {
|
|
354
|
+
/** 线条颜色 */
|
|
355
|
+
lineColor?: {
|
|
356
|
+
r: number;
|
|
357
|
+
g: number;
|
|
358
|
+
b: number;
|
|
359
|
+
};
|
|
360
|
+
/** 宽度 */
|
|
361
|
+
width?: number;
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
*
|
|
365
|
+
* 微信订阅消息场景
|
|
366
|
+
* 当传递此参数后,会自动创建路由
|
|
367
|
+
*
|
|
368
|
+
* keys 表示场景,在前端申请订阅场景权限时使用,同一个key将一次性申请订阅权限
|
|
369
|
+
* 每一个模板可以在不同的场景中被申请
|
|
370
|
+
* model=页面所在分包名
|
|
371
|
+
* page=页面名称
|
|
372
|
+
* name=模板消息标识符,调用this.app.wxSendMs时使用,同一个name将同时发出
|
|
373
|
+
* tmplId=模板id
|
|
374
|
+
*
|
|
375
|
+
* /wx-mini-ms-id.json 得到所有模板消息id数组
|
|
376
|
+
* 返回 {key: [模板id数组]}
|
|
377
|
+
*/
|
|
378
|
+
messages?: Array<{
|
|
379
|
+
keys: string[];
|
|
380
|
+
name: string;
|
|
381
|
+
tmplId: string;
|
|
382
|
+
model: string;
|
|
383
|
+
page: string;
|
|
384
|
+
}>;
|
|
385
|
+
}
|
|
386
|
+
export interface WxOrganConfig {
|
|
387
|
+
/**
|
|
388
|
+
*
|
|
389
|
+
* 应用自定义编码
|
|
390
|
+
* 用于消息回调的url拼接
|
|
391
|
+
* @type {string}
|
|
392
|
+
* @memberof WxOrganConfig
|
|
393
|
+
*/
|
|
394
|
+
appCode?: string;
|
|
395
|
+
/**
|
|
396
|
+
*
|
|
397
|
+
* 企业编号 或者 suiteid
|
|
398
|
+
* @type {string}
|
|
399
|
+
* @memberof WxOrganConfig
|
|
400
|
+
*/
|
|
401
|
+
corpid: string;
|
|
402
|
+
/**
|
|
403
|
+
*
|
|
404
|
+
* 应用密钥
|
|
405
|
+
* @type {string}
|
|
406
|
+
* @memberof WxOrganConfig
|
|
407
|
+
*/
|
|
408
|
+
corpsecret: string;
|
|
409
|
+
/**
|
|
410
|
+
*
|
|
411
|
+
* 当应用是小程序应用,并需要发送小程序消息时,需要指定appid
|
|
412
|
+
* @type {string}
|
|
413
|
+
* @memberof WxOrganConfig
|
|
414
|
+
*/
|
|
415
|
+
appid?: string;
|
|
416
|
+
/**
|
|
417
|
+
*
|
|
418
|
+
* 当应用是自建应用,且需要发送应用消息时,需要指定应用id
|
|
419
|
+
* @type {string}
|
|
420
|
+
* @memberof WxOrganConfig
|
|
421
|
+
*/
|
|
422
|
+
agentid?: number;
|
|
423
|
+
/**
|
|
424
|
+
*
|
|
425
|
+
* 是否开启消息回调?
|
|
426
|
+
* 当开启时,必须指定token\encodingAesKey
|
|
427
|
+
* 访问地址: /wx-organ/appCode.json
|
|
428
|
+
* @type {boolean}
|
|
429
|
+
* @memberof WxOrganConfig
|
|
430
|
+
*/
|
|
431
|
+
msHook?: boolean;
|
|
432
|
+
/**
|
|
433
|
+
*
|
|
434
|
+
* 消息回调解密token
|
|
435
|
+
* @type {string}
|
|
436
|
+
* @memberof WxOrganConfig
|
|
437
|
+
*/
|
|
438
|
+
token?: string;
|
|
439
|
+
/**
|
|
440
|
+
*
|
|
441
|
+
* 消息回调解密 key
|
|
442
|
+
* @type {string}
|
|
443
|
+
* @memberof WxOrganConfig
|
|
444
|
+
*/
|
|
445
|
+
encodingAESKey?: string;
|
|
446
|
+
/**
|
|
447
|
+
*
|
|
448
|
+
* 小程序消息模板
|
|
449
|
+
* 发送时只要指定name即可
|
|
450
|
+
* 一个name可以有多个消息
|
|
451
|
+
* @memberof WxOrganConfig
|
|
452
|
+
*/
|
|
453
|
+
miniMessages?: Array<{
|
|
454
|
+
name: string;
|
|
455
|
+
model: string;
|
|
456
|
+
page: string;
|
|
457
|
+
}>;
|
|
458
|
+
/**
|
|
459
|
+
*
|
|
460
|
+
* 非小程序消息模板
|
|
461
|
+
* 发送时只要指定name即可
|
|
462
|
+
* 一个name可以有多个消息
|
|
463
|
+
* https://work.weixin.qq.com/api/doc#90000/90135/90236
|
|
464
|
+
* @memberof WxOrganConfig
|
|
465
|
+
*/
|
|
466
|
+
messages?: Array<{
|
|
467
|
+
name: string;
|
|
468
|
+
msgtype: 'text' | 'image' | 'voice' | 'video' | 'file' | 'textcard' | 'news' | 'mpnews' | 'markdown' | 'taskcard';
|
|
469
|
+
safe?: 0 | 1;
|
|
470
|
+
}>;
|
|
471
|
+
/**
|
|
472
|
+
*
|
|
473
|
+
* 接口模拟调用?
|
|
474
|
+
* 默认false
|
|
475
|
+
* @type {boolean}
|
|
476
|
+
* @memberof WxOrganConfig
|
|
477
|
+
*/
|
|
478
|
+
mock?: boolean;
|
|
479
|
+
}
|
|
480
|
+
export interface WxOrganMini {
|
|
481
|
+
title: string;
|
|
482
|
+
description?: string;
|
|
483
|
+
content_item?: {
|
|
484
|
+
[key: string]: string;
|
|
485
|
+
};
|
|
486
|
+
emphasis_first_item?: boolean;
|
|
487
|
+
}
|
|
488
|
+
export interface WxOrganText {
|
|
489
|
+
content: string;
|
|
490
|
+
}
|
|
491
|
+
export interface WxOrganImage {
|
|
492
|
+
media_id: string;
|
|
493
|
+
}
|
|
494
|
+
export interface WxOrganVoice {
|
|
495
|
+
media_id: string;
|
|
496
|
+
}
|
|
497
|
+
export interface WxOrganVideo {
|
|
498
|
+
media_id: string;
|
|
499
|
+
title?: string;
|
|
500
|
+
description?: string;
|
|
501
|
+
}
|
|
502
|
+
export interface WxOrganFile {
|
|
503
|
+
media_id: string;
|
|
504
|
+
}
|
|
505
|
+
export interface WxOrganTextCard {
|
|
506
|
+
url: string;
|
|
507
|
+
title: string;
|
|
508
|
+
description: string;
|
|
509
|
+
btntxt?: string;
|
|
510
|
+
}
|
|
511
|
+
export interface WxOrganNews {
|
|
512
|
+
articles: Array<{
|
|
513
|
+
title: string;
|
|
514
|
+
description?: string;
|
|
515
|
+
url: string;
|
|
516
|
+
picurl?: string;
|
|
517
|
+
}>;
|
|
518
|
+
}
|
|
519
|
+
export interface WxOrganMpNews {
|
|
520
|
+
articles: Array<{
|
|
521
|
+
title: string;
|
|
522
|
+
thumb_media_id: string;
|
|
523
|
+
author?: string;
|
|
524
|
+
content_source_url?: string;
|
|
525
|
+
content: string;
|
|
526
|
+
digest?: string;
|
|
527
|
+
}>;
|
|
528
|
+
}
|
|
529
|
+
export interface WxOrganMarkDown {
|
|
530
|
+
content: string;
|
|
531
|
+
}
|
|
532
|
+
export interface WxOrganTaskCard {
|
|
533
|
+
title: string;
|
|
534
|
+
description: string;
|
|
535
|
+
url?: string;
|
|
536
|
+
task_id: string;
|
|
537
|
+
btn: Array<{
|
|
538
|
+
key: string;
|
|
539
|
+
name: string;
|
|
540
|
+
replace_name?: string;
|
|
541
|
+
color?: 'red' | 'blue';
|
|
542
|
+
is_bold?: boolean;
|
|
543
|
+
}>;
|
|
544
|
+
}
|
|
545
|
+
export interface WxLiveInfo {
|
|
546
|
+
name: string;
|
|
547
|
+
roomid: number;
|
|
548
|
+
cover_img: string;
|
|
549
|
+
live_satus: number;
|
|
550
|
+
start_time: number;
|
|
551
|
+
end_time: number;
|
|
552
|
+
anchor_name: string;
|
|
553
|
+
anchor_img: string;
|
|
554
|
+
goods: Array<{
|
|
555
|
+
cover_img: string;
|
|
556
|
+
url: string;
|
|
557
|
+
price: number;
|
|
558
|
+
name: string;
|
|
559
|
+
}>;
|
|
560
|
+
}
|