@alicloud/xtee20210910 2.3.0 → 2.4.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 +37 -0
- package/dist/client.js +343 -4
- package/dist/client.js.map +1 -1
- package/dist/models/CreateForeignPocSampleAdvanceRequest.d.ts +40 -0
- package/dist/models/CreateForeignPocSampleAdvanceRequest.js +67 -0
- package/dist/models/CreateForeignPocSampleAdvanceRequest.js.map +1 -0
- package/dist/models/CreateForeignPocSampleRequest.d.ts +39 -0
- package/dist/models/CreateForeignPocSampleRequest.js +68 -0
- package/dist/models/CreateForeignPocSampleRequest.js.map +1 -0
- package/dist/models/CreateForeignPocSampleResponse.d.ts +19 -0
- package/dist/models/CreateForeignPocSampleResponse.js +69 -0
- package/dist/models/CreateForeignPocSampleResponse.js.map +1 -0
- package/dist/models/CreateForeignPocSampleResponseBody.d.ts +71 -0
- package/dist/models/CreateForeignPocSampleResponseBody.js +96 -0
- package/dist/models/CreateForeignPocSampleResponseBody.js.map +1 -0
- package/dist/models/DescribeRequestHitResponseBody.d.ts +8 -0
- package/dist/models/DescribeRequestHitResponseBody.js +2 -0
- package/dist/models/DescribeRequestHitResponseBody.js.map +1 -1
- package/dist/models/UploadForeignSampleFileAdvanceRequest.d.ts +30 -0
- package/dist/models/UploadForeignSampleFileAdvanceRequest.js +63 -0
- package/dist/models/UploadForeignSampleFileAdvanceRequest.js.map +1 -0
- package/dist/models/UploadForeignSampleFileRequest.d.ts +29 -0
- package/dist/models/UploadForeignSampleFileRequest.js +64 -0
- package/dist/models/UploadForeignSampleFileRequest.js.map +1 -0
- package/dist/models/UploadForeignSampleFileResponse.d.ts +19 -0
- package/dist/models/UploadForeignSampleFileResponse.js +69 -0
- package/dist/models/UploadForeignSampleFileResponse.js.map +1 -0
- package/dist/models/UploadForeignSampleFileResponseBody.d.ts +140 -0
- package/dist/models/UploadForeignSampleFileResponseBody.js +174 -0
- package/dist/models/UploadForeignSampleFileResponseBody.js.map +1 -0
- package/dist/models/model.d.ts +12 -0
- package/dist/models/model.js +48 -24
- package/dist/models/model.js.map +1 -1
- package/package.json +2 -1
- package/src/client.ts +373 -1
- package/src/models/CreateForeignPocSampleAdvanceRequest.ts +63 -0
- package/src/models/CreateForeignPocSampleRequest.ts +62 -0
- package/src/models/CreateForeignPocSampleResponse.ts +40 -0
- package/src/models/CreateForeignPocSampleResponseBody.ts +113 -0
- package/src/models/DescribeRequestHitResponseBody.ts +10 -0
- package/src/models/UploadForeignSampleFileAdvanceRequest.ts +49 -0
- package/src/models/UploadForeignSampleFileRequest.ts +48 -0
- package/src/models/UploadForeignSampleFileResponse.ts +40 -0
- package/src/models/UploadForeignSampleFileResponseBody.ts +242 -0
- package/src/models/model.ts +12 -0
package/dist/client.d.ts
CHANGED
|
@@ -5,6 +5,11 @@ import * as $_model from './models/model';
|
|
|
5
5
|
export * from './models/model';
|
|
6
6
|
export default class Client extends OpenApi {
|
|
7
7
|
constructor(config: $OpenApiUtil.Config);
|
|
8
|
+
_postOSSObject(bucketName: string, form: {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}, runtime: $dara.RuntimeOptions): Promise<{
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}>;
|
|
8
13
|
getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: {
|
|
9
14
|
[key: string]: string;
|
|
10
15
|
}, endpoint: string): string;
|
|
@@ -338,6 +343,22 @@ export default class Client extends OpenApi {
|
|
|
338
343
|
* @returns CreateFieldResponse
|
|
339
344
|
*/
|
|
340
345
|
createField(request: $_model.CreateFieldRequest): Promise<$_model.CreateFieldResponse>;
|
|
346
|
+
/**
|
|
347
|
+
* 创建样本记录对客
|
|
348
|
+
*
|
|
349
|
+
* @param request - CreateForeignPocSampleRequest
|
|
350
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
351
|
+
* @returns CreateForeignPocSampleResponse
|
|
352
|
+
*/
|
|
353
|
+
createForeignPocSampleWithOptions(request: $_model.CreateForeignPocSampleRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateForeignPocSampleResponse>;
|
|
354
|
+
/**
|
|
355
|
+
* 创建样本记录对客
|
|
356
|
+
*
|
|
357
|
+
* @param request - CreateForeignPocSampleRequest
|
|
358
|
+
* @returns CreateForeignPocSampleResponse
|
|
359
|
+
*/
|
|
360
|
+
createForeignPocSample(request: $_model.CreateForeignPocSampleRequest): Promise<$_model.CreateForeignPocSampleResponse>;
|
|
361
|
+
createForeignPocSampleAdvance(request: $_model.CreateForeignPocSampleAdvanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.CreateForeignPocSampleResponse>;
|
|
341
362
|
/**
|
|
342
363
|
* Submit Task
|
|
343
364
|
*
|
|
@@ -4418,6 +4439,22 @@ export default class Client extends OpenApi {
|
|
|
4418
4439
|
* @returns UploadFileCheckResponse
|
|
4419
4440
|
*/
|
|
4420
4441
|
uploadFileCheck(request: $_model.UploadFileCheckRequest): Promise<$_model.UploadFileCheckResponse>;
|
|
4442
|
+
/**
|
|
4443
|
+
* 上传并校验样本文件
|
|
4444
|
+
*
|
|
4445
|
+
* @param request - UploadForeignSampleFileRequest
|
|
4446
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
4447
|
+
* @returns UploadForeignSampleFileResponse
|
|
4448
|
+
*/
|
|
4449
|
+
uploadForeignSampleFileWithOptions(request: $_model.UploadForeignSampleFileRequest, runtime: $dara.RuntimeOptions): Promise<$_model.UploadForeignSampleFileResponse>;
|
|
4450
|
+
/**
|
|
4451
|
+
* 上传并校验样本文件
|
|
4452
|
+
*
|
|
4453
|
+
* @param request - UploadForeignSampleFileRequest
|
|
4454
|
+
* @returns UploadForeignSampleFileResponse
|
|
4455
|
+
*/
|
|
4456
|
+
uploadForeignSampleFile(request: $_model.UploadForeignSampleFileRequest): Promise<$_model.UploadForeignSampleFileResponse>;
|
|
4457
|
+
uploadForeignSampleFileAdvance(request: $_model.UploadForeignSampleFileAdvanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.UploadForeignSampleFileResponse>;
|
|
4421
4458
|
/**
|
|
4422
4459
|
* 上传并校验样本文件
|
|
4423
4460
|
*
|
package/dist/client.js
CHANGED
|
@@ -35,13 +35,10 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
37
|
};
|
|
38
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
-
};
|
|
41
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
39
|
// This file is auto-generated, don't edit it
|
|
43
40
|
const $dara = __importStar(require("@darabonba/typescript"));
|
|
44
|
-
const openapi_core_1 =
|
|
41
|
+
const openapi_core_1 = __importStar(require("@alicloud/openapi-core")), $OpenApi = openapi_core_1;
|
|
45
42
|
const openapi_core_2 = require("@alicloud/openapi-core");
|
|
46
43
|
const $_model = __importStar(require("./models/model"));
|
|
47
44
|
__exportStar(require("./models/model"), exports);
|
|
@@ -52,6 +49,84 @@ class Client extends openapi_core_1.default {
|
|
|
52
49
|
this.checkConfig(config);
|
|
53
50
|
this._endpoint = this.getEndpoint("xtee", this._regionId, this._endpointRule, this._network, this._suffix, this._endpointMap, this._endpoint);
|
|
54
51
|
}
|
|
52
|
+
async _postOSSObject(bucketName, form, runtime) {
|
|
53
|
+
let _runtime = {
|
|
54
|
+
key: runtime.key || this._key,
|
|
55
|
+
cert: runtime.cert || this._cert,
|
|
56
|
+
ca: runtime.ca || this._ca,
|
|
57
|
+
readTimeout: runtime.readTimeout || this._readTimeout,
|
|
58
|
+
connectTimeout: runtime.connectTimeout || this._connectTimeout,
|
|
59
|
+
httpProxy: runtime.httpProxy || this._httpProxy,
|
|
60
|
+
httpsProxy: runtime.httpsProxy || this._httpsProxy,
|
|
61
|
+
noProxy: runtime.noProxy || this._noProxy,
|
|
62
|
+
socks5Proxy: runtime.socks5Proxy || this._socks5Proxy,
|
|
63
|
+
socks5NetWork: runtime.socks5NetWork || this._socks5NetWork,
|
|
64
|
+
maxIdleConns: runtime.maxIdleConns || this._maxIdleConns,
|
|
65
|
+
retryOptions: this._retryOptions,
|
|
66
|
+
ignoreSSL: runtime.ignoreSSL || false,
|
|
67
|
+
tlsMinVersion: this._tlsMinVersion,
|
|
68
|
+
};
|
|
69
|
+
let _retriesAttempted = 0;
|
|
70
|
+
let _lastRequest = null, _lastResponse = null;
|
|
71
|
+
let _context = new $dara.RetryPolicyContext({
|
|
72
|
+
retriesAttempted: _retriesAttempted,
|
|
73
|
+
});
|
|
74
|
+
while ($dara.shouldRetry(_runtime['retryOptions'], _context)) {
|
|
75
|
+
if (_retriesAttempted > 0) {
|
|
76
|
+
let _backoffTime = $dara.getBackoffDelay(_runtime['retryOptions'], _context);
|
|
77
|
+
if (_backoffTime > 0) {
|
|
78
|
+
await $dara.sleep(_backoffTime);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
_retriesAttempted = _retriesAttempted + 1;
|
|
82
|
+
try {
|
|
83
|
+
let request_ = new $dara.Request();
|
|
84
|
+
let boundary = $dara.Form.getBoundary();
|
|
85
|
+
let tmp = String(form["host"]);
|
|
86
|
+
let host = `${bucketName}.${tmp}`;
|
|
87
|
+
request_.protocol = "HTTPS";
|
|
88
|
+
request_.method = "POST";
|
|
89
|
+
request_.pathname = `/`;
|
|
90
|
+
request_.headers = {
|
|
91
|
+
host: host,
|
|
92
|
+
date: openapi_core_2.OpenApiUtil.getDateUTCString(),
|
|
93
|
+
'user-agent': openapi_core_2.OpenApiUtil.getUserAgent(""),
|
|
94
|
+
};
|
|
95
|
+
request_.headers["content-type"] = `multipart/form-data; boundary=${boundary}`;
|
|
96
|
+
request_.body = $dara.Form.toFileForm(form, boundary);
|
|
97
|
+
_lastRequest = request_;
|
|
98
|
+
let response_ = await $dara.doAction(request_, _runtime);
|
|
99
|
+
_lastResponse = response_;
|
|
100
|
+
let respMap = null;
|
|
101
|
+
let bodyStr = await $dara.Stream.readAsString(response_.body);
|
|
102
|
+
if ((response_.statusCode >= 400) && (response_.statusCode < 600)) {
|
|
103
|
+
respMap = $dara.XML.parseXml(bodyStr, null);
|
|
104
|
+
let err = respMap["Error"];
|
|
105
|
+
throw new $OpenApi.ClientError({
|
|
106
|
+
code: String(err["Code"]),
|
|
107
|
+
message: String(err["Message"]),
|
|
108
|
+
data: {
|
|
109
|
+
httpCode: response_.statusCode,
|
|
110
|
+
requestId: String(err["RequestId"]),
|
|
111
|
+
hostId: String(err["HostId"]),
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
respMap = $dara.XML.parseXml(bodyStr, null);
|
|
116
|
+
return Object.assign({}, respMap);
|
|
117
|
+
}
|
|
118
|
+
catch (ex) {
|
|
119
|
+
_context = new $dara.RetryPolicyContext({
|
|
120
|
+
retriesAttempted: _retriesAttempted,
|
|
121
|
+
httpRequest: _lastRequest,
|
|
122
|
+
httpResponse: _lastResponse,
|
|
123
|
+
exception: ex,
|
|
124
|
+
});
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
throw $dara.newUnretryableError(_context);
|
|
129
|
+
}
|
|
55
130
|
getEndpoint(productId, regionId, endpointRule, network, suffix, endpointMap, endpoint) {
|
|
56
131
|
if (!$dara.isNull(endpoint)) {
|
|
57
132
|
return endpoint;
|
|
@@ -1267,6 +1342,141 @@ class Client extends openapi_core_1.default {
|
|
|
1267
1342
|
let runtime = new $dara.RuntimeOptions({});
|
|
1268
1343
|
return await this.createFieldWithOptions(request, runtime);
|
|
1269
1344
|
}
|
|
1345
|
+
/**
|
|
1346
|
+
* 创建样本记录对客
|
|
1347
|
+
*
|
|
1348
|
+
* @param request - CreateForeignPocSampleRequest
|
|
1349
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
1350
|
+
* @returns CreateForeignPocSampleResponse
|
|
1351
|
+
*/
|
|
1352
|
+
async createForeignPocSampleWithOptions(request, runtime) {
|
|
1353
|
+
request.validate();
|
|
1354
|
+
let query = {};
|
|
1355
|
+
if (!$dara.isNull(request.file)) {
|
|
1356
|
+
query["File"] = request.file;
|
|
1357
|
+
}
|
|
1358
|
+
if (!$dara.isNull(request.lang)) {
|
|
1359
|
+
query["Lang"] = request.lang;
|
|
1360
|
+
}
|
|
1361
|
+
if (!$dara.isNull(request.regId)) {
|
|
1362
|
+
query["RegId"] = request.regId;
|
|
1363
|
+
}
|
|
1364
|
+
if (!$dara.isNull(request.remark)) {
|
|
1365
|
+
query["Remark"] = request.remark;
|
|
1366
|
+
}
|
|
1367
|
+
if (!$dara.isNull(request.sampleName)) {
|
|
1368
|
+
query["SampleName"] = request.sampleName;
|
|
1369
|
+
}
|
|
1370
|
+
if (!$dara.isNull(request.tab)) {
|
|
1371
|
+
query["Tab"] = request.tab;
|
|
1372
|
+
}
|
|
1373
|
+
let req = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
|
|
1374
|
+
query: openapi_core_2.OpenApiUtil.query(query),
|
|
1375
|
+
});
|
|
1376
|
+
let params = new openapi_core_2.$OpenApiUtil.Params({
|
|
1377
|
+
action: "CreateForeignPocSample",
|
|
1378
|
+
version: "2021-09-10",
|
|
1379
|
+
protocol: "HTTPS",
|
|
1380
|
+
pathname: "/",
|
|
1381
|
+
method: "POST",
|
|
1382
|
+
authType: "AK",
|
|
1383
|
+
style: "RPC",
|
|
1384
|
+
reqBodyType: "formData",
|
|
1385
|
+
bodyType: "json",
|
|
1386
|
+
});
|
|
1387
|
+
return $dara.cast(await this.callApi(params, req, runtime), new $_model.CreateForeignPocSampleResponse({}));
|
|
1388
|
+
}
|
|
1389
|
+
/**
|
|
1390
|
+
* 创建样本记录对客
|
|
1391
|
+
*
|
|
1392
|
+
* @param request - CreateForeignPocSampleRequest
|
|
1393
|
+
* @returns CreateForeignPocSampleResponse
|
|
1394
|
+
*/
|
|
1395
|
+
async createForeignPocSample(request) {
|
|
1396
|
+
let runtime = new $dara.RuntimeOptions({});
|
|
1397
|
+
return await this.createForeignPocSampleWithOptions(request, runtime);
|
|
1398
|
+
}
|
|
1399
|
+
async createForeignPocSampleAdvance(request, runtime) {
|
|
1400
|
+
// Step 0: init client
|
|
1401
|
+
if ($dara.isNull(this._credential)) {
|
|
1402
|
+
throw new $OpenApi.ClientError({
|
|
1403
|
+
code: "InvalidCredentials",
|
|
1404
|
+
message: "Please set up the credentials correctly. If you are setting them through environment variables, please ensure that ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set correctly. See https://help.aliyun.com/zh/sdk/developer-reference/configure-the-alibaba-cloud-accesskey-environment-variable-on-linux-macos-and-windows-systems for more details.",
|
|
1405
|
+
});
|
|
1406
|
+
}
|
|
1407
|
+
let credentialModel = await this._credential.getCredential();
|
|
1408
|
+
let accessKeyId = credentialModel.accessKeyId;
|
|
1409
|
+
let accessKeySecret = credentialModel.accessKeySecret;
|
|
1410
|
+
let securityToken = credentialModel.securityToken;
|
|
1411
|
+
let credentialType = credentialModel.type;
|
|
1412
|
+
let openPlatformEndpoint = this._openPlatformEndpoint;
|
|
1413
|
+
if ($dara.isNull(openPlatformEndpoint) || openPlatformEndpoint == "") {
|
|
1414
|
+
openPlatformEndpoint = "openplatform.aliyuncs.com";
|
|
1415
|
+
}
|
|
1416
|
+
if ($dara.isNull(credentialType)) {
|
|
1417
|
+
credentialType = "access_key";
|
|
1418
|
+
}
|
|
1419
|
+
let authConfig = new openapi_core_2.$OpenApiUtil.Config({
|
|
1420
|
+
accessKeyId: accessKeyId,
|
|
1421
|
+
accessKeySecret: accessKeySecret,
|
|
1422
|
+
securityToken: securityToken,
|
|
1423
|
+
type: credentialType,
|
|
1424
|
+
endpoint: openPlatformEndpoint,
|
|
1425
|
+
protocol: this._protocol,
|
|
1426
|
+
regionId: this._regionId,
|
|
1427
|
+
});
|
|
1428
|
+
let authClient = new openapi_core_1.default(authConfig);
|
|
1429
|
+
let authRequest = {
|
|
1430
|
+
Product: "xtee",
|
|
1431
|
+
RegionId: this._regionId,
|
|
1432
|
+
};
|
|
1433
|
+
let authReq = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
|
|
1434
|
+
query: openapi_core_2.OpenApiUtil.query(authRequest),
|
|
1435
|
+
});
|
|
1436
|
+
let authParams = new openapi_core_2.$OpenApiUtil.Params({
|
|
1437
|
+
action: "AuthorizeFileUpload",
|
|
1438
|
+
version: "2019-12-19",
|
|
1439
|
+
protocol: "HTTPS",
|
|
1440
|
+
pathname: "/",
|
|
1441
|
+
method: "GET",
|
|
1442
|
+
authType: "AK",
|
|
1443
|
+
style: "RPC",
|
|
1444
|
+
reqBodyType: "formData",
|
|
1445
|
+
bodyType: "json",
|
|
1446
|
+
});
|
|
1447
|
+
let authResponse = {};
|
|
1448
|
+
let fileObj = new $dara.FileField({});
|
|
1449
|
+
let ossHeader = {};
|
|
1450
|
+
let tmpBody = {};
|
|
1451
|
+
let useAccelerate = false;
|
|
1452
|
+
let authResponseBody = {};
|
|
1453
|
+
let createForeignPocSampleReq = new $_model.CreateForeignPocSampleRequest({});
|
|
1454
|
+
openapi_core_2.OpenApiUtil.convert(request, createForeignPocSampleReq);
|
|
1455
|
+
if (!$dara.isNull(request.fileObject)) {
|
|
1456
|
+
authResponse = await authClient.callApi(authParams, authReq, runtime);
|
|
1457
|
+
tmpBody = authResponse["body"];
|
|
1458
|
+
useAccelerate = Boolean(tmpBody["UseAccelerate"]);
|
|
1459
|
+
authResponseBody = openapi_core_2.OpenApiUtil.stringifyMapValue(tmpBody);
|
|
1460
|
+
fileObj = new $dara.FileField({
|
|
1461
|
+
filename: authResponseBody["ObjectKey"],
|
|
1462
|
+
content: request.fileObject,
|
|
1463
|
+
contentType: "",
|
|
1464
|
+
});
|
|
1465
|
+
ossHeader = {
|
|
1466
|
+
host: openapi_core_2.OpenApiUtil.getEndpoint(authResponseBody["Endpoint"], useAccelerate, this._endpointType),
|
|
1467
|
+
OSSAccessKeyId: authResponseBody["AccessKeyId"],
|
|
1468
|
+
policy: authResponseBody["EncodedPolicy"],
|
|
1469
|
+
Signature: authResponseBody["Signature"],
|
|
1470
|
+
key: authResponseBody["ObjectKey"],
|
|
1471
|
+
file: fileObj,
|
|
1472
|
+
success_action_status: "201",
|
|
1473
|
+
};
|
|
1474
|
+
await this._postOSSObject(authResponseBody["Bucket"], ossHeader, runtime);
|
|
1475
|
+
createForeignPocSampleReq.file = `http://${authResponseBody["Bucket"]}.${authResponseBody["Endpoint"]}/${authResponseBody["ObjectKey"]}`;
|
|
1476
|
+
}
|
|
1477
|
+
let createForeignPocSampleResp = await this.createForeignPocSampleWithOptions(createForeignPocSampleReq, runtime);
|
|
1478
|
+
return createForeignPocSampleResp;
|
|
1479
|
+
}
|
|
1270
1480
|
/**
|
|
1271
1481
|
* Submit Task
|
|
1272
1482
|
*
|
|
@@ -15049,6 +15259,135 @@ class Client extends openapi_core_1.default {
|
|
|
15049
15259
|
let runtime = new $dara.RuntimeOptions({});
|
|
15050
15260
|
return await this.uploadFileCheckWithOptions(request, runtime);
|
|
15051
15261
|
}
|
|
15262
|
+
/**
|
|
15263
|
+
* 上传并校验样本文件
|
|
15264
|
+
*
|
|
15265
|
+
* @param request - UploadForeignSampleFileRequest
|
|
15266
|
+
* @param runtime - runtime options for this request RuntimeOptions
|
|
15267
|
+
* @returns UploadForeignSampleFileResponse
|
|
15268
|
+
*/
|
|
15269
|
+
async uploadForeignSampleFileWithOptions(request, runtime) {
|
|
15270
|
+
request.validate();
|
|
15271
|
+
let query = {};
|
|
15272
|
+
if (!$dara.isNull(request.file)) {
|
|
15273
|
+
query["File"] = request.file;
|
|
15274
|
+
}
|
|
15275
|
+
if (!$dara.isNull(request.lang)) {
|
|
15276
|
+
query["Lang"] = request.lang;
|
|
15277
|
+
}
|
|
15278
|
+
if (!$dara.isNull(request.regId)) {
|
|
15279
|
+
query["RegId"] = request.regId;
|
|
15280
|
+
}
|
|
15281
|
+
if (!$dara.isNull(request.tab)) {
|
|
15282
|
+
query["Tab"] = request.tab;
|
|
15283
|
+
}
|
|
15284
|
+
let req = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
|
|
15285
|
+
query: openapi_core_2.OpenApiUtil.query(query),
|
|
15286
|
+
});
|
|
15287
|
+
let params = new openapi_core_2.$OpenApiUtil.Params({
|
|
15288
|
+
action: "UploadForeignSampleFile",
|
|
15289
|
+
version: "2021-09-10",
|
|
15290
|
+
protocol: "HTTPS",
|
|
15291
|
+
pathname: "/",
|
|
15292
|
+
method: "POST",
|
|
15293
|
+
authType: "AK",
|
|
15294
|
+
style: "RPC",
|
|
15295
|
+
reqBodyType: "formData",
|
|
15296
|
+
bodyType: "json",
|
|
15297
|
+
});
|
|
15298
|
+
return $dara.cast(await this.callApi(params, req, runtime), new $_model.UploadForeignSampleFileResponse({}));
|
|
15299
|
+
}
|
|
15300
|
+
/**
|
|
15301
|
+
* 上传并校验样本文件
|
|
15302
|
+
*
|
|
15303
|
+
* @param request - UploadForeignSampleFileRequest
|
|
15304
|
+
* @returns UploadForeignSampleFileResponse
|
|
15305
|
+
*/
|
|
15306
|
+
async uploadForeignSampleFile(request) {
|
|
15307
|
+
let runtime = new $dara.RuntimeOptions({});
|
|
15308
|
+
return await this.uploadForeignSampleFileWithOptions(request, runtime);
|
|
15309
|
+
}
|
|
15310
|
+
async uploadForeignSampleFileAdvance(request, runtime) {
|
|
15311
|
+
// Step 0: init client
|
|
15312
|
+
if ($dara.isNull(this._credential)) {
|
|
15313
|
+
throw new $OpenApi.ClientError({
|
|
15314
|
+
code: "InvalidCredentials",
|
|
15315
|
+
message: "Please set up the credentials correctly. If you are setting them through environment variables, please ensure that ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET are set correctly. See https://help.aliyun.com/zh/sdk/developer-reference/configure-the-alibaba-cloud-accesskey-environment-variable-on-linux-macos-and-windows-systems for more details.",
|
|
15316
|
+
});
|
|
15317
|
+
}
|
|
15318
|
+
let credentialModel = await this._credential.getCredential();
|
|
15319
|
+
let accessKeyId = credentialModel.accessKeyId;
|
|
15320
|
+
let accessKeySecret = credentialModel.accessKeySecret;
|
|
15321
|
+
let securityToken = credentialModel.securityToken;
|
|
15322
|
+
let credentialType = credentialModel.type;
|
|
15323
|
+
let openPlatformEndpoint = this._openPlatformEndpoint;
|
|
15324
|
+
if ($dara.isNull(openPlatformEndpoint) || openPlatformEndpoint == "") {
|
|
15325
|
+
openPlatformEndpoint = "openplatform.aliyuncs.com";
|
|
15326
|
+
}
|
|
15327
|
+
if ($dara.isNull(credentialType)) {
|
|
15328
|
+
credentialType = "access_key";
|
|
15329
|
+
}
|
|
15330
|
+
let authConfig = new openapi_core_2.$OpenApiUtil.Config({
|
|
15331
|
+
accessKeyId: accessKeyId,
|
|
15332
|
+
accessKeySecret: accessKeySecret,
|
|
15333
|
+
securityToken: securityToken,
|
|
15334
|
+
type: credentialType,
|
|
15335
|
+
endpoint: openPlatformEndpoint,
|
|
15336
|
+
protocol: this._protocol,
|
|
15337
|
+
regionId: this._regionId,
|
|
15338
|
+
});
|
|
15339
|
+
let authClient = new openapi_core_1.default(authConfig);
|
|
15340
|
+
let authRequest = {
|
|
15341
|
+
Product: "xtee",
|
|
15342
|
+
RegionId: this._regionId,
|
|
15343
|
+
};
|
|
15344
|
+
let authReq = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
|
|
15345
|
+
query: openapi_core_2.OpenApiUtil.query(authRequest),
|
|
15346
|
+
});
|
|
15347
|
+
let authParams = new openapi_core_2.$OpenApiUtil.Params({
|
|
15348
|
+
action: "AuthorizeFileUpload",
|
|
15349
|
+
version: "2019-12-19",
|
|
15350
|
+
protocol: "HTTPS",
|
|
15351
|
+
pathname: "/",
|
|
15352
|
+
method: "GET",
|
|
15353
|
+
authType: "AK",
|
|
15354
|
+
style: "RPC",
|
|
15355
|
+
reqBodyType: "formData",
|
|
15356
|
+
bodyType: "json",
|
|
15357
|
+
});
|
|
15358
|
+
let authResponse = {};
|
|
15359
|
+
let fileObj = new $dara.FileField({});
|
|
15360
|
+
let ossHeader = {};
|
|
15361
|
+
let tmpBody = {};
|
|
15362
|
+
let useAccelerate = false;
|
|
15363
|
+
let authResponseBody = {};
|
|
15364
|
+
let uploadForeignSampleFileReq = new $_model.UploadForeignSampleFileRequest({});
|
|
15365
|
+
openapi_core_2.OpenApiUtil.convert(request, uploadForeignSampleFileReq);
|
|
15366
|
+
if (!$dara.isNull(request.fileObject)) {
|
|
15367
|
+
authResponse = await authClient.callApi(authParams, authReq, runtime);
|
|
15368
|
+
tmpBody = authResponse["body"];
|
|
15369
|
+
useAccelerate = Boolean(tmpBody["UseAccelerate"]);
|
|
15370
|
+
authResponseBody = openapi_core_2.OpenApiUtil.stringifyMapValue(tmpBody);
|
|
15371
|
+
fileObj = new $dara.FileField({
|
|
15372
|
+
filename: authResponseBody["ObjectKey"],
|
|
15373
|
+
content: request.fileObject,
|
|
15374
|
+
contentType: "",
|
|
15375
|
+
});
|
|
15376
|
+
ossHeader = {
|
|
15377
|
+
host: openapi_core_2.OpenApiUtil.getEndpoint(authResponseBody["Endpoint"], useAccelerate, this._endpointType),
|
|
15378
|
+
OSSAccessKeyId: authResponseBody["AccessKeyId"],
|
|
15379
|
+
policy: authResponseBody["EncodedPolicy"],
|
|
15380
|
+
Signature: authResponseBody["Signature"],
|
|
15381
|
+
key: authResponseBody["ObjectKey"],
|
|
15382
|
+
file: fileObj,
|
|
15383
|
+
success_action_status: "201",
|
|
15384
|
+
};
|
|
15385
|
+
await this._postOSSObject(authResponseBody["Bucket"], ossHeader, runtime);
|
|
15386
|
+
uploadForeignSampleFileReq.file = `http://${authResponseBody["Bucket"]}.${authResponseBody["Endpoint"]}/${authResponseBody["ObjectKey"]}`;
|
|
15387
|
+
}
|
|
15388
|
+
let uploadForeignSampleFileResp = await this.uploadForeignSampleFileWithOptions(uploadForeignSampleFileReq, runtime);
|
|
15389
|
+
return uploadForeignSampleFileResp;
|
|
15390
|
+
}
|
|
15052
15391
|
/**
|
|
15053
15392
|
* 上传并校验样本文件
|
|
15054
15393
|
*
|