@antchain/gesaas_spi 1.1.0
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/dist/client.d.ts +395 -0
- package/dist/client.js +523 -0
- package/dist/client.js.map +1 -0
- package/package.json +31 -0
- package/src/client.ts +799 -0
package/src/client.ts
ADDED
|
@@ -0,0 +1,799 @@
|
|
|
1
|
+
// This file is auto-generated, don't edit it
|
|
2
|
+
import AntchainUtil from '@antchain/alipay-util';
|
|
3
|
+
import Util, * as $Util from '@alicloud/tea-util';
|
|
4
|
+
import RPCUtil from '@alicloud/rpc-util';
|
|
5
|
+
import * as $tea from '@alicloud/tea-typescript';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @remarks
|
|
9
|
+
* Model for initing client
|
|
10
|
+
*/
|
|
11
|
+
export class Config extends $tea.Model {
|
|
12
|
+
/**
|
|
13
|
+
* @remarks
|
|
14
|
+
* accesskey id
|
|
15
|
+
*/
|
|
16
|
+
accessKeyId?: string;
|
|
17
|
+
/**
|
|
18
|
+
* @remarks
|
|
19
|
+
* accesskey secret
|
|
20
|
+
*/
|
|
21
|
+
accessKeySecret?: string;
|
|
22
|
+
/**
|
|
23
|
+
* @remarks
|
|
24
|
+
* security token
|
|
25
|
+
*/
|
|
26
|
+
securityToken?: string;
|
|
27
|
+
/**
|
|
28
|
+
* @remarks
|
|
29
|
+
* http protocol
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* http
|
|
33
|
+
*/
|
|
34
|
+
protocol?: string;
|
|
35
|
+
/**
|
|
36
|
+
* @remarks
|
|
37
|
+
* read timeout
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* 10
|
|
41
|
+
*/
|
|
42
|
+
readTimeout?: number;
|
|
43
|
+
/**
|
|
44
|
+
* @remarks
|
|
45
|
+
* connect timeout
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* 10
|
|
49
|
+
*/
|
|
50
|
+
connectTimeout?: number;
|
|
51
|
+
/**
|
|
52
|
+
* @remarks
|
|
53
|
+
* http proxy
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* http://localhost
|
|
57
|
+
*/
|
|
58
|
+
httpProxy?: string;
|
|
59
|
+
/**
|
|
60
|
+
* @remarks
|
|
61
|
+
* https proxy
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* https://localhost
|
|
65
|
+
*/
|
|
66
|
+
httpsProxy?: string;
|
|
67
|
+
/**
|
|
68
|
+
* @remarks
|
|
69
|
+
* endpoint
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* cs.aliyuncs.com
|
|
73
|
+
*/
|
|
74
|
+
endpoint?: string;
|
|
75
|
+
/**
|
|
76
|
+
* @remarks
|
|
77
|
+
* proxy white list
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* http://localhost
|
|
81
|
+
*/
|
|
82
|
+
noProxy?: string;
|
|
83
|
+
/**
|
|
84
|
+
* @remarks
|
|
85
|
+
* max idle conns
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* 3
|
|
89
|
+
*/
|
|
90
|
+
maxIdleConns?: number;
|
|
91
|
+
/**
|
|
92
|
+
* @remarks
|
|
93
|
+
* user agent
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* Alibabacloud/1
|
|
97
|
+
*/
|
|
98
|
+
userAgent?: string;
|
|
99
|
+
/**
|
|
100
|
+
* @remarks
|
|
101
|
+
* socks5 proxy
|
|
102
|
+
*/
|
|
103
|
+
socks5Proxy?: string;
|
|
104
|
+
/**
|
|
105
|
+
* @remarks
|
|
106
|
+
* socks5 network
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* TCP
|
|
110
|
+
*/
|
|
111
|
+
socks5NetWork?: string;
|
|
112
|
+
/**
|
|
113
|
+
* @remarks
|
|
114
|
+
* 长链接最大空闲时长
|
|
115
|
+
*/
|
|
116
|
+
maxIdleTimeMillis?: number;
|
|
117
|
+
/**
|
|
118
|
+
* @remarks
|
|
119
|
+
* 长链接最大连接时长
|
|
120
|
+
*/
|
|
121
|
+
keepAliveDurationMillis?: number;
|
|
122
|
+
/**
|
|
123
|
+
* @remarks
|
|
124
|
+
* 最大连接数(长链接最大总数)
|
|
125
|
+
*/
|
|
126
|
+
maxRequests?: number;
|
|
127
|
+
/**
|
|
128
|
+
* @remarks
|
|
129
|
+
* 每个目标主机的最大连接数(分主机域名的长链接最大总数
|
|
130
|
+
*/
|
|
131
|
+
maxRequestsPerHost?: number;
|
|
132
|
+
static names(): { [key: string]: string } {
|
|
133
|
+
return {
|
|
134
|
+
accessKeyId: 'accessKeyId',
|
|
135
|
+
accessKeySecret: 'accessKeySecret',
|
|
136
|
+
securityToken: 'securityToken',
|
|
137
|
+
protocol: 'protocol',
|
|
138
|
+
readTimeout: 'readTimeout',
|
|
139
|
+
connectTimeout: 'connectTimeout',
|
|
140
|
+
httpProxy: 'httpProxy',
|
|
141
|
+
httpsProxy: 'httpsProxy',
|
|
142
|
+
endpoint: 'endpoint',
|
|
143
|
+
noProxy: 'noProxy',
|
|
144
|
+
maxIdleConns: 'maxIdleConns',
|
|
145
|
+
userAgent: 'userAgent',
|
|
146
|
+
socks5Proxy: 'socks5Proxy',
|
|
147
|
+
socks5NetWork: 'socks5NetWork',
|
|
148
|
+
maxIdleTimeMillis: 'maxIdleTimeMillis',
|
|
149
|
+
keepAliveDurationMillis: 'keepAliveDurationMillis',
|
|
150
|
+
maxRequests: 'maxRequests',
|
|
151
|
+
maxRequestsPerHost: 'maxRequestsPerHost',
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
static types(): { [key: string]: any } {
|
|
156
|
+
return {
|
|
157
|
+
accessKeyId: 'string',
|
|
158
|
+
accessKeySecret: 'string',
|
|
159
|
+
securityToken: 'string',
|
|
160
|
+
protocol: 'string',
|
|
161
|
+
readTimeout: 'number',
|
|
162
|
+
connectTimeout: 'number',
|
|
163
|
+
httpProxy: 'string',
|
|
164
|
+
httpsProxy: 'string',
|
|
165
|
+
endpoint: 'string',
|
|
166
|
+
noProxy: 'string',
|
|
167
|
+
maxIdleConns: 'number',
|
|
168
|
+
userAgent: 'string',
|
|
169
|
+
socks5Proxy: 'string',
|
|
170
|
+
socks5NetWork: 'string',
|
|
171
|
+
maxIdleTimeMillis: 'number',
|
|
172
|
+
keepAliveDurationMillis: 'number',
|
|
173
|
+
maxRequests: 'number',
|
|
174
|
+
maxRequestsPerHost: 'number',
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
constructor(map?: { [key: string]: any }) {
|
|
179
|
+
super(map);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// 发放订单明细
|
|
184
|
+
export class GrantOrderDetail extends $tea.Model {
|
|
185
|
+
// 券编码
|
|
186
|
+
/**
|
|
187
|
+
* @example
|
|
188
|
+
* 1798234932684395
|
|
189
|
+
*/
|
|
190
|
+
voucherCode: string;
|
|
191
|
+
static names(): { [key: string]: string } {
|
|
192
|
+
return {
|
|
193
|
+
voucherCode: 'voucher_code',
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
static types(): { [key: string]: any } {
|
|
198
|
+
return {
|
|
199
|
+
voucherCode: 'string',
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
constructor(map?: { [key: string]: any }) {
|
|
204
|
+
super(map);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export class PushRightsprodVoucherRequest extends $tea.Model {
|
|
209
|
+
// OAuth模式下的授权token
|
|
210
|
+
authToken?: string;
|
|
211
|
+
productInstanceId?: string;
|
|
212
|
+
// 权益编码
|
|
213
|
+
rightsCode: string;
|
|
214
|
+
// 权益凭证编码/券码
|
|
215
|
+
voucherCode: string;
|
|
216
|
+
// 业务类型
|
|
217
|
+
// GRANT:发放
|
|
218
|
+
// VERIFY:核销 GRANT_CANCEL:发放撤销 VERIFY_CANCEL:核销撤销 FREEZE:冻结
|
|
219
|
+
// UNFREEZE:解冻
|
|
220
|
+
bizType: string;
|
|
221
|
+
// FAIL:失败
|
|
222
|
+
// SUCCESS:成功
|
|
223
|
+
status?: string;
|
|
224
|
+
// 外部订单号
|
|
225
|
+
outTradeOrderNo?: string;
|
|
226
|
+
// 失败信息
|
|
227
|
+
failMsg?: string;
|
|
228
|
+
// 外部发放调用时传入信息
|
|
229
|
+
grantInfo?: string;
|
|
230
|
+
static names(): { [key: string]: string } {
|
|
231
|
+
return {
|
|
232
|
+
authToken: 'auth_token',
|
|
233
|
+
productInstanceId: 'product_instance_id',
|
|
234
|
+
rightsCode: 'rights_code',
|
|
235
|
+
voucherCode: 'voucher_code',
|
|
236
|
+
bizType: 'biz_type',
|
|
237
|
+
status: 'status',
|
|
238
|
+
outTradeOrderNo: 'out_trade_order_no',
|
|
239
|
+
failMsg: 'fail_msg',
|
|
240
|
+
grantInfo: 'grant_info',
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
static types(): { [key: string]: any } {
|
|
245
|
+
return {
|
|
246
|
+
authToken: 'string',
|
|
247
|
+
productInstanceId: 'string',
|
|
248
|
+
rightsCode: 'string',
|
|
249
|
+
voucherCode: 'string',
|
|
250
|
+
bizType: 'string',
|
|
251
|
+
status: 'string',
|
|
252
|
+
outTradeOrderNo: 'string',
|
|
253
|
+
failMsg: 'string',
|
|
254
|
+
grantInfo: 'string',
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
constructor(map?: { [key: string]: any }) {
|
|
259
|
+
super(map);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
export class PushRightsprodVoucherResponse extends $tea.Model {
|
|
264
|
+
// 请求唯一ID,用于链路跟踪和问题排查
|
|
265
|
+
reqMsgId?: string;
|
|
266
|
+
// 结果码,一般OK表示调用成功
|
|
267
|
+
resultCode?: string;
|
|
268
|
+
// 异常信息的文本描述
|
|
269
|
+
resultMsg?: string;
|
|
270
|
+
// 同步结果 success 同步成功
|
|
271
|
+
result?: string;
|
|
272
|
+
static names(): { [key: string]: string } {
|
|
273
|
+
return {
|
|
274
|
+
reqMsgId: 'req_msg_id',
|
|
275
|
+
resultCode: 'result_code',
|
|
276
|
+
resultMsg: 'result_msg',
|
|
277
|
+
result: 'result',
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
static types(): { [key: string]: any } {
|
|
282
|
+
return {
|
|
283
|
+
reqMsgId: 'string',
|
|
284
|
+
resultCode: 'string',
|
|
285
|
+
resultMsg: 'string',
|
|
286
|
+
result: 'string',
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
constructor(map?: { [key: string]: any }) {
|
|
291
|
+
super(map);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export class CallbackRightsprodStatusRequest extends $tea.Model {
|
|
296
|
+
// OAuth模式下的授权token
|
|
297
|
+
authToken?: string;
|
|
298
|
+
productInstanceId?: string;
|
|
299
|
+
// 权益编码
|
|
300
|
+
rightsCode: string;
|
|
301
|
+
// 券码
|
|
302
|
+
voucherCode: string;
|
|
303
|
+
// 券变更状态
|
|
304
|
+
// V_USE(使用)
|
|
305
|
+
// V_REFUND(退款)
|
|
306
|
+
// V_EXPIRE(过期)
|
|
307
|
+
// V_INVALID(作废)
|
|
308
|
+
status: string;
|
|
309
|
+
static names(): { [key: string]: string } {
|
|
310
|
+
return {
|
|
311
|
+
authToken: 'auth_token',
|
|
312
|
+
productInstanceId: 'product_instance_id',
|
|
313
|
+
rightsCode: 'rights_code',
|
|
314
|
+
voucherCode: 'voucher_code',
|
|
315
|
+
status: 'status',
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
static types(): { [key: string]: any } {
|
|
320
|
+
return {
|
|
321
|
+
authToken: 'string',
|
|
322
|
+
productInstanceId: 'string',
|
|
323
|
+
rightsCode: 'string',
|
|
324
|
+
voucherCode: 'string',
|
|
325
|
+
status: 'string',
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
constructor(map?: { [key: string]: any }) {
|
|
330
|
+
super(map);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export class CallbackRightsprodStatusResponse extends $tea.Model {
|
|
335
|
+
// 请求唯一ID,用于链路跟踪和问题排查
|
|
336
|
+
reqMsgId?: string;
|
|
337
|
+
// 结果码,一般OK表示调用成功
|
|
338
|
+
resultCode?: string;
|
|
339
|
+
// 异常信息的文本描述
|
|
340
|
+
resultMsg?: string;
|
|
341
|
+
// 同步结果 success 同步成功
|
|
342
|
+
result?: string;
|
|
343
|
+
static names(): { [key: string]: string } {
|
|
344
|
+
return {
|
|
345
|
+
reqMsgId: 'req_msg_id',
|
|
346
|
+
resultCode: 'result_code',
|
|
347
|
+
resultMsg: 'result_msg',
|
|
348
|
+
result: 'result',
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
static types(): { [key: string]: any } {
|
|
353
|
+
return {
|
|
354
|
+
reqMsgId: 'string',
|
|
355
|
+
resultCode: 'string',
|
|
356
|
+
resultMsg: 'string',
|
|
357
|
+
result: 'string',
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
constructor(map?: { [key: string]: any }) {
|
|
362
|
+
super(map);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export class CallbackRightsprodOperationRequest extends $tea.Model {
|
|
367
|
+
// OAuth模式下的授权token
|
|
368
|
+
authToken?: string;
|
|
369
|
+
productInstanceId?: string;
|
|
370
|
+
// 权益编码
|
|
371
|
+
rightsCode: string;
|
|
372
|
+
// 券码
|
|
373
|
+
voucherCode: string;
|
|
374
|
+
// 通知ID(幂等)
|
|
375
|
+
notifyId: string;
|
|
376
|
+
// 业务类型
|
|
377
|
+
// V_REFUND(退款)
|
|
378
|
+
// V_EXPIRE(过期)
|
|
379
|
+
// V_INVALID(作废)
|
|
380
|
+
// V_USE(使用)
|
|
381
|
+
bizType: string;
|
|
382
|
+
// 支付订单号
|
|
383
|
+
payOrderNo?: string;
|
|
384
|
+
// 券面额
|
|
385
|
+
faceAmount?: string;
|
|
386
|
+
// 流通金额(核销、退款时 金额)
|
|
387
|
+
fluxAmount?: string;
|
|
388
|
+
static names(): { [key: string]: string } {
|
|
389
|
+
return {
|
|
390
|
+
authToken: 'auth_token',
|
|
391
|
+
productInstanceId: 'product_instance_id',
|
|
392
|
+
rightsCode: 'rights_code',
|
|
393
|
+
voucherCode: 'voucher_code',
|
|
394
|
+
notifyId: 'notify_id',
|
|
395
|
+
bizType: 'biz_type',
|
|
396
|
+
payOrderNo: 'pay_order_no',
|
|
397
|
+
faceAmount: 'face_amount',
|
|
398
|
+
fluxAmount: 'flux_amount',
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
static types(): { [key: string]: any } {
|
|
403
|
+
return {
|
|
404
|
+
authToken: 'string',
|
|
405
|
+
productInstanceId: 'string',
|
|
406
|
+
rightsCode: 'string',
|
|
407
|
+
voucherCode: 'string',
|
|
408
|
+
notifyId: 'string',
|
|
409
|
+
bizType: 'string',
|
|
410
|
+
payOrderNo: 'string',
|
|
411
|
+
faceAmount: 'string',
|
|
412
|
+
fluxAmount: 'string',
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
constructor(map?: { [key: string]: any }) {
|
|
417
|
+
super(map);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export class CallbackRightsprodOperationResponse extends $tea.Model {
|
|
422
|
+
// 请求唯一ID,用于链路跟踪和问题排查
|
|
423
|
+
reqMsgId?: string;
|
|
424
|
+
// 结果码,一般OK表示调用成功
|
|
425
|
+
resultCode?: string;
|
|
426
|
+
// 异常信息的文本描述
|
|
427
|
+
resultMsg?: string;
|
|
428
|
+
// 同步结果
|
|
429
|
+
// success 为同步成功其他均为失败
|
|
430
|
+
result?: string;
|
|
431
|
+
static names(): { [key: string]: string } {
|
|
432
|
+
return {
|
|
433
|
+
reqMsgId: 'req_msg_id',
|
|
434
|
+
resultCode: 'result_code',
|
|
435
|
+
resultMsg: 'result_msg',
|
|
436
|
+
result: 'result',
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
static types(): { [key: string]: any } {
|
|
441
|
+
return {
|
|
442
|
+
reqMsgId: 'string',
|
|
443
|
+
resultCode: 'string',
|
|
444
|
+
resultMsg: 'string',
|
|
445
|
+
result: 'string',
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
constructor(map?: { [key: string]: any }) {
|
|
450
|
+
super(map);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
export class PushRightsprodGrantrightsRequest extends $tea.Model {
|
|
455
|
+
// OAuth模式下的授权token
|
|
456
|
+
authToken?: string;
|
|
457
|
+
productInstanceId?: string;
|
|
458
|
+
// 用户ID
|
|
459
|
+
userId?: string;
|
|
460
|
+
// 手机号
|
|
461
|
+
phoneNumber?: string;
|
|
462
|
+
// 商户编码
|
|
463
|
+
merchantNo?: string;
|
|
464
|
+
// 权益编码
|
|
465
|
+
rightsCode: string;
|
|
466
|
+
// 发放数量,可根据权益信息grantMulti判断是否可发多张
|
|
467
|
+
grantNum?: number;
|
|
468
|
+
// 外部发放订单号
|
|
469
|
+
outGrantOrderNo: string;
|
|
470
|
+
// 发放扩展信息,如活动ID等信息,暂时可以不传
|
|
471
|
+
grantInfo?: string;
|
|
472
|
+
static names(): { [key: string]: string } {
|
|
473
|
+
return {
|
|
474
|
+
authToken: 'auth_token',
|
|
475
|
+
productInstanceId: 'product_instance_id',
|
|
476
|
+
userId: 'user_id',
|
|
477
|
+
phoneNumber: 'phone_number',
|
|
478
|
+
merchantNo: 'merchant_no',
|
|
479
|
+
rightsCode: 'rights_code',
|
|
480
|
+
grantNum: 'grant_num',
|
|
481
|
+
outGrantOrderNo: 'out_grant_order_no',
|
|
482
|
+
grantInfo: 'grant_info',
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
static types(): { [key: string]: any } {
|
|
487
|
+
return {
|
|
488
|
+
authToken: 'string',
|
|
489
|
+
productInstanceId: 'string',
|
|
490
|
+
userId: 'string',
|
|
491
|
+
phoneNumber: 'string',
|
|
492
|
+
merchantNo: 'string',
|
|
493
|
+
rightsCode: 'string',
|
|
494
|
+
grantNum: 'number',
|
|
495
|
+
outGrantOrderNo: 'string',
|
|
496
|
+
grantInfo: 'string',
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
constructor(map?: { [key: string]: any }) {
|
|
501
|
+
super(map);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
export class PushRightsprodGrantrightsResponse extends $tea.Model {
|
|
506
|
+
// 请求唯一ID,用于链路跟踪和问题排查
|
|
507
|
+
reqMsgId?: string;
|
|
508
|
+
// 结果码,一般OK表示调用成功
|
|
509
|
+
resultCode?: string;
|
|
510
|
+
// 异常信息的文本描述
|
|
511
|
+
resultMsg?: string;
|
|
512
|
+
// 发放状态:
|
|
513
|
+
// GRANTING:发放处理中 GRANT_SUCCESS:发放成功 GRANT_FAIL:发放失败
|
|
514
|
+
grantStatus?: string;
|
|
515
|
+
// 过期时间
|
|
516
|
+
expireTime?: string;
|
|
517
|
+
// 生效时间
|
|
518
|
+
effectTime?: string;
|
|
519
|
+
// 发放订单明细数据
|
|
520
|
+
orderDetails?: GrantOrderDetail[];
|
|
521
|
+
static names(): { [key: string]: string } {
|
|
522
|
+
return {
|
|
523
|
+
reqMsgId: 'req_msg_id',
|
|
524
|
+
resultCode: 'result_code',
|
|
525
|
+
resultMsg: 'result_msg',
|
|
526
|
+
grantStatus: 'grant_status',
|
|
527
|
+
expireTime: 'expire_time',
|
|
528
|
+
effectTime: 'effect_time',
|
|
529
|
+
orderDetails: 'order_details',
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
static types(): { [key: string]: any } {
|
|
534
|
+
return {
|
|
535
|
+
reqMsgId: 'string',
|
|
536
|
+
resultCode: 'string',
|
|
537
|
+
resultMsg: 'string',
|
|
538
|
+
grantStatus: 'string',
|
|
539
|
+
expireTime: 'string',
|
|
540
|
+
effectTime: 'string',
|
|
541
|
+
orderDetails: { 'type': 'array', 'itemType': GrantOrderDetail },
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
constructor(map?: { [key: string]: any }) {
|
|
546
|
+
super(map);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
export default class Client {
|
|
552
|
+
_endpoint: string;
|
|
553
|
+
_regionId: string;
|
|
554
|
+
_accessKeyId: string;
|
|
555
|
+
_accessKeySecret: string;
|
|
556
|
+
_protocol: string;
|
|
557
|
+
_userAgent: string;
|
|
558
|
+
_readTimeout: number;
|
|
559
|
+
_connectTimeout: number;
|
|
560
|
+
_httpProxy: string;
|
|
561
|
+
_httpsProxy: string;
|
|
562
|
+
_socks5Proxy: string;
|
|
563
|
+
_socks5NetWork: string;
|
|
564
|
+
_noProxy: string;
|
|
565
|
+
_maxIdleConns: number;
|
|
566
|
+
_securityToken: string;
|
|
567
|
+
_maxIdleTimeMillis: number;
|
|
568
|
+
_keepAliveDurationMillis: number;
|
|
569
|
+
_maxRequests: number;
|
|
570
|
+
_maxRequestsPerHost: number;
|
|
571
|
+
|
|
572
|
+
/**
|
|
573
|
+
* @remarks
|
|
574
|
+
* Init client with Config
|
|
575
|
+
*
|
|
576
|
+
* @param config - config contains the necessary information to create a client
|
|
577
|
+
*/
|
|
578
|
+
constructor(config: Config) {
|
|
579
|
+
if (Util.isUnset(config)) {
|
|
580
|
+
throw $tea.newError({
|
|
581
|
+
code: "ParameterMissing",
|
|
582
|
+
message: "'config' can not be unset",
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
this._accessKeyId = config.accessKeyId;
|
|
587
|
+
this._accessKeySecret = config.accessKeySecret;
|
|
588
|
+
this._securityToken = config.securityToken;
|
|
589
|
+
this._endpoint = config.endpoint;
|
|
590
|
+
this._protocol = config.protocol;
|
|
591
|
+
this._userAgent = config.userAgent;
|
|
592
|
+
this._readTimeout = Util.defaultNumber(config.readTimeout, 20000);
|
|
593
|
+
this._connectTimeout = Util.defaultNumber(config.connectTimeout, 20000);
|
|
594
|
+
this._httpProxy = config.httpProxy;
|
|
595
|
+
this._httpsProxy = config.httpsProxy;
|
|
596
|
+
this._noProxy = config.noProxy;
|
|
597
|
+
this._socks5Proxy = config.socks5Proxy;
|
|
598
|
+
this._socks5NetWork = config.socks5NetWork;
|
|
599
|
+
this._maxIdleConns = Util.defaultNumber(config.maxIdleConns, 60000);
|
|
600
|
+
this._maxIdleTimeMillis = Util.defaultNumber(config.maxIdleTimeMillis, 5);
|
|
601
|
+
this._keepAliveDurationMillis = Util.defaultNumber(config.keepAliveDurationMillis, 5000);
|
|
602
|
+
this._maxRequests = Util.defaultNumber(config.maxRequests, 100);
|
|
603
|
+
this._maxRequestsPerHost = Util.defaultNumber(config.maxRequestsPerHost, 100);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* @remarks
|
|
608
|
+
* Encapsulate the request and invoke the network
|
|
609
|
+
*
|
|
610
|
+
* @param action - api name
|
|
611
|
+
* @param protocol - http or https
|
|
612
|
+
* @param method - e.g. GET
|
|
613
|
+
* @param pathname - pathname of every api
|
|
614
|
+
* @param request - which contains request params
|
|
615
|
+
* @param runtime - which controls some details of call api, such as retry times
|
|
616
|
+
* @returns the response
|
|
617
|
+
*/
|
|
618
|
+
async doRequest(version: string, action: string, protocol: string, method: string, pathname: string, request: {[key: string]: any}, headers: {[key: string ]: string}, runtime: $Util.RuntimeOptions): Promise<{[key: string]: any}> {
|
|
619
|
+
let _runtime: { [key: string]: any } = {
|
|
620
|
+
timeouted: "retry",
|
|
621
|
+
readTimeout: Util.defaultNumber(runtime.readTimeout, this._readTimeout),
|
|
622
|
+
connectTimeout: Util.defaultNumber(runtime.connectTimeout, this._connectTimeout),
|
|
623
|
+
httpProxy: Util.defaultString(runtime.httpProxy, this._httpProxy),
|
|
624
|
+
httpsProxy: Util.defaultString(runtime.httpsProxy, this._httpsProxy),
|
|
625
|
+
noProxy: Util.defaultString(runtime.noProxy, this._noProxy),
|
|
626
|
+
maxIdleConns: Util.defaultNumber(runtime.maxIdleConns, this._maxIdleConns),
|
|
627
|
+
maxIdleTimeMillis: this._maxIdleTimeMillis,
|
|
628
|
+
keepAliveDuration: this._keepAliveDurationMillis,
|
|
629
|
+
maxRequests: this._maxRequests,
|
|
630
|
+
maxRequestsPerHost: this._maxRequestsPerHost,
|
|
631
|
+
retry: {
|
|
632
|
+
retryable: runtime.autoretry,
|
|
633
|
+
maxAttempts: Util.defaultNumber(runtime.maxAttempts, 3),
|
|
634
|
+
},
|
|
635
|
+
backoff: {
|
|
636
|
+
policy: Util.defaultString(runtime.backoffPolicy, "no"),
|
|
637
|
+
period: Util.defaultNumber(runtime.backoffPeriod, 1),
|
|
638
|
+
},
|
|
639
|
+
ignoreSSL: runtime.ignoreSSL,
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
let _lastRequest = null;
|
|
643
|
+
let _now = Date.now();
|
|
644
|
+
let _retryTimes = 0;
|
|
645
|
+
while ($tea.allowRetry(_runtime['retry'], _retryTimes, _now)) {
|
|
646
|
+
if (_retryTimes > 0) {
|
|
647
|
+
let _backoffTime = $tea.getBackoffTime(_runtime['backoff'], _retryTimes);
|
|
648
|
+
if (_backoffTime > 0) {
|
|
649
|
+
await $tea.sleep(_backoffTime);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
_retryTimes = _retryTimes + 1;
|
|
654
|
+
try {
|
|
655
|
+
let request_ = new $tea.Request();
|
|
656
|
+
request_.protocol = Util.defaultString(this._protocol, protocol);
|
|
657
|
+
request_.method = method;
|
|
658
|
+
request_.pathname = pathname;
|
|
659
|
+
request_.query = {
|
|
660
|
+
method: action,
|
|
661
|
+
version: version,
|
|
662
|
+
sign_type: "HmacSHA1",
|
|
663
|
+
req_time: AntchainUtil.getTimestamp(),
|
|
664
|
+
req_msg_id: AntchainUtil.getNonce(),
|
|
665
|
+
access_key: this._accessKeyId,
|
|
666
|
+
base_sdk_version: "TeaSDK-2.0",
|
|
667
|
+
sdk_version: "1.1.0",
|
|
668
|
+
_prod_code: "GESAAS_SPI",
|
|
669
|
+
_prod_channel: "default",
|
|
670
|
+
};
|
|
671
|
+
if (!Util.empty(this._securityToken)) {
|
|
672
|
+
request_.query["security_token"] = this._securityToken;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
request_.headers = {
|
|
676
|
+
host: Util.defaultString(this._endpoint, "openapi.antchain.antgroup.com"),
|
|
677
|
+
'user-agent': Util.getUserAgent(this._userAgent),
|
|
678
|
+
...headers,
|
|
679
|
+
};
|
|
680
|
+
let tmp = Util.anyifyMapValue(RPCUtil.query(request));
|
|
681
|
+
request_.body = new $tea.BytesReadable(Util.toFormString(tmp));
|
|
682
|
+
request_.headers["content-type"] = "application/x-www-form-urlencoded";
|
|
683
|
+
let signedParam = {
|
|
684
|
+
...request_.query,
|
|
685
|
+
...RPCUtil.query(request),
|
|
686
|
+
};
|
|
687
|
+
request_.query["sign"] = AntchainUtil.getSignature(signedParam, this._accessKeySecret);
|
|
688
|
+
_lastRequest = request_;
|
|
689
|
+
let response_ = await $tea.doAction(request_, _runtime);
|
|
690
|
+
|
|
691
|
+
let raw = await Util.readAsString(response_.body);
|
|
692
|
+
let obj = Util.parseJSON(raw);
|
|
693
|
+
let res = Util.assertAsMap(obj);
|
|
694
|
+
let resp = Util.assertAsMap(res["response"]);
|
|
695
|
+
if (AntchainUtil.hasError(raw, this._accessKeySecret)) {
|
|
696
|
+
throw $tea.newError({
|
|
697
|
+
message: resp["result_msg"],
|
|
698
|
+
data: resp,
|
|
699
|
+
code: resp["result_code"],
|
|
700
|
+
});
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
return resp;
|
|
704
|
+
} catch (ex) {
|
|
705
|
+
if ($tea.isRetryable(ex)) {
|
|
706
|
+
continue;
|
|
707
|
+
}
|
|
708
|
+
throw ex;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
throw $tea.newUnretryableError(_lastRequest);
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* @remarks
|
|
717
|
+
* Description: 权益中心权益券状态推送
|
|
718
|
+
* Summary: 券状态推送
|
|
719
|
+
*/
|
|
720
|
+
async pushRightsprodVoucher(request: PushRightsprodVoucherRequest): Promise<PushRightsprodVoucherResponse> {
|
|
721
|
+
let runtime = new $Util.RuntimeOptions({ });
|
|
722
|
+
let headers : {[key: string ]: string} = { };
|
|
723
|
+
return await this.pushRightsprodVoucherEx(request, headers, runtime);
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
/**
|
|
727
|
+
* @remarks
|
|
728
|
+
* Description: 权益中心权益券状态推送
|
|
729
|
+
* Summary: 券状态推送
|
|
730
|
+
*/
|
|
731
|
+
async pushRightsprodVoucherEx(request: PushRightsprodVoucherRequest, headers: {[key: string ]: string}, runtime: $Util.RuntimeOptions): Promise<PushRightsprodVoucherResponse> {
|
|
732
|
+
Util.validateModel(request);
|
|
733
|
+
return $tea.cast<PushRightsprodVoucherResponse>(await this.doRequest("1.0", "antdigital.gesaasspi.rightsprod.voucher.push", "HTTPS", "POST", `/gateway.do`, $tea.toMap(request), headers, runtime), new PushRightsprodVoucherResponse({}));
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/**
|
|
737
|
+
* @remarks
|
|
738
|
+
* Description: 权益中心券状态变更回调通知
|
|
739
|
+
* Summary: 权益中心券状态变更回调通知
|
|
740
|
+
*/
|
|
741
|
+
async callbackRightsprodStatus(request: CallbackRightsprodStatusRequest): Promise<CallbackRightsprodStatusResponse> {
|
|
742
|
+
let runtime = new $Util.RuntimeOptions({ });
|
|
743
|
+
let headers : {[key: string ]: string} = { };
|
|
744
|
+
return await this.callbackRightsprodStatusEx(request, headers, runtime);
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* @remarks
|
|
749
|
+
* Description: 权益中心券状态变更回调通知
|
|
750
|
+
* Summary: 权益中心券状态变更回调通知
|
|
751
|
+
*/
|
|
752
|
+
async callbackRightsprodStatusEx(request: CallbackRightsprodStatusRequest, headers: {[key: string ]: string}, runtime: $Util.RuntimeOptions): Promise<CallbackRightsprodStatusResponse> {
|
|
753
|
+
Util.validateModel(request);
|
|
754
|
+
return $tea.cast<CallbackRightsprodStatusResponse>(await this.doRequest("1.0", "antdigital.gesaasspi.rightsprod.status.callback", "HTTPS", "POST", `/gateway.do`, $tea.toMap(request), headers, runtime), new CallbackRightsprodStatusResponse({}));
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* @remarks
|
|
759
|
+
* Description: 券操作回调通知
|
|
760
|
+
* Summary: 券操作回调通知
|
|
761
|
+
*/
|
|
762
|
+
async callbackRightsprodOperation(request: CallbackRightsprodOperationRequest): Promise<CallbackRightsprodOperationResponse> {
|
|
763
|
+
let runtime = new $Util.RuntimeOptions({ });
|
|
764
|
+
let headers : {[key: string ]: string} = { };
|
|
765
|
+
return await this.callbackRightsprodOperationEx(request, headers, runtime);
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* @remarks
|
|
770
|
+
* Description: 券操作回调通知
|
|
771
|
+
* Summary: 券操作回调通知
|
|
772
|
+
*/
|
|
773
|
+
async callbackRightsprodOperationEx(request: CallbackRightsprodOperationRequest, headers: {[key: string ]: string}, runtime: $Util.RuntimeOptions): Promise<CallbackRightsprodOperationResponse> {
|
|
774
|
+
Util.validateModel(request);
|
|
775
|
+
return $tea.cast<CallbackRightsprodOperationResponse>(await this.doRequest("1.0", "antdigital.gesaasspi.rightsprod.operation.callback", "HTTPS", "POST", `/gateway.do`, $tea.toMap(request), headers, runtime), new CallbackRightsprodOperationResponse({}));
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* @remarks
|
|
780
|
+
* Description: 权益供应商权益发放spi
|
|
781
|
+
* Summary: 权益供应商权益发放spi
|
|
782
|
+
*/
|
|
783
|
+
async pushRightsprodGrantrights(request: PushRightsprodGrantrightsRequest): Promise<PushRightsprodGrantrightsResponse> {
|
|
784
|
+
let runtime = new $Util.RuntimeOptions({ });
|
|
785
|
+
let headers : {[key: string ]: string} = { };
|
|
786
|
+
return await this.pushRightsprodGrantrightsEx(request, headers, runtime);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* @remarks
|
|
791
|
+
* Description: 权益供应商权益发放spi
|
|
792
|
+
* Summary: 权益供应商权益发放spi
|
|
793
|
+
*/
|
|
794
|
+
async pushRightsprodGrantrightsEx(request: PushRightsprodGrantrightsRequest, headers: {[key: string ]: string}, runtime: $Util.RuntimeOptions): Promise<PushRightsprodGrantrightsResponse> {
|
|
795
|
+
Util.validateModel(request);
|
|
796
|
+
return $tea.cast<PushRightsprodGrantrightsResponse>(await this.doRequest("1.0", "antdigital.gesaasspi.rightsprod.grantrights.push", "HTTPS", "POST", `/gateway.do`, $tea.toMap(request), headers, runtime), new PushRightsprodGrantrightsResponse({}));
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
}
|