@alicloud/das20200116 2.4.2 → 2.5.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 CHANGED
@@ -1378,6 +1378,29 @@ export default class Client extends OpenApi {
1378
1378
  * @returns GetDBInstanceConnectivityDiagnosisResponse
1379
1379
  */
1380
1380
  getDBInstanceConnectivityDiagnosis(request: $_model.GetDBInstanceConnectivityDiagnosisRequest): Promise<$_model.GetDBInstanceConnectivityDiagnosisResponse>;
1381
+ /**
1382
+ * DAS大模型能力异步逻辑接口
1383
+ *
1384
+ * @param request - GetDasAgentSSERequest
1385
+ * @param runtime - runtime options for this request RuntimeOptions
1386
+ * @returns GetDasAgentSSEResponse
1387
+ */
1388
+ getDasAgentSSEWithSSE(request: $_model.GetDasAgentSSERequest, runtime: $dara.RuntimeOptions): AsyncGenerator<$_model.GetDasAgentSSEResponse, any, unknown>;
1389
+ /**
1390
+ * DAS大模型能力异步逻辑接口
1391
+ *
1392
+ * @param request - GetDasAgentSSERequest
1393
+ * @param runtime - runtime options for this request RuntimeOptions
1394
+ * @returns GetDasAgentSSEResponse
1395
+ */
1396
+ getDasAgentSSEWithOptions(request: $_model.GetDasAgentSSERequest, runtime: $dara.RuntimeOptions): Promise<$_model.GetDasAgentSSEResponse>;
1397
+ /**
1398
+ * DAS大模型能力异步逻辑接口
1399
+ *
1400
+ * @param request - GetDasAgentSSERequest
1401
+ * @returns GetDasAgentSSEResponse
1402
+ */
1403
+ getDasAgentSSE(request: $_model.GetDasAgentSSERequest): Promise<$_model.GetDasAgentSSEResponse>;
1381
1404
  /**
1382
1405
  * Queries the storage usage of a database instance for which Database Autonomy Service (DAS) Enterprise Edition V1 or V2 is enabled.
1383
1406
  *
package/dist/client.js CHANGED
@@ -35,6 +35,26 @@ 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 __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
39
+ var __asyncValues = (this && this.__asyncValues) || function (o) {
40
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
41
+ var m = o[Symbol.asyncIterator], i;
42
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
43
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
44
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
45
+ };
46
+ var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
47
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
48
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
49
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
50
+ function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
51
+ function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
52
+ function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
53
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
54
+ function fulfill(value) { resume("next", value); }
55
+ function reject(value) { resume("throw", value); }
56
+ function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
57
+ };
38
58
  var __importDefault = (this && this.__importDefault) || function (mod) {
39
59
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
60
  };
@@ -3324,6 +3344,115 @@ class Client extends openapi_core_1.default {
3324
3344
  let runtime = new $dara.RuntimeOptions({});
3325
3345
  return await this.getDBInstanceConnectivityDiagnosisWithOptions(request, runtime);
3326
3346
  }
3347
+ /**
3348
+ * DAS大模型能力异步逻辑接口
3349
+ *
3350
+ * @param request - GetDasAgentSSERequest
3351
+ * @param runtime - runtime options for this request RuntimeOptions
3352
+ * @returns GetDasAgentSSEResponse
3353
+ */
3354
+ getDasAgentSSEWithSSE(request, runtime) {
3355
+ return __asyncGenerator(this, arguments, function* getDasAgentSSEWithSSE_1() {
3356
+ var _a, e_1, _b, _c;
3357
+ request.validate();
3358
+ let query = {};
3359
+ if (!$dara.isNull(request.agentId)) {
3360
+ query["AgentId"] = request.agentId;
3361
+ }
3362
+ if (!$dara.isNull(request.instanceId)) {
3363
+ query["InstanceId"] = request.instanceId;
3364
+ }
3365
+ if (!$dara.isNull(request.query)) {
3366
+ query["Query"] = request.query;
3367
+ }
3368
+ if (!$dara.isNull(request.sessionId)) {
3369
+ query["SessionId"] = request.sessionId;
3370
+ }
3371
+ let req = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
3372
+ query: openapi_core_2.OpenApiUtil.query(query),
3373
+ });
3374
+ let params = new openapi_core_2.$OpenApiUtil.Params({
3375
+ action: "GetDasAgentSSE",
3376
+ version: "2020-01-16",
3377
+ protocol: "HTTPS",
3378
+ pathname: "/",
3379
+ method: "POST",
3380
+ authType: "AK",
3381
+ style: "RPC",
3382
+ reqBodyType: "formData",
3383
+ bodyType: "json",
3384
+ });
3385
+ let sseResp = yield __await(this.callSSEApi(params, req, runtime));
3386
+ try {
3387
+ for (var _d = true, sseResp_1 = __asyncValues(sseResp), sseResp_1_1; sseResp_1_1 = yield __await(sseResp_1.next()), _a = sseResp_1_1.done, !_a; _d = true) {
3388
+ _c = sseResp_1_1.value;
3389
+ _d = false;
3390
+ let resp = _c;
3391
+ let data = JSON.parse(resp.event.data);
3392
+ yield yield __await($dara.cast({
3393
+ statusCode: resp.statusCode,
3394
+ headers: resp.headers,
3395
+ body: Object.assign(Object.assign({}, data), { RequestId: resp.event.id, Message: resp.event.event }),
3396
+ }, new $_model.GetDasAgentSSEResponse({})));
3397
+ }
3398
+ }
3399
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
3400
+ finally {
3401
+ try {
3402
+ if (!_d && !_a && (_b = sseResp_1.return)) yield __await(_b.call(sseResp_1));
3403
+ }
3404
+ finally { if (e_1) throw e_1.error; }
3405
+ }
3406
+ });
3407
+ }
3408
+ /**
3409
+ * DAS大模型能力异步逻辑接口
3410
+ *
3411
+ * @param request - GetDasAgentSSERequest
3412
+ * @param runtime - runtime options for this request RuntimeOptions
3413
+ * @returns GetDasAgentSSEResponse
3414
+ */
3415
+ async getDasAgentSSEWithOptions(request, runtime) {
3416
+ request.validate();
3417
+ let query = {};
3418
+ if (!$dara.isNull(request.agentId)) {
3419
+ query["AgentId"] = request.agentId;
3420
+ }
3421
+ if (!$dara.isNull(request.instanceId)) {
3422
+ query["InstanceId"] = request.instanceId;
3423
+ }
3424
+ if (!$dara.isNull(request.query)) {
3425
+ query["Query"] = request.query;
3426
+ }
3427
+ if (!$dara.isNull(request.sessionId)) {
3428
+ query["SessionId"] = request.sessionId;
3429
+ }
3430
+ let req = new openapi_core_2.$OpenApiUtil.OpenApiRequest({
3431
+ query: openapi_core_2.OpenApiUtil.query(query),
3432
+ });
3433
+ let params = new openapi_core_2.$OpenApiUtil.Params({
3434
+ action: "GetDasAgentSSE",
3435
+ version: "2020-01-16",
3436
+ protocol: "HTTPS",
3437
+ pathname: "/",
3438
+ method: "POST",
3439
+ authType: "AK",
3440
+ style: "RPC",
3441
+ reqBodyType: "formData",
3442
+ bodyType: "json",
3443
+ });
3444
+ return $dara.cast(await this.callApi(params, req, runtime), new $_model.GetDasAgentSSEResponse({}));
3445
+ }
3446
+ /**
3447
+ * DAS大模型能力异步逻辑接口
3448
+ *
3449
+ * @param request - GetDasAgentSSERequest
3450
+ * @returns GetDasAgentSSEResponse
3451
+ */
3452
+ async getDasAgentSSE(request) {
3453
+ let runtime = new $dara.RuntimeOptions({});
3454
+ return await this.getDasAgentSSEWithOptions(request, runtime);
3455
+ }
3327
3456
  /**
3328
3457
  * Queries the storage usage of a database instance for which Database Autonomy Service (DAS) Enterprise Edition V1 or V2 is enabled.
3329
3458
  *