@alicloud/esa20240910 2.28.0 → 2.29.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.
Files changed (49) hide show
  1. package/dist/client.d.ts +20 -0
  2. package/dist/client.js +297 -172
  3. package/dist/client.js.map +1 -1
  4. package/dist/models/CreateRoutineRouteRequest.d.ts +1 -0
  5. package/dist/models/CreateRoutineRouteRequest.js +2 -0
  6. package/dist/models/CreateRoutineRouteRequest.js.map +1 -1
  7. package/dist/models/DescribeUrlObservationDataRequest.d.ts +46 -0
  8. package/dist/models/DescribeUrlObservationDataRequest.js +68 -0
  9. package/dist/models/DescribeUrlObservationDataRequest.js.map +1 -0
  10. package/dist/models/DescribeUrlObservationDataResponse.d.ts +19 -0
  11. package/dist/models/DescribeUrlObservationDataResponse.js +69 -0
  12. package/dist/models/DescribeUrlObservationDataResponse.js.map +1 -0
  13. package/dist/models/DescribeUrlObservationDataResponseBody.d.ts +30 -0
  14. package/dist/models/DescribeUrlObservationDataResponseBody.js +68 -0
  15. package/dist/models/DescribeUrlObservationDataResponseBody.js.map +1 -0
  16. package/dist/models/DescribeUrlObservationDataResponseBodyUrlDetailData.d.ts +58 -0
  17. package/dist/models/DescribeUrlObservationDataResponseBodyUrlDetailData.js +74 -0
  18. package/dist/models/DescribeUrlObservationDataResponseBodyUrlDetailData.js.map +1 -0
  19. package/dist/models/GetEdgeContainerAppResourceStatusResponseBodyRegions.d.ts +2 -0
  20. package/dist/models/GetEdgeContainerAppResourceStatusResponseBodyRegions.js +4 -0
  21. package/dist/models/GetEdgeContainerAppResourceStatusResponseBodyRegions.js.map +1 -1
  22. package/dist/models/GetRoutineRouteResponseBody.d.ts +1 -0
  23. package/dist/models/GetRoutineRouteResponseBody.js +2 -0
  24. package/dist/models/GetRoutineRouteResponseBody.js.map +1 -1
  25. package/dist/models/ListRoutineRoutesResponseBodyConfigs.d.ts +1 -0
  26. package/dist/models/ListRoutineRoutesResponseBodyConfigs.js +2 -0
  27. package/dist/models/ListRoutineRoutesResponseBodyConfigs.js.map +1 -1
  28. package/dist/models/ListSiteRoutesResponseBodyConfigs.d.ts +1 -0
  29. package/dist/models/ListSiteRoutesResponseBodyConfigs.js +2 -0
  30. package/dist/models/ListSiteRoutesResponseBodyConfigs.js.map +1 -1
  31. package/dist/models/UpdateRoutineRouteRequest.d.ts +1 -0
  32. package/dist/models/UpdateRoutineRouteRequest.js +2 -0
  33. package/dist/models/UpdateRoutineRouteRequest.js.map +1 -1
  34. package/dist/models/model.d.ts +4 -0
  35. package/dist/models/model.js +34 -26
  36. package/dist/models/model.js.map +1 -1
  37. package/package.json +2 -5
  38. package/src/client.ts +315 -169
  39. package/src/models/CreateRoutineRouteRequest.ts +3 -0
  40. package/src/models/DescribeUrlObservationDataRequest.ts +69 -0
  41. package/src/models/DescribeUrlObservationDataResponse.ts +40 -0
  42. package/src/models/DescribeUrlObservationDataResponseBody.ts +52 -0
  43. package/src/models/DescribeUrlObservationDataResponseBodyUrlDetailData.ts +87 -0
  44. package/src/models/GetEdgeContainerAppResourceStatusResponseBodyRegions.ts +6 -0
  45. package/src/models/GetRoutineRouteResponseBody.ts +3 -0
  46. package/src/models/ListRoutineRoutesResponseBodyConfigs.ts +3 -0
  47. package/src/models/ListSiteRoutesResponseBodyConfigs.ts +3 -0
  48. package/src/models/UpdateRoutineRouteRequest.ts +3 -0
  49. package/src/models/model.ts +4 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alicloud/esa20240910",
3
- "version": "2.28.0",
3
+ "version": "2.29.0",
4
4
  "description": "",
5
5
  "main": "dist/client.js",
6
6
  "scripts": {
@@ -20,10 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@darabonba/typescript": "^1.0.0",
23
- "@alicloud/oss-client": "^1.1.4",
24
- "@alicloud/openplatform20191219": "2.0.0",
25
- "@alicloud/oss-util": "0.0.1",
26
- "@alicloud/tea-fileform": "^1.0.0",
23
+ "@alicloud/credentials": "^2.4.2",
27
24
  "@alicloud/openapi-core": "^1.0.0"
28
25
  },
29
26
  "files": [
package/src/client.ts CHANGED
@@ -1,10 +1,6 @@
1
1
  // This file is auto-generated, don't edit it
2
2
  import * as $dara from '@darabonba/typescript';
3
- import OSS, * as $OSS from '@alicloud/oss-client';
4
- import OpenPlatform, * as $OpenPlatform from '@alicloud/openplatform20191219';
5
- import * as $OSSUtil from '@alicloud/oss-util';
6
- import * as $FileForm from '@alicloud/tea-fileform';
7
- import OpenApi from '@alicloud/openapi-core';
3
+ import OpenApi, * as $OpenApi from '@alicloud/openapi-core';
8
4
  import { OpenApiUtil, $OpenApiUtil }from '@alicloud/openapi-core';
9
5
 
10
6
 
@@ -20,6 +16,42 @@ export default class Client extends OpenApi {
20
16
  this._endpoint = this.getEndpoint("esa", this._regionId, this._endpointRule, this._network, this._suffix, this._endpointMap, this._endpoint);
21
17
  }
22
18
 
19
+ async _postOSSObject(bucketName: string, form: {[key: string]: any}): Promise<{[key: string]: any}> {
20
+ let request_ = new $dara.Request();
21
+ let boundary = $dara.Form.getBoundary();
22
+ request_.protocol = "HTTPS";
23
+ request_.method = "POST";
24
+ request_.pathname = `/`;
25
+ request_.headers = {
26
+ host: String(form["host"]),
27
+ date: OpenApiUtil.getDateUTCString(),
28
+ 'user-agent': OpenApiUtil.getUserAgent(""),
29
+ };
30
+ request_.headers["content-type"] = `multipart/form-data; boundary=${boundary}`;
31
+ request_.body = $dara.Form.toFileForm(form, boundary);
32
+ let response_ = await $dara.doAction(request_);
33
+
34
+ let respMap : {[key: string]: any} = null;
35
+ let bodyStr = await $dara.Stream.readAsString(response_.body);
36
+ if ((response_.statusCode >= 400) && (response_.statusCode < 600)) {
37
+ respMap = $dara.XML.parseXml(bodyStr, null);
38
+ let err = respMap["Error"];
39
+ throw new $OpenApi.ClientError({
40
+ code: String(err["Code"]),
41
+ message: String(err["Message"]),
42
+ data: {
43
+ httpCode: response_.statusCode,
44
+ requestId: String(err["RequestId"]),
45
+ hostId: String(err["HostId"]),
46
+ },
47
+ });
48
+ }
49
+
50
+ respMap = $dara.XML.parseXml(bodyStr, null);
51
+ return {
52
+ ...respMap,
53
+ };
54
+ }
23
55
 
24
56
  getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: {[key: string ]: string}, endpoint: string): string {
25
57
  if (!$dara.isNull(endpoint)) {
@@ -461,12 +493,20 @@ export default class Client extends OpenApi {
461
493
 
462
494
  async batchDeleteKvWithHighCapacityAdvance(request: $_model.BatchDeleteKvWithHighCapacityAdvanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.BatchDeleteKvWithHighCapacityResponse> {
463
495
  // Step 0: init client
464
- let accessKeyId = await this._credential.getAccessKeyId();
465
- let accessKeySecret = await this._credential.getAccessKeySecret();
466
- let securityToken = await this._credential.getSecurityToken();
467
- let credentialType = this._credential.getType();
496
+ if ($dara.isNull(this._credential)) {
497
+ throw new $OpenApi.ClientError({
498
+ code: "InvalidCredentials",
499
+ 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.",
500
+ });
501
+ }
502
+
503
+ let credentialModel = await this._credential.getCredential();
504
+ let accessKeyId = credentialModel.accessKeyId;
505
+ let accessKeySecret = credentialModel.accessKeySecret;
506
+ let securityToken = credentialModel.securityToken;
507
+ let credentialType = credentialModel.type;
468
508
  let openPlatformEndpoint = this._openPlatformEndpoint;
469
- if ($dara.isNull(openPlatformEndpoint)) {
509
+ if ($dara.isNull(openPlatformEndpoint) || openPlatformEndpoint == "") {
470
510
  openPlatformEndpoint = "openplatform.aliyuncs.com";
471
511
  }
472
512
 
@@ -483,51 +523,54 @@ export default class Client extends OpenApi {
483
523
  protocol: this._protocol,
484
524
  regionId: this._regionId,
485
525
  });
486
- let authClient = new OpenPlatform(authConfig);
487
- let authRequest = new $OpenPlatform.AuthorizeFileUploadRequest({
488
- product: "ESA",
489
- regionId: this._regionId,
526
+ let authClient = new OpenApi(authConfig);
527
+ let authRequest = {
528
+ Product: "ESA",
529
+ RegionId: this._regionId,
530
+ };
531
+ let authReq = new $OpenApiUtil.OpenApiRequest({
532
+ query: OpenApiUtil.query(authRequest),
490
533
  });
491
- let authResponse = new $OpenPlatform.AuthorizeFileUploadResponse({ });
492
- let ossConfig = new $OSS.Config({
493
- accessKeyId: accessKeyId,
494
- accessKeySecret: accessKeySecret,
495
- type: "access_key",
496
- protocol: this._protocol,
497
- regionId: this._regionId,
534
+ let authParams = new $OpenApiUtil.Params({
535
+ action: "AuthorizeFileUpload",
536
+ version: "2019-12-19",
537
+ protocol: "HTTPS",
538
+ pathname: "/",
539
+ method: "GET",
540
+ authType: "AK",
541
+ style: "RPC",
542
+ reqBodyType: "formData",
543
+ bodyType: "json",
498
544
  });
499
- let ossClient : OSS = new OSS(ossConfig);
500
- let fileObj = new $FileForm.FileField({ });
501
- let ossHeader = new $OSS.PostObjectRequestHeader({ });
502
- let uploadRequest = new $OSS.PostObjectRequest({ });
503
- let ossRuntime = new $OSSUtil.RuntimeOptions({ });
504
- OpenApiUtil.convert(runtime, ossRuntime);
545
+ let authResponse : {[key: string]: any} = { };
546
+ let fileObj = new $dara.FileField({ });
547
+ let ossHeader : {[key: string]: any} = { };
548
+ let tmpBody : {[key: string]: any} = { };
549
+ let useAccelerate : boolean = false;
550
+ let authResponseBody : {[key: string ]: string} = { };
505
551
  let batchDeleteKvWithHighCapacityReq = new $_model.BatchDeleteKvWithHighCapacityRequest({ });
506
552
  OpenApiUtil.convert(request, batchDeleteKvWithHighCapacityReq);
507
553
  if (!$dara.isNull(request.urlObject)) {
508
- authResponse = await authClient.authorizeFileUploadWithOptions(authRequest, runtime);
509
- ossConfig.accessKeyId = authResponse.body.accessKeyId;
510
- ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, this._endpointType);
511
- ossClient = new OSS(ossConfig);
512
- fileObj = new $FileForm.FileField({
513
- filename: authResponse.body.objectKey,
554
+ authResponse = await authClient.callApi(authParams, authReq, runtime);
555
+ tmpBody = authResponse["body"];
556
+ useAccelerate = Boolean(tmpBody["UseAccelerate"]);
557
+ authResponseBody = OpenApiUtil.stringifyMapValue(tmpBody);
558
+ fileObj = new $dara.FileField({
559
+ filename: authResponseBody["ObjectKey"],
514
560
  content: request.urlObject,
515
561
  contentType: "",
516
562
  });
517
- ossHeader = new $OSS.PostObjectRequestHeader({
518
- accessKeyId: authResponse.body.accessKeyId,
519
- policy: authResponse.body.encodedPolicy,
520
- signature: authResponse.body.signature,
521
- key: authResponse.body.objectKey,
563
+ ossHeader = {
564
+ host: `${authResponseBody["Bucket"]}.${OpenApiUtil.getEndpoint(authResponseBody["Endpoint"], useAccelerate, this._endpointType)}`,
565
+ OSSAccessKeyId: authResponseBody["AccessKeyId"],
566
+ policy: authResponseBody["EncodedPolicy"],
567
+ Signature: authResponseBody["Signature"],
568
+ key: authResponseBody["ObjectKey"],
522
569
  file: fileObj,
523
- successActionStatus: "201",
524
- });
525
- uploadRequest = new $OSS.PostObjectRequest({
526
- bucketName: authResponse.body.bucket,
527
- header: ossHeader,
528
- });
529
- await ossClient.postObject(uploadRequest, ossRuntime);
530
- batchDeleteKvWithHighCapacityReq.url = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
570
+ success_action_status: "201",
571
+ };
572
+ await this._postOSSObject(authResponseBody["Bucket"], ossHeader);
573
+ batchDeleteKvWithHighCapacityReq.url = `http://${authResponseBody["Bucket"]}.${authResponseBody["Endpoint"]}/${authResponseBody["ObjectKey"]}`;
531
574
  }
532
575
 
533
576
  let batchDeleteKvWithHighCapacityResp = await this.batchDeleteKvWithHighCapacityWithOptions(batchDeleteKvWithHighCapacityReq, runtime);
@@ -784,12 +827,20 @@ export default class Client extends OpenApi {
784
827
 
785
828
  async batchPutKvWithHighCapacityAdvance(request: $_model.BatchPutKvWithHighCapacityAdvanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.BatchPutKvWithHighCapacityResponse> {
786
829
  // Step 0: init client
787
- let accessKeyId = await this._credential.getAccessKeyId();
788
- let accessKeySecret = await this._credential.getAccessKeySecret();
789
- let securityToken = await this._credential.getSecurityToken();
790
- let credentialType = this._credential.getType();
830
+ if ($dara.isNull(this._credential)) {
831
+ throw new $OpenApi.ClientError({
832
+ code: "InvalidCredentials",
833
+ 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.",
834
+ });
835
+ }
836
+
837
+ let credentialModel = await this._credential.getCredential();
838
+ let accessKeyId = credentialModel.accessKeyId;
839
+ let accessKeySecret = credentialModel.accessKeySecret;
840
+ let securityToken = credentialModel.securityToken;
841
+ let credentialType = credentialModel.type;
791
842
  let openPlatformEndpoint = this._openPlatformEndpoint;
792
- if ($dara.isNull(openPlatformEndpoint)) {
843
+ if ($dara.isNull(openPlatformEndpoint) || openPlatformEndpoint == "") {
793
844
  openPlatformEndpoint = "openplatform.aliyuncs.com";
794
845
  }
795
846
 
@@ -806,51 +857,54 @@ export default class Client extends OpenApi {
806
857
  protocol: this._protocol,
807
858
  regionId: this._regionId,
808
859
  });
809
- let authClient = new OpenPlatform(authConfig);
810
- let authRequest = new $OpenPlatform.AuthorizeFileUploadRequest({
811
- product: "ESA",
812
- regionId: this._regionId,
860
+ let authClient = new OpenApi(authConfig);
861
+ let authRequest = {
862
+ Product: "ESA",
863
+ RegionId: this._regionId,
864
+ };
865
+ let authReq = new $OpenApiUtil.OpenApiRequest({
866
+ query: OpenApiUtil.query(authRequest),
813
867
  });
814
- let authResponse = new $OpenPlatform.AuthorizeFileUploadResponse({ });
815
- let ossConfig = new $OSS.Config({
816
- accessKeyId: accessKeyId,
817
- accessKeySecret: accessKeySecret,
818
- type: "access_key",
819
- protocol: this._protocol,
820
- regionId: this._regionId,
868
+ let authParams = new $OpenApiUtil.Params({
869
+ action: "AuthorizeFileUpload",
870
+ version: "2019-12-19",
871
+ protocol: "HTTPS",
872
+ pathname: "/",
873
+ method: "GET",
874
+ authType: "AK",
875
+ style: "RPC",
876
+ reqBodyType: "formData",
877
+ bodyType: "json",
821
878
  });
822
- let ossClient : OSS = new OSS(ossConfig);
823
- let fileObj = new $FileForm.FileField({ });
824
- let ossHeader = new $OSS.PostObjectRequestHeader({ });
825
- let uploadRequest = new $OSS.PostObjectRequest({ });
826
- let ossRuntime = new $OSSUtil.RuntimeOptions({ });
827
- OpenApiUtil.convert(runtime, ossRuntime);
879
+ let authResponse : {[key: string]: any} = { };
880
+ let fileObj = new $dara.FileField({ });
881
+ let ossHeader : {[key: string]: any} = { };
882
+ let tmpBody : {[key: string]: any} = { };
883
+ let useAccelerate : boolean = false;
884
+ let authResponseBody : {[key: string ]: string} = { };
828
885
  let batchPutKvWithHighCapacityReq = new $_model.BatchPutKvWithHighCapacityRequest({ });
829
886
  OpenApiUtil.convert(request, batchPutKvWithHighCapacityReq);
830
887
  if (!$dara.isNull(request.urlObject)) {
831
- authResponse = await authClient.authorizeFileUploadWithOptions(authRequest, runtime);
832
- ossConfig.accessKeyId = authResponse.body.accessKeyId;
833
- ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, this._endpointType);
834
- ossClient = new OSS(ossConfig);
835
- fileObj = new $FileForm.FileField({
836
- filename: authResponse.body.objectKey,
888
+ authResponse = await authClient.callApi(authParams, authReq, runtime);
889
+ tmpBody = authResponse["body"];
890
+ useAccelerate = Boolean(tmpBody["UseAccelerate"]);
891
+ authResponseBody = OpenApiUtil.stringifyMapValue(tmpBody);
892
+ fileObj = new $dara.FileField({
893
+ filename: authResponseBody["ObjectKey"],
837
894
  content: request.urlObject,
838
895
  contentType: "",
839
896
  });
840
- ossHeader = new $OSS.PostObjectRequestHeader({
841
- accessKeyId: authResponse.body.accessKeyId,
842
- policy: authResponse.body.encodedPolicy,
843
- signature: authResponse.body.signature,
844
- key: authResponse.body.objectKey,
897
+ ossHeader = {
898
+ host: `${authResponseBody["Bucket"]}.${OpenApiUtil.getEndpoint(authResponseBody["Endpoint"], useAccelerate, this._endpointType)}`,
899
+ OSSAccessKeyId: authResponseBody["AccessKeyId"],
900
+ policy: authResponseBody["EncodedPolicy"],
901
+ Signature: authResponseBody["Signature"],
902
+ key: authResponseBody["ObjectKey"],
845
903
  file: fileObj,
846
- successActionStatus: "201",
847
- });
848
- uploadRequest = new $OSS.PostObjectRequest({
849
- bucketName: authResponse.body.bucket,
850
- header: ossHeader,
851
- });
852
- await ossClient.postObject(uploadRequest, ossRuntime);
853
- batchPutKvWithHighCapacityReq.url = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
904
+ success_action_status: "201",
905
+ };
906
+ await this._postOSSObject(authResponseBody["Bucket"], ossHeader);
907
+ batchPutKvWithHighCapacityReq.url = `http://${authResponseBody["Bucket"]}.${authResponseBody["Endpoint"]}/${authResponseBody["ObjectKey"]}`;
854
908
  }
855
909
 
856
910
  let batchPutKvWithHighCapacityResp = await this.batchPutKvWithHighCapacityWithOptions(batchPutKvWithHighCapacityReq, runtime);
@@ -3111,6 +3165,10 @@ export default class Client extends OpenApi {
3111
3165
  query["Bypass"] = request.bypass;
3112
3166
  }
3113
3167
 
3168
+ if (!$dara.isNull(request.fallback)) {
3169
+ query["Fallback"] = request.fallback;
3170
+ }
3171
+
3114
3172
  if (!$dara.isNull(request.routeEnable)) {
3115
3173
  query["RouteEnable"] = request.routeEnable;
3116
3174
  }
@@ -6985,6 +7043,68 @@ export default class Client extends OpenApi {
6985
7043
  return await this.describeSiteTopDataWithOptions(request, runtime);
6986
7044
  }
6987
7045
 
7046
+ /**
7047
+ * 查询网页观测质量数据
7048
+ *
7049
+ * @param request - DescribeUrlObservationDataRequest
7050
+ * @param runtime - runtime options for this request RuntimeOptions
7051
+ * @returns DescribeUrlObservationDataResponse
7052
+ */
7053
+ async describeUrlObservationDataWithOptions(request: $_model.DescribeUrlObservationDataRequest, runtime: $dara.RuntimeOptions): Promise<$_model.DescribeUrlObservationDataResponse> {
7054
+ request.validate();
7055
+ let query = { };
7056
+ if (!$dara.isNull(request.clientPlatform)) {
7057
+ query["ClientPlatform"] = request.clientPlatform;
7058
+ }
7059
+
7060
+ if (!$dara.isNull(request.endTime)) {
7061
+ query["EndTime"] = request.endTime;
7062
+ }
7063
+
7064
+ if (!$dara.isNull(request.metric)) {
7065
+ query["Metric"] = request.metric;
7066
+ }
7067
+
7068
+ if (!$dara.isNull(request.siteId)) {
7069
+ query["SiteId"] = request.siteId;
7070
+ }
7071
+
7072
+ if (!$dara.isNull(request.startTime)) {
7073
+ query["StartTime"] = request.startTime;
7074
+ }
7075
+
7076
+ if (!$dara.isNull(request.url)) {
7077
+ query["Url"] = request.url;
7078
+ }
7079
+
7080
+ let req = new $OpenApiUtil.OpenApiRequest({
7081
+ query: OpenApiUtil.query(query),
7082
+ });
7083
+ let params = new $OpenApiUtil.Params({
7084
+ action: "DescribeUrlObservationData",
7085
+ version: "2024-09-10",
7086
+ protocol: "HTTPS",
7087
+ pathname: "/",
7088
+ method: "POST",
7089
+ authType: "AK",
7090
+ style: "RPC",
7091
+ reqBodyType: "formData",
7092
+ bodyType: "json",
7093
+ });
7094
+ return $dara.cast<$_model.DescribeUrlObservationDataResponse>(await this.callApi(params, req, runtime), new $_model.DescribeUrlObservationDataResponse({}));
7095
+ }
7096
+
7097
+ /**
7098
+ * 查询网页观测质量数据
7099
+ *
7100
+ * @param request - DescribeUrlObservationDataRequest
7101
+ * @returns DescribeUrlObservationDataResponse
7102
+ */
7103
+ async describeUrlObservationData(request: $_model.DescribeUrlObservationDataRequest): Promise<$_model.DescribeUrlObservationDataResponse> {
7104
+ let runtime = new $dara.RuntimeOptions({ });
7105
+ return await this.describeUrlObservationDataWithOptions(request, runtime);
7106
+ }
7107
+
6988
7108
  /**
6989
7109
  * Disables a scenario-specific policy.
6990
7110
  *
@@ -13519,12 +13639,20 @@ export default class Client extends OpenApi {
13519
13639
 
13520
13640
  async putKvWithHighCapacityAdvance(request: $_model.PutKvWithHighCapacityAdvanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.PutKvWithHighCapacityResponse> {
13521
13641
  // Step 0: init client
13522
- let accessKeyId = await this._credential.getAccessKeyId();
13523
- let accessKeySecret = await this._credential.getAccessKeySecret();
13524
- let securityToken = await this._credential.getSecurityToken();
13525
- let credentialType = this._credential.getType();
13642
+ if ($dara.isNull(this._credential)) {
13643
+ throw new $OpenApi.ClientError({
13644
+ code: "InvalidCredentials",
13645
+ 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.",
13646
+ });
13647
+ }
13648
+
13649
+ let credentialModel = await this._credential.getCredential();
13650
+ let accessKeyId = credentialModel.accessKeyId;
13651
+ let accessKeySecret = credentialModel.accessKeySecret;
13652
+ let securityToken = credentialModel.securityToken;
13653
+ let credentialType = credentialModel.type;
13526
13654
  let openPlatformEndpoint = this._openPlatformEndpoint;
13527
- if ($dara.isNull(openPlatformEndpoint)) {
13655
+ if ($dara.isNull(openPlatformEndpoint) || openPlatformEndpoint == "") {
13528
13656
  openPlatformEndpoint = "openplatform.aliyuncs.com";
13529
13657
  }
13530
13658
 
@@ -13541,51 +13669,54 @@ export default class Client extends OpenApi {
13541
13669
  protocol: this._protocol,
13542
13670
  regionId: this._regionId,
13543
13671
  });
13544
- let authClient = new OpenPlatform(authConfig);
13545
- let authRequest = new $OpenPlatform.AuthorizeFileUploadRequest({
13546
- product: "ESA",
13547
- regionId: this._regionId,
13672
+ let authClient = new OpenApi(authConfig);
13673
+ let authRequest = {
13674
+ Product: "ESA",
13675
+ RegionId: this._regionId,
13676
+ };
13677
+ let authReq = new $OpenApiUtil.OpenApiRequest({
13678
+ query: OpenApiUtil.query(authRequest),
13548
13679
  });
13549
- let authResponse = new $OpenPlatform.AuthorizeFileUploadResponse({ });
13550
- let ossConfig = new $OSS.Config({
13551
- accessKeyId: accessKeyId,
13552
- accessKeySecret: accessKeySecret,
13553
- type: "access_key",
13554
- protocol: this._protocol,
13555
- regionId: this._regionId,
13680
+ let authParams = new $OpenApiUtil.Params({
13681
+ action: "AuthorizeFileUpload",
13682
+ version: "2019-12-19",
13683
+ protocol: "HTTPS",
13684
+ pathname: "/",
13685
+ method: "GET",
13686
+ authType: "AK",
13687
+ style: "RPC",
13688
+ reqBodyType: "formData",
13689
+ bodyType: "json",
13556
13690
  });
13557
- let ossClient : OSS = new OSS(ossConfig);
13558
- let fileObj = new $FileForm.FileField({ });
13559
- let ossHeader = new $OSS.PostObjectRequestHeader({ });
13560
- let uploadRequest = new $OSS.PostObjectRequest({ });
13561
- let ossRuntime = new $OSSUtil.RuntimeOptions({ });
13562
- OpenApiUtil.convert(runtime, ossRuntime);
13691
+ let authResponse : {[key: string]: any} = { };
13692
+ let fileObj = new $dara.FileField({ });
13693
+ let ossHeader : {[key: string]: any} = { };
13694
+ let tmpBody : {[key: string]: any} = { };
13695
+ let useAccelerate : boolean = false;
13696
+ let authResponseBody : {[key: string ]: string} = { };
13563
13697
  let putKvWithHighCapacityReq = new $_model.PutKvWithHighCapacityRequest({ });
13564
13698
  OpenApiUtil.convert(request, putKvWithHighCapacityReq);
13565
13699
  if (!$dara.isNull(request.urlObject)) {
13566
- authResponse = await authClient.authorizeFileUploadWithOptions(authRequest, runtime);
13567
- ossConfig.accessKeyId = authResponse.body.accessKeyId;
13568
- ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, this._endpointType);
13569
- ossClient = new OSS(ossConfig);
13570
- fileObj = new $FileForm.FileField({
13571
- filename: authResponse.body.objectKey,
13700
+ authResponse = await authClient.callApi(authParams, authReq, runtime);
13701
+ tmpBody = authResponse["body"];
13702
+ useAccelerate = Boolean(tmpBody["UseAccelerate"]);
13703
+ authResponseBody = OpenApiUtil.stringifyMapValue(tmpBody);
13704
+ fileObj = new $dara.FileField({
13705
+ filename: authResponseBody["ObjectKey"],
13572
13706
  content: request.urlObject,
13573
13707
  contentType: "",
13574
13708
  });
13575
- ossHeader = new $OSS.PostObjectRequestHeader({
13576
- accessKeyId: authResponse.body.accessKeyId,
13577
- policy: authResponse.body.encodedPolicy,
13578
- signature: authResponse.body.signature,
13579
- key: authResponse.body.objectKey,
13709
+ ossHeader = {
13710
+ host: `${authResponseBody["Bucket"]}.${OpenApiUtil.getEndpoint(authResponseBody["Endpoint"], useAccelerate, this._endpointType)}`,
13711
+ OSSAccessKeyId: authResponseBody["AccessKeyId"],
13712
+ policy: authResponseBody["EncodedPolicy"],
13713
+ Signature: authResponseBody["Signature"],
13714
+ key: authResponseBody["ObjectKey"],
13580
13715
  file: fileObj,
13581
- successActionStatus: "201",
13582
- });
13583
- uploadRequest = new $OSS.PostObjectRequest({
13584
- bucketName: authResponse.body.bucket,
13585
- header: ossHeader,
13586
- });
13587
- await ossClient.postObject(uploadRequest, ossRuntime);
13588
- putKvWithHighCapacityReq.url = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
13716
+ success_action_status: "201",
13717
+ };
13718
+ await this._postOSSObject(authResponseBody["Bucket"], ossHeader);
13719
+ putKvWithHighCapacityReq.url = `http://${authResponseBody["Bucket"]}.${authResponseBody["Endpoint"]}/${authResponseBody["ObjectKey"]}`;
13589
13720
  }
13590
13721
 
13591
13722
  let putKvWithHighCapacityResp = await this.putKvWithHighCapacityWithOptions(putKvWithHighCapacityReq, runtime);
@@ -16394,6 +16525,10 @@ export default class Client extends OpenApi {
16394
16525
  query["ConfigId"] = request.configId;
16395
16526
  }
16396
16527
 
16528
+ if (!$dara.isNull(request.fallback)) {
16529
+ query["Fallback"] = request.fallback;
16530
+ }
16531
+
16397
16532
  if (!$dara.isNull(request.routeEnable)) {
16398
16533
  query["RouteEnable"] = request.routeEnable;
16399
16534
  }
@@ -17790,12 +17925,20 @@ export default class Client extends OpenApi {
17790
17925
 
17791
17926
  async uploadFileAdvance(request: $_model.UploadFileAdvanceRequest, runtime: $dara.RuntimeOptions): Promise<$_model.UploadFileResponse> {
17792
17927
  // Step 0: init client
17793
- let accessKeyId = await this._credential.getAccessKeyId();
17794
- let accessKeySecret = await this._credential.getAccessKeySecret();
17795
- let securityToken = await this._credential.getSecurityToken();
17796
- let credentialType = this._credential.getType();
17928
+ if ($dara.isNull(this._credential)) {
17929
+ throw new $OpenApi.ClientError({
17930
+ code: "InvalidCredentials",
17931
+ 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.",
17932
+ });
17933
+ }
17934
+
17935
+ let credentialModel = await this._credential.getCredential();
17936
+ let accessKeyId = credentialModel.accessKeyId;
17937
+ let accessKeySecret = credentialModel.accessKeySecret;
17938
+ let securityToken = credentialModel.securityToken;
17939
+ let credentialType = credentialModel.type;
17797
17940
  let openPlatformEndpoint = this._openPlatformEndpoint;
17798
- if ($dara.isNull(openPlatformEndpoint)) {
17941
+ if ($dara.isNull(openPlatformEndpoint) || openPlatformEndpoint == "") {
17799
17942
  openPlatformEndpoint = "openplatform.aliyuncs.com";
17800
17943
  }
17801
17944
 
@@ -17812,51 +17955,54 @@ export default class Client extends OpenApi {
17812
17955
  protocol: this._protocol,
17813
17956
  regionId: this._regionId,
17814
17957
  });
17815
- let authClient = new OpenPlatform(authConfig);
17816
- let authRequest = new $OpenPlatform.AuthorizeFileUploadRequest({
17817
- product: "ESA",
17818
- regionId: this._regionId,
17958
+ let authClient = new OpenApi(authConfig);
17959
+ let authRequest = {
17960
+ Product: "ESA",
17961
+ RegionId: this._regionId,
17962
+ };
17963
+ let authReq = new $OpenApiUtil.OpenApiRequest({
17964
+ query: OpenApiUtil.query(authRequest),
17819
17965
  });
17820
- let authResponse = new $OpenPlatform.AuthorizeFileUploadResponse({ });
17821
- let ossConfig = new $OSS.Config({
17822
- accessKeyId: accessKeyId,
17823
- accessKeySecret: accessKeySecret,
17824
- type: "access_key",
17825
- protocol: this._protocol,
17826
- regionId: this._regionId,
17966
+ let authParams = new $OpenApiUtil.Params({
17967
+ action: "AuthorizeFileUpload",
17968
+ version: "2019-12-19",
17969
+ protocol: "HTTPS",
17970
+ pathname: "/",
17971
+ method: "GET",
17972
+ authType: "AK",
17973
+ style: "RPC",
17974
+ reqBodyType: "formData",
17975
+ bodyType: "json",
17827
17976
  });
17828
- let ossClient : OSS = new OSS(ossConfig);
17829
- let fileObj = new $FileForm.FileField({ });
17830
- let ossHeader = new $OSS.PostObjectRequestHeader({ });
17831
- let uploadRequest = new $OSS.PostObjectRequest({ });
17832
- let ossRuntime = new $OSSUtil.RuntimeOptions({ });
17833
- OpenApiUtil.convert(runtime, ossRuntime);
17977
+ let authResponse : {[key: string]: any} = { };
17978
+ let fileObj = new $dara.FileField({ });
17979
+ let ossHeader : {[key: string]: any} = { };
17980
+ let tmpBody : {[key: string]: any} = { };
17981
+ let useAccelerate : boolean = false;
17982
+ let authResponseBody : {[key: string ]: string} = { };
17834
17983
  let uploadFileReq = new $_model.UploadFileRequest({ });
17835
17984
  OpenApiUtil.convert(request, uploadFileReq);
17836
17985
  if (!$dara.isNull(request.urlObject)) {
17837
- authResponse = await authClient.authorizeFileUploadWithOptions(authRequest, runtime);
17838
- ossConfig.accessKeyId = authResponse.body.accessKeyId;
17839
- ossConfig.endpoint = OpenApiUtil.getEndpoint(authResponse.body.endpoint, authResponse.body.useAccelerate, this._endpointType);
17840
- ossClient = new OSS(ossConfig);
17841
- fileObj = new $FileForm.FileField({
17842
- filename: authResponse.body.objectKey,
17986
+ authResponse = await authClient.callApi(authParams, authReq, runtime);
17987
+ tmpBody = authResponse["body"];
17988
+ useAccelerate = Boolean(tmpBody["UseAccelerate"]);
17989
+ authResponseBody = OpenApiUtil.stringifyMapValue(tmpBody);
17990
+ fileObj = new $dara.FileField({
17991
+ filename: authResponseBody["ObjectKey"],
17843
17992
  content: request.urlObject,
17844
17993
  contentType: "",
17845
17994
  });
17846
- ossHeader = new $OSS.PostObjectRequestHeader({
17847
- accessKeyId: authResponse.body.accessKeyId,
17848
- policy: authResponse.body.encodedPolicy,
17849
- signature: authResponse.body.signature,
17850
- key: authResponse.body.objectKey,
17995
+ ossHeader = {
17996
+ host: `${authResponseBody["Bucket"]}.${OpenApiUtil.getEndpoint(authResponseBody["Endpoint"], useAccelerate, this._endpointType)}`,
17997
+ OSSAccessKeyId: authResponseBody["AccessKeyId"],
17998
+ policy: authResponseBody["EncodedPolicy"],
17999
+ Signature: authResponseBody["Signature"],
18000
+ key: authResponseBody["ObjectKey"],
17851
18001
  file: fileObj,
17852
- successActionStatus: "201",
17853
- });
17854
- uploadRequest = new $OSS.PostObjectRequest({
17855
- bucketName: authResponse.body.bucket,
17856
- header: ossHeader,
17857
- });
17858
- await ossClient.postObject(uploadRequest, ossRuntime);
17859
- uploadFileReq.url = `http://${authResponse.body.bucket}.${authResponse.body.endpoint}/${authResponse.body.objectKey}`;
18002
+ success_action_status: "201",
18003
+ };
18004
+ await this._postOSSObject(authResponseBody["Bucket"], ossHeader);
18005
+ uploadFileReq.url = `http://${authResponseBody["Bucket"]}.${authResponseBody["Endpoint"]}/${authResponseBody["ObjectKey"]}`;
17860
18006
  }
17861
18007
 
17862
18008
  let uploadFileResp = await this.uploadFileWithOptions(uploadFileReq, runtime);