@cobo/cobo-waas2 1.16.0 → 1.17.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 (76) hide show
  1. package/README.md +13 -5
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/PreRequestScript.js +27 -33
  4. package/dist/api/AppWorkflowsApi.js +22 -22
  5. package/dist/api/OAuthApi.js +93 -6
  6. package/dist/api/PaymentApi.js +91 -98
  7. package/dist/api/WalletsApi.js +6 -6
  8. package/dist/index.js +49 -7
  9. package/dist/model/AppWorkflow.js +7 -7
  10. package/dist/model/AppWorkflowField.js +5 -5
  11. package/dist/model/AppWorkflowPolicy.js +1 -1
  12. package/dist/model/ApprovalEntry.js +1 -1
  13. package/dist/model/ApprovalRequest.js +5 -3
  14. package/dist/model/ApprovalRequestDetail.js +2 -1
  15. package/dist/model/ApprovalUser.js +4 -4
  16. package/dist/model/ChainInfo.js +1 -1
  17. package/dist/model/CreateApprovalRequest201Response.js +2 -1
  18. package/dist/model/CreatePaymentOrderRequest.js +5 -5
  19. package/dist/model/CreateRefundRequest.js +35 -0
  20. package/dist/model/CreateSettlement.js +35 -0
  21. package/dist/model/CryptoAddress.js +171 -0
  22. package/dist/model/CustodialTransferDestination.js +137 -0
  23. package/dist/model/ExchangePermissionToken201Response.js +122 -0
  24. package/dist/model/{CreateBankAccountRequest.js → ExchangePermissionTokenRequest.js} +30 -28
  25. package/dist/model/Order.js +4 -4
  26. package/dist/model/PaymentOrderEventData.js +6 -6
  27. package/dist/model/PayoutChannel.js +61 -0
  28. package/dist/model/PolicyAction.js +1 -1
  29. package/dist/model/PolicyActionContent.js +6 -4
  30. package/dist/model/PolicyCondition.js +5 -5
  31. package/dist/model/RefreshPermissionTokenRequest.js +110 -0
  32. package/dist/model/RequestApproval.js +9 -9
  33. package/dist/model/RevokeApprovalRequest201Response.js +2 -1
  34. package/dist/model/RevokeApprovalRequestRequest.js +2 -2
  35. package/dist/model/SettlementDetail.js +9 -0
  36. package/dist/model/SupportedToken.js +222 -0
  37. package/dist/model/TransactionDestination.js +4 -0
  38. package/dist/model/TransactionDestinationType.js +5 -0
  39. package/dist/model/TransactionTransferToWalletDestination.js +2 -2
  40. package/dist/model/TransferDestination.js +42 -14
  41. package/dist/model/TransferDestinationType.js +5 -0
  42. package/docs/AppWorkflow.md +3 -3
  43. package/docs/AppWorkflowField.md +2 -2
  44. package/docs/AppWorkflowsApi.md +12 -12
  45. package/docs/ApprovalRequest.md +2 -2
  46. package/docs/ApprovalRequestDetail.md +1 -1
  47. package/docs/ApprovalUser.md +2 -2
  48. package/docs/ChainInfo.md +1 -1
  49. package/docs/CreateApprovalRequest201Response.md +1 -1
  50. package/docs/CreatePaymentOrderRequest.md +1 -1
  51. package/docs/CreateRefundRequest.md +3 -0
  52. package/docs/CreateSettlement.md +3 -0
  53. package/docs/CryptoAddress.md +14 -0
  54. package/docs/CustodialTransferDestination.md +11 -0
  55. package/docs/ExchangePermissionToken201Response.md +12 -0
  56. package/docs/ExchangePermissionTokenRequest.md +9 -0
  57. package/docs/OAuthApi.md +102 -0
  58. package/docs/Order.md +2 -2
  59. package/docs/PaymentApi.md +80 -86
  60. package/docs/PaymentOrderEventData.md +2 -2
  61. package/docs/PayoutChannel.md +12 -0
  62. package/docs/PolicyActionContent.md +4 -4
  63. package/docs/PolicyCondition.md +2 -2
  64. package/docs/RefreshPermissionTokenRequest.md +9 -0
  65. package/docs/RequestApproval.md +4 -4
  66. package/docs/RevokeApprovalRequest201Response.md +1 -1
  67. package/docs/RevokeApprovalRequestRequest.md +1 -1
  68. package/docs/SettlementDetail.md +1 -0
  69. package/docs/SupportedToken.md +17 -0
  70. package/docs/TransactionDestinationType.md +2 -0
  71. package/docs/TransactionTransferToWalletDestination.md +1 -1
  72. package/docs/TransferDestination.md +1 -1
  73. package/docs/TransferDestinationType.md +2 -0
  74. package/docs/WalletsApi.md +3 -3
  75. package/package.json +1 -1
  76. package/docs/CreateBankAccountRequest.md +0 -9
package/README.md CHANGED
@@ -15,7 +15,7 @@ For more information about the WaaS 2.0 API, see [Introduction to WaaS 2.0](http
15
15
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
16
16
 
17
17
  - API version: v2
18
- - Package version: 1.16.0
18
+ - Package version: 1.17.0
19
19
  - Generator version: 7.6.0
20
20
  - Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
21
21
  For more information, please visit [https://www.cobo.com/waas](https://www.cobo.com/waas)
@@ -70,7 +70,7 @@ Class | Method | HTTP request | Description
70
70
  *CoboWaas2.AddressBooksApi* | [**listAddressBooks**](docs/AddressBooksApi.md#listAddressBooks) | **GET** /address_books | List address book entries
71
71
  *CoboWaas2.AppWorkflowsApi* | [**createApprovalRequest**](docs/AppWorkflowsApi.md#createApprovalRequest) | **POST** /app/workflows/approval_requests | Request workflow approval
72
72
  *CoboWaas2.AppWorkflowsApi* | [**getApprovalRequestById**](docs/AppWorkflowsApi.md#getApprovalRequestById) | **GET** /app/workflows/approval_requests/{approval_id} | Get approval request details
73
- *CoboWaas2.AppWorkflowsApi* | [**listAppWorkflows**](docs/AppWorkflowsApi.md#listAppWorkflows) | **GET** /app/workflows | list app workflows
73
+ *CoboWaas2.AppWorkflowsApi* | [**listAppWorkflows**](docs/AppWorkflowsApi.md#listAppWorkflows) | **GET** /app/workflows | List app workflows
74
74
  *CoboWaas2.AppWorkflowsApi* | [**listApprovalRequests**](docs/AppWorkflowsApi.md#listApprovalRequests) | **GET** /app/workflows/approval_requests | List approval requests
75
75
  *CoboWaas2.AppWorkflowsApi* | [**revokeApprovalRequest**](docs/AppWorkflowsApi.md#revokeApprovalRequest) | **POST** /app/workflows/approval_requests/{approval_id}/revoke | Revoke approval request
76
76
  *CoboWaas2.DevelopersApi* | [**getApiKeyInfo**](docs/DevelopersApi.md#getApiKeyInfo) | **GET** /developers/api_key_info | Get API key information
@@ -91,9 +91,10 @@ Class | Method | HTTP request | Description
91
91
  *CoboWaas2.FeeStationApi* | [**listFeeStationAddresses**](docs/FeeStationApi.md#listFeeStationAddresses) | **GET** /fee_station/addresses | List Fee Station addresses
92
92
  *CoboWaas2.FeeStationApi* | [**listFeeStationTransactions**](docs/FeeStationApi.md#listFeeStationTransactions) | **GET** /fee_station/transactions | List all Fee Station transactions
93
93
  *CoboWaas2.FeeStationApi* | [**listTokenBalancesForFeeStation**](docs/FeeStationApi.md#listTokenBalancesForFeeStation) | **GET** /fee_station/tokens | List Fee Station token balances
94
+ *CoboWaas2.OAuthApi* | [**exchangePermissionToken**](docs/OAuthApi.md#exchangePermissionToken) | **POST** /oauth/permission_token/exchange | Exchange Permission Access Token by API Key
94
95
  *CoboWaas2.OAuthApi* | [**getToken**](docs/OAuthApi.md#getToken) | **GET** /oauth/token | Get Org Access Token
96
+ *CoboWaas2.OAuthApi* | [**refreshPermissionToken**](docs/OAuthApi.md#refreshPermissionToken) | **POST** /oauth/permission_token/refresh | Refresh Permission Access Token by Permission Refresh Token
95
97
  *CoboWaas2.OAuthApi* | [**refreshToken**](docs/OAuthApi.md#refreshToken) | **POST** /oauth/token | Refresh Org Access Token
96
- *CoboWaas2.PaymentApi* | [**createBankAccount**](docs/PaymentApi.md#createBankAccount) | **POST** /payments/bank_accounts | Create bank account
97
98
  *CoboWaas2.PaymentApi* | [**createMerchant**](docs/PaymentApi.md#createMerchant) | **POST** /payments/merchants | Create merchant
98
99
  *CoboWaas2.PaymentApi* | [**createPaymentOrder**](docs/PaymentApi.md#createPaymentOrder) | **POST** /payments/orders | Create pay-in order
99
100
  *CoboWaas2.PaymentApi* | [**createRefund**](docs/PaymentApi.md#createRefund) | **POST** /payments/refunds | Create refund order
@@ -105,10 +106,11 @@ Class | Method | HTTP request | Description
105
106
  *CoboWaas2.PaymentApi* | [**getSettlementById**](docs/PaymentApi.md#getSettlementById) | **GET** /payments/settlement_requests/{settlement_request_id} | Get settlement request information
106
107
  *CoboWaas2.PaymentApi* | [**getSettlementInfoByIds**](docs/PaymentApi.md#getSettlementInfoByIds) | **GET** /payments/settlement_info | Get withdrawable balances
107
108
  *CoboWaas2.PaymentApi* | [**listBankAccounts**](docs/PaymentApi.md#listBankAccounts) | **GET** /payments/bank_accounts | List all bank accounts
109
+ *CoboWaas2.PaymentApi* | [**listCryptoAddresses**](docs/PaymentApi.md#listCryptoAddresses) | **GET** /payments/crypto_addresses | List crypto addresses
108
110
  *CoboWaas2.PaymentApi* | [**listMerchants**](docs/PaymentApi.md#listMerchants) | **GET** /payments/merchants | List all merchants
109
111
  *CoboWaas2.PaymentApi* | [**listPaymentOrders**](docs/PaymentApi.md#listPaymentOrders) | **GET** /payments/orders | List all pay-in orders
112
+ *CoboWaas2.PaymentApi* | [**listPaymentSupportedTokens**](docs/PaymentApi.md#listPaymentSupportedTokens) | **GET** /payments/supported_tokens | List all supported tokens
110
113
  *CoboWaas2.PaymentApi* | [**listSettlementRequests**](docs/PaymentApi.md#listSettlementRequests) | **GET** /payments/settlement_requests | List all settlement requests
111
- *CoboWaas2.PaymentApi* | [**updateBankAccountById**](docs/PaymentApi.md#updateBankAccountById) | **PUT** /payments/bank_accounts/{bank_account_id} | Update bank account
112
114
  *CoboWaas2.PaymentApi* | [**updateMerchantById**](docs/PaymentApi.md#updateMerchantById) | **PUT** /payments/merchants/{merchant_id} | Update merchant
113
115
  *CoboWaas2.PaymentApi* | [**updatePaymentOrder**](docs/PaymentApi.md#updatePaymentOrder) | **PUT** /payments/orders/{order_id} | Update pay-in order
114
116
  *CoboWaas2.PrimeBrokerApi* | [**changeGuardPubkey**](docs/PrimeBrokerApi.md#changeGuardPubkey) | **PUT** /prime_broker/user/{user_id}/guard_pubkey | Change Guard pubkey binding
@@ -297,7 +299,6 @@ Class | Method | HTTP request | Description
297
299
  - [CoboWaas2.CreateBabylonAirdropRegistrationRequest](docs/CreateBabylonAirdropRegistrationRequest.md)
298
300
  - [CoboWaas2.CreateBabylonStakingRegistration201Response](docs/CreateBabylonStakingRegistration201Response.md)
299
301
  - [CoboWaas2.CreateBabylonStakingRegistrationRequest](docs/CreateBabylonStakingRegistrationRequest.md)
300
- - [CoboWaas2.CreateBankAccountRequest](docs/CreateBankAccountRequest.md)
301
302
  - [CoboWaas2.CreateClaimActivity](docs/CreateClaimActivity.md)
302
303
  - [CoboWaas2.CreateClaimActivityRequest](docs/CreateClaimActivityRequest.md)
303
304
  - [CoboWaas2.CreateCustodialWalletParams](docs/CreateCustodialWalletParams.md)
@@ -332,7 +333,9 @@ Class | Method | HTTP request | Description
332
333
  - [CoboWaas2.CreateWithdrawActivity](docs/CreateWithdrawActivity.md)
333
334
  - [CoboWaas2.CreateWithdrawActivityRequest](docs/CreateWithdrawActivityRequest.md)
334
335
  - [CoboWaas2.CreatedWalletInfo](docs/CreatedWalletInfo.md)
336
+ - [CoboWaas2.CryptoAddress](docs/CryptoAddress.md)
335
337
  - [CoboWaas2.CurveType](docs/CurveType.md)
338
+ - [CoboWaas2.CustodialTransferDestination](docs/CustodialTransferDestination.md)
336
339
  - [CoboWaas2.CustodialTransferSource](docs/CustodialTransferSource.md)
337
340
  - [CoboWaas2.CustodialWalletInfo](docs/CustodialWalletInfo.md)
338
341
  - [CoboWaas2.CustodialWeb3ContractCallSource](docs/CustodialWeb3ContractCallSource.md)
@@ -376,6 +379,8 @@ Class | Method | HTTP request | Description
376
379
  - [CoboWaas2.EvmLegacyFeeBasePrice](docs/EvmLegacyFeeBasePrice.md)
377
380
  - [CoboWaas2.EvmLegacyFeeRate](docs/EvmLegacyFeeRate.md)
378
381
  - [CoboWaas2.ExchangeId](docs/ExchangeId.md)
382
+ - [CoboWaas2.ExchangePermissionToken201Response](docs/ExchangePermissionToken201Response.md)
383
+ - [CoboWaas2.ExchangePermissionTokenRequest](docs/ExchangePermissionTokenRequest.md)
379
384
  - [CoboWaas2.ExchangeTransferDestination](docs/ExchangeTransferDestination.md)
380
385
  - [CoboWaas2.ExchangeTransferSource](docs/ExchangeTransferSource.md)
381
386
  - [CoboWaas2.ExchangeWalletInfo](docs/ExchangeWalletInfo.md)
@@ -474,6 +479,7 @@ Class | Method | HTTP request | Description
474
479
  - [CoboWaas2.PaymentRefundEventData](docs/PaymentRefundEventData.md)
475
480
  - [CoboWaas2.PaymentSettlementEvent](docs/PaymentSettlementEvent.md)
476
481
  - [CoboWaas2.PaymentTransaction](docs/PaymentTransaction.md)
482
+ - [CoboWaas2.PayoutChannel](docs/PayoutChannel.md)
477
483
  - [CoboWaas2.PolicyAction](docs/PolicyAction.md)
478
484
  - [CoboWaas2.PolicyActionContent](docs/PolicyActionContent.md)
479
485
  - [CoboWaas2.PolicyActionType](docs/PolicyActionType.md)
@@ -489,6 +495,7 @@ Class | Method | HTTP request | Description
489
495
  - [CoboWaas2.RawMessageSignDestination](docs/RawMessageSignDestination.md)
490
496
  - [CoboWaas2.RefreshAddressBalancesByToken200Response](docs/RefreshAddressBalancesByToken200Response.md)
491
497
  - [CoboWaas2.RefreshAddressBalancesByTokenRequest](docs/RefreshAddressBalancesByTokenRequest.md)
498
+ - [CoboWaas2.RefreshPermissionTokenRequest](docs/RefreshPermissionTokenRequest.md)
492
499
  - [CoboWaas2.RefreshToken2XXResponse](docs/RefreshToken2XXResponse.md)
493
500
  - [CoboWaas2.RefreshTokenRequest](docs/RefreshTokenRequest.md)
494
501
  - [CoboWaas2.Refund](docs/Refund.md)
@@ -537,6 +544,7 @@ Class | Method | HTTP request | Description
537
544
  - [CoboWaas2.StakingsExtra](docs/StakingsExtra.md)
538
545
  - [CoboWaas2.SubWalletAssetBalance](docs/SubWalletAssetBalance.md)
539
546
  - [CoboWaas2.SubmitDepositTravelRuleInfo201Response](docs/SubmitDepositTravelRuleInfo201Response.md)
547
+ - [CoboWaas2.SupportedToken](docs/SupportedToken.md)
540
548
  - [CoboWaas2.SwapActivity](docs/SwapActivity.md)
541
549
  - [CoboWaas2.SwapActivityApprovers](docs/SwapActivityApprovers.md)
542
550
  - [CoboWaas2.SwapActivityDetail](docs/SwapActivityDetail.md)
package/dist/ApiClient.js CHANGED
@@ -101,7 +101,7 @@ var ApiClient = /*#__PURE__*/function () {
101
101
  * @default {}
102
102
  */
103
103
  this.defaultHeaders = {
104
- 'User-Agent': 'cobo-waas2-js-sdk/1.16.0'
104
+ 'User-Agent': 'cobo-waas2-js-sdk/1.17.0'
105
105
  };
106
106
 
107
107
  /**
@@ -6,7 +6,8 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
6
6
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
7
7
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
8
8
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
9
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return r; }; var t, r = {}, e = Object.prototype, n = e.hasOwnProperty, o = "function" == typeof Symbol ? Symbol : {}, i = o.iterator || "@@iterator", a = o.asyncIterator || "@@asyncIterator", u = o.toStringTag || "@@toStringTag"; function c(t, r, e, n) { Object.defineProperty(t, r, { value: e, enumerable: !n, configurable: !n, writable: !n }); } try { c({}, ""); } catch (t) { c = function c(t, r, e) { return t[r] = e; }; } function h(r, e, n, o) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype); return c(a, "_invoke", function (r, e, n) { var o = 1; return function (i, a) { if (3 === o) throw Error("Generator is already running"); if (4 === o) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var u = n.delegate; if (u) { var c = d(u, n); if (c) { if (c === f) continue; return c; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (1 === o) throw o = 4, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = 3; var h = s(r, e, n); if ("normal" === h.type) { if (o = n.done ? 4 : 2, h.arg === f) continue; return { value: h.arg, done: n.done }; } "throw" === h.type && (o = 4, n.method = "throw", n.arg = h.arg); } }; }(r, n, new Context(o || [])), !0), a; } function s(t, r, e) { try { return { type: "normal", arg: t.call(r, e) }; } catch (t) { return { type: "throw", arg: t }; } } r.wrap = h; var f = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var l = {}; c(l, i, function () { return this; }); var p = Object.getPrototypeOf, y = p && p(p(x([]))); y && y !== e && n.call(y, i) && (l = y); var v = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(l); function g(t) { ["next", "throw", "return"].forEach(function (r) { c(t, r, function (t) { return this._invoke(r, t); }); }); } function AsyncIterator(t, r) { function e(o, i, a, u) { var c = s(t[o], t, i); if ("throw" !== c.type) { var h = c.arg, f = h.value; return f && "object" == _typeof(f) && n.call(f, "__await") ? r.resolve(f.__await).then(function (t) { e("next", t, a, u); }, function (t) { e("throw", t, a, u); }) : r.resolve(f).then(function (t) { h.value = t, a(h); }, function (t) { return e("throw", t, a, u); }); } u(c.arg); } var o; c(this, "_invoke", function (t, n) { function i() { return new r(function (r, o) { e(t, n, r, o); }); } return o = o ? o.then(i, i) : i(); }, !0); } function d(r, e) { var n = e.method, o = r.i[n]; if (o === t) return e.delegate = null, "throw" === n && r.i["return"] && (e.method = "return", e.arg = t, d(r, e), "throw" === e.method) || "return" !== n && (e.method = "throw", e.arg = new TypeError("The iterator does not provide a '" + n + "' method")), f; var i = s(o, r.i, e.arg); if ("throw" === i.type) return e.method = "throw", e.arg = i.arg, e.delegate = null, f; var a = i.arg; return a ? a.done ? (e[r.r] = a.value, e.next = r.n, "return" !== e.method && (e.method = "next", e.arg = t), e.delegate = null, f) : a : (e.method = "throw", e.arg = new TypeError("iterator result is not an object"), e.delegate = null, f); } function w(t) { this.tryEntries.push(t); } function m(r) { var e = r[4] || {}; e.type = "normal", e.arg = t, r[4] = e; } function Context(t) { this.tryEntries = [[-1]], t.forEach(w, this), this.reset(!0); } function x(r) { if (null != r) { var e = r[i]; if (e) return e.call(r); if ("function" == typeof r.next) return r; if (!isNaN(r.length)) { var o = -1, a = function e() { for (; ++o < r.length;) if (n.call(r, o)) return e.value = r[o], e.done = !1, e; return e.value = t, e.done = !0, e; }; return a.next = a; } } throw new TypeError(_typeof(r) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, c(v, "constructor", GeneratorFunctionPrototype), c(GeneratorFunctionPrototype, "constructor", GeneratorFunction), c(GeneratorFunctionPrototype, u, GeneratorFunction.displayName = "GeneratorFunction"), r.isGeneratorFunction = function (t) { var r = "function" == typeof t && t.constructor; return !!r && (r === GeneratorFunction || "GeneratorFunction" === (r.displayName || r.name)); }, r.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, c(t, u, "GeneratorFunction")), t.prototype = Object.create(v), t; }, r.awrap = function (t) { return { __await: t }; }, g(AsyncIterator.prototype), c(AsyncIterator.prototype, a, function () { return this; }), r.AsyncIterator = AsyncIterator, r.async = function (t, e, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(h(t, e, n, o), i); return r.isGeneratorFunction(e) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, g(v), c(v, u, "Generator"), c(v, i, function () { return this; }), c(v, "toString", function () { return "[object Generator]"; }), r.keys = function (t) { var r = Object(t), e = []; for (var n in r) e.unshift(n); return function t() { for (; e.length;) if ((n = e.pop()) in r) return t.value = n, t.done = !1, t; return t.done = !0, t; }; }, r.values = x, Context.prototype = { constructor: Context, reset: function reset(r) { if (this.prev = this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(m), !r) for (var e in this) "t" === e.charAt(0) && n.call(this, e) && !isNaN(+e.slice(1)) && (this[e] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0][4]; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(r) { if (this.done) throw r; var e = this; function n(t) { a.type = "throw", a.arg = r, e.next = t; } for (var o = e.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i[4], u = this.prev, c = i[1], h = i[2]; if (-1 === i[0]) return n("end"), !1; if (!c && !h) throw Error("try statement without catch or finally"); if (null != i[0] && i[0] <= u) { if (u < c) return this.method = "next", this.arg = t, n(c), !0; if (u < h) return n(h), !1; } } }, abrupt: function abrupt(t, r) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var n = this.tryEntries[e]; if (n[0] > -1 && n[0] <= this.prev && this.prev < n[2]) { var o = n; break; } } o && ("break" === t || "continue" === t) && o[0] <= r && r <= o[2] && (o = null); var i = o ? o[4] : {}; return i.type = t, i.arg = r, o ? (this.method = "next", this.next = o[2], f) : this.complete(i); }, complete: function complete(t, r) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && r && (this.next = r), f; }, finish: function finish(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[2] === t) return this.complete(e[4], e[3]), m(e), f; } }, "catch": function _catch(t) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var e = this.tryEntries[r]; if (e[0] === t) { var n = e[4]; if ("throw" === n.type) { var o = n.arg; m(e); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(r, e, n) { return this.delegate = { i: x(r), r: e, n: n }, "next" === this.method && (this.arg = t), f; } }, r; }
9
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
10
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
10
11
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
11
12
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
12
13
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -390,24 +391,21 @@ var _sign = function _sign(e, t, n) {
390
391
  };
391
392
  },
392
393
  signAsync = /*#__PURE__*/function () {
393
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(e, t) {
394
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(e, t) {
394
395
  var n, o, r;
395
- return _regeneratorRuntime().wrap(function _callee$(_context) {
396
- while (1) switch (_context.prev = _context.next) {
396
+ return _regenerator().w(function (_context) {
397
+ while (1) switch (_context.n) {
397
398
  case 0:
398
399
  n = toU8(e);
399
- _context.next = 3;
400
+ _context.n = 1;
400
401
  return getExtendedPublicKeyAsync(t);
401
- case 3:
402
- o = _context.sent;
403
- _context.next = 6;
402
+ case 1:
403
+ o = _context.v;
404
+ _context.n = 2;
404
405
  return sha512a(o.prefix, n);
405
- case 6:
406
- r = _context.sent;
407
- return _context.abrupt("return", hashFinish(!0, _sign(o, r, n)));
408
- case 8:
409
- case "end":
410
- return _context.stop();
406
+ case 2:
407
+ r = _context.v;
408
+ return _context.a(2, hashFinish(!0, _sign(o, r, n)));
411
409
  }
412
410
  }, _callee);
413
411
  }));
@@ -447,17 +445,14 @@ var _sign = function _sign(e, t, n) {
447
445
  };
448
446
  },
449
447
  verifyAsync = /*#__PURE__*/function () {
450
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e, t, n) {
448
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(e, t, n) {
451
449
  var o,
452
450
  _args2 = arguments;
453
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
454
- while (1) switch (_context2.prev = _context2.next) {
451
+ return _regenerator().w(function (_context2) {
452
+ while (1) switch (_context2.n) {
455
453
  case 0:
456
454
  o = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : dvo;
457
- return _context2.abrupt("return", hashFinish(!0, _verify(e, t, n, o)));
458
- case 2:
459
- case "end":
460
- return _context2.stop();
455
+ return _context2.a(2, hashFinish(!0, _verify(e, t, n, o)));
461
456
  }
462
457
  }, _callee2);
463
458
  }));
@@ -484,25 +479,24 @@ var _sign = function _sign(e, t, n) {
484
479
  return t && t.getRandomValues || err("crypto.getRandomValues must be defined"), t.getRandomValues(u8n(e));
485
480
  },
486
481
  sha512Async: function () {
487
- var _sha512Async = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
482
+ var _sha512Async = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
488
483
  var t,
489
484
  n,
490
- _args3 = arguments;
491
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
492
- while (1) switch (_context3.prev = _context3.next) {
485
+ _args3 = arguments,
486
+ _t3,
487
+ _t4;
488
+ return _regenerator().w(function (_context3) {
489
+ while (1) switch (_context3.n) {
493
490
  case 0:
494
491
  t = cr();
495
492
  t && t.subtle || err("crypto.subtle or etc.sha512Async must be defined");
496
493
  n = concatB.apply(void 0, _args3);
497
- _context3.t0 = u8n;
498
- _context3.next = 6;
494
+ _t3 = u8n;
495
+ _context3.n = 1;
499
496
  return t.subtle.digest("SHA-512", n.buffer);
500
- case 6:
501
- _context3.t1 = _context3.sent;
502
- return _context3.abrupt("return", (0, _context3.t0)(_context3.t1));
503
- case 8:
504
- case "end":
505
- return _context3.stop();
497
+ case 1:
498
+ _t4 = _context3.v;
499
+ return _context3.a(2, _t3(_t4));
506
500
  }
507
501
  }, _callee3);
508
502
  }));
@@ -48,9 +48,9 @@ var AppWorkflowsApi = exports["default"] = /*#__PURE__*/function () {
48
48
 
49
49
  /**
50
50
  * Request workflow approval
51
- * This operation is request approval from app workflow with idempotency checks.
51
+ * This operation triggers a specified workflow and generates a new approval request. <Note>To use the approval workflow operations, you must use the Cobo OAuth authentication method ([Org Access Token](https://www.cobo.com/developers/v2/apps/org-access-tokens)).</Note>
52
52
  * @param {Object} opts Optional parameters
53
- * @param {module:model/RequestApproval} [RequestApproval] The request body to app workflow approval.
53
+ * @param {module:model/RequestApproval} [RequestApproval] The request body to request workflow approval.
54
54
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CreateApprovalRequest201Response} and HTTP response
55
55
  */
56
56
  return _createClass(AppWorkflowsApi, [{
@@ -74,9 +74,9 @@ var AppWorkflowsApi = exports["default"] = /*#__PURE__*/function () {
74
74
 
75
75
  /**
76
76
  * Request workflow approval
77
- * This operation is request approval from app workflow with idempotency checks.
77
+ * This operation triggers a specified workflow and generates a new approval request. <Note>To use the approval workflow operations, you must use the Cobo OAuth authentication method ([Org Access Token](https://www.cobo.com/developers/v2/apps/org-access-tokens)).</Note>
78
78
  * @param {Object} opts Optional parameters
79
- * @param {module:model/RequestApproval} opts.RequestApproval The request body to app workflow approval.
79
+ * @param {module:model/RequestApproval} opts.RequestApproval The request body to request workflow approval.
80
80
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CreateApprovalRequest201Response}
81
81
  */
82
82
  }, {
@@ -89,8 +89,8 @@ var AppWorkflowsApi = exports["default"] = /*#__PURE__*/function () {
89
89
 
90
90
  /**
91
91
  * Get approval request details
92
- * This operation is retrieves approval request from app workflow.
93
- * @param {String} approval_id The approval ID that is used to track a workflow approval request.
92
+ * This operation retrieves the details of a specific approval request. <Note>To use the approval workflow operations, you must use the Cobo OAuth authentication method ([Org Access Token](https://www.cobo.com/developers/v2/apps/org-access-tokens)).</Note>
93
+ * @param {String} approval_id The system-generated unique ID of the approval request.
94
94
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApprovalRequestDetail} and HTTP response
95
95
  */
96
96
  }, {
@@ -119,8 +119,8 @@ var AppWorkflowsApi = exports["default"] = /*#__PURE__*/function () {
119
119
 
120
120
  /**
121
121
  * Get approval request details
122
- * This operation is retrieves approval request from app workflow.
123
- * @param {String} approval_id The approval ID that is used to track a workflow approval request.
122
+ * This operation retrieves the details of a specific approval request. <Note>To use the approval workflow operations, you must use the Cobo OAuth authentication method ([Org Access Token](https://www.cobo.com/developers/v2/apps/org-access-tokens)).</Note>
123
+ * @param {String} approval_id The system-generated unique ID of the approval request.
124
124
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApprovalRequestDetail}
125
125
  */
126
126
  }, {
@@ -132,8 +132,8 @@ var AppWorkflowsApi = exports["default"] = /*#__PURE__*/function () {
132
132
  }
133
133
 
134
134
  /**
135
- * list app workflows
136
- * This operation is list app workflows of app.
135
+ * List app workflows
136
+ * This operation retrieves all approval workflows of an Cobo Portal App. <Note>You need to [configure approval workflow](https://www.cobo.com/developers/v2/apps/configure-workflow) in the app Manifest file first.</Note> <Note>To use the approval workflow operations, you must use the Cobo OAuth authentication method ([Org Access Token](https://www.cobo.com/developers/v2/apps/org-access-tokens)).</Note>
137
137
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/AppWorkflow>} and HTTP response
138
138
  */
139
139
  }, {
@@ -155,8 +155,8 @@ var AppWorkflowsApi = exports["default"] = /*#__PURE__*/function () {
155
155
  }
156
156
 
157
157
  /**
158
- * list app workflows
159
- * This operation is list app workflows of app.
158
+ * List app workflows
159
+ * This operation retrieves all approval workflows of an Cobo Portal App. <Note>You need to [configure approval workflow](https://www.cobo.com/developers/v2/apps/configure-workflow) in the app Manifest file first.</Note> <Note>To use the approval workflow operations, you must use the Cobo OAuth authentication method ([Org Access Token](https://www.cobo.com/developers/v2/apps/org-access-tokens)).</Note>
160
160
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/AppWorkflow>}
161
161
  */
162
162
  }, {
@@ -169,8 +169,8 @@ var AppWorkflowsApi = exports["default"] = /*#__PURE__*/function () {
169
169
 
170
170
  /**
171
171
  * List approval requests
172
- * This operation is retrieves list approval requests from app workflow.
173
- * @param {String} operation_id The operation ID that is used to track a workflow. The operation ID is provided by you and must be unique within your app.
172
+ * This operation retrieves a list of approval requests. <Note>To use the approval workflow operations, you must use the Cobo OAuth authentication method ([Org Access Token](https://www.cobo.com/developers/v2/apps/org-access-tokens)).</Note>
173
+ * @param {String} operation_id The unique ID of the approval workflow.
174
174
  * @param {Object} opts Optional parameters
175
175
  * @param {Number} [limit = 10)] The maximum number of objects to return. For most operations, the value range is [1, 50].
176
176
  * @param {String} [before] A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response.
@@ -207,8 +207,8 @@ var AppWorkflowsApi = exports["default"] = /*#__PURE__*/function () {
207
207
 
208
208
  /**
209
209
  * List approval requests
210
- * This operation is retrieves list approval requests from app workflow.
211
- * @param {String} operation_id The operation ID that is used to track a workflow. The operation ID is provided by you and must be unique within your app.
210
+ * This operation retrieves a list of approval requests. <Note>To use the approval workflow operations, you must use the Cobo OAuth authentication method ([Org Access Token](https://www.cobo.com/developers/v2/apps/org-access-tokens)).</Note>
211
+ * @param {String} operation_id The unique ID of the approval workflow.
212
212
  * @param {Object} opts Optional parameters
213
213
  * @param {Number} opts.limit The maximum number of objects to return. For most operations, the value range is [1, 50]. (default to 10)
214
214
  * @param {String} opts.before A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response.
@@ -225,10 +225,10 @@ var AppWorkflowsApi = exports["default"] = /*#__PURE__*/function () {
225
225
 
226
226
  /**
227
227
  * Revoke approval request
228
- * This operation is revoke approval request from app workflow.
229
- * @param {String} approval_id The approval ID that is used to track a workflow approval request.
228
+ * This operation revokes a pending approval request. <Note>To use the approval workflow operations, you must use the Cobo OAuth authentication method ([Org Access Token](https://www.cobo.com/developers/v2/apps/org-access-tokens)).</Note>
229
+ * @param {String} approval_id The system-generated unique ID of the approval request.
230
230
  * @param {Object} opts Optional parameters
231
- * @param {module:model/RevokeApprovalRequestRequest} [RevokeApprovalRequestRequest] The revoke request body to app workflow approval.
231
+ * @param {module:model/RevokeApprovalRequestRequest} [RevokeApprovalRequestRequest] The request body to revoke an approval request.
232
232
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RevokeApprovalRequest201Response} and HTTP response
233
233
  */
234
234
  }, {
@@ -258,10 +258,10 @@ var AppWorkflowsApi = exports["default"] = /*#__PURE__*/function () {
258
258
 
259
259
  /**
260
260
  * Revoke approval request
261
- * This operation is revoke approval request from app workflow.
262
- * @param {String} approval_id The approval ID that is used to track a workflow approval request.
261
+ * This operation revokes a pending approval request. <Note>To use the approval workflow operations, you must use the Cobo OAuth authentication method ([Org Access Token](https://www.cobo.com/developers/v2/apps/org-access-tokens)).</Note>
262
+ * @param {String} approval_id The system-generated unique ID of the approval request.
263
263
  * @param {Object} opts Optional parameters
264
- * @param {module:model/RevokeApprovalRequestRequest} opts.RevokeApprovalRequestRequest The revoke request body to app workflow approval.
264
+ * @param {module:model/RevokeApprovalRequestRequest} opts.RevokeApprovalRequestRequest The request body to revoke an approval request.
265
265
  * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RevokeApprovalRequest201Response}
266
266
  */
267
267
  }, {
@@ -6,8 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports["default"] = void 0;
7
7
  var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
8
  var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
9
+ var _ExchangePermissionToken201Response = _interopRequireDefault(require("../model/ExchangePermissionToken201Response"));
10
+ var _ExchangePermissionTokenRequest = _interopRequireDefault(require("../model/ExchangePermissionTokenRequest"));
9
11
  var _GetToken2XXResponse = _interopRequireDefault(require("../model/GetToken2XXResponse"));
10
12
  var _GetToken4XXResponse = _interopRequireDefault(require("../model/GetToken4XXResponse"));
13
+ var _RefreshPermissionTokenRequest = _interopRequireDefault(require("../model/RefreshPermissionTokenRequest"));
11
14
  var _RefreshToken2XXResponse = _interopRequireDefault(require("../model/RefreshToken2XXResponse"));
12
15
  var _RefreshTokenRequest = _interopRequireDefault(require("../model/RefreshTokenRequest"));
13
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
@@ -44,14 +47,56 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
44
47
  }
45
48
 
46
49
  /**
47
- * Get Org Access Token
48
- * <Note>This operation is only applicable to Cobo Portal App developers. To call this operation, you need to use the Cobo OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to get an Org Access Token and a Refresh Token with a specified client ID, organization ID, and grant type. Access tokens allow the app to signal to the WaaS service that it has received permission to access specific resources of the app user's [organization](https://manuals.cobo.com/en/portal/organization/introduction). Once the app has been granted permission by the organization's admin, it can use this operation to obtain both an Org Access Token and a Refresh Token. For security purposes, Org Access Tokens expire after a certain period. Once they expire, the app needs to call [Refresh token](https://www.cobo.com/developers/v2/api-references/oauth/refresh-org-access-token) to get a new Org Access Token and a new Refresh Token.
49
- * @param {String} client_id The client ID, a unique identifier to distinguish Cobo Portal Apps. You can get the client ID by retrieving the manifest file after publishing the app.
50
- * @param {String} org_id Organization ID, a unique identifier to distinguish different organizations. You can get the organization ID from the callback message sent to the URL that was configured in the manifest file.
51
- * @param {String} grant_type The OAuth grant type. Set the value as `org_implicit`.
52
- * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetToken2XXResponse} and HTTP response
50
+ * Exchange Permission Access Token by API Key
51
+ * <Note>This operation is only applicable to Cobo Portal Checkout SDK developers. To call this operation, you need to use the Cobo OAuth authentication method that requires an api key.</Note> This operation allows Portal Checkout SDK to obtain a new Permission Access Token with a specified client ID, grant type and a Permission Refresh Token. For security purposes, Permission Access Tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new Permission Access Token and a new Permission Refresh Token.
52
+ * @param {module:model/ExchangePermissionTokenRequest} ExchangePermissionTokenRequest The request body for exchanging an Permission Access Token.
53
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ExchangePermissionToken201Response} and HTTP response
53
54
  */
54
55
  return _createClass(OAuthApi, [{
56
+ key: "exchangePermissionTokenWithHttpInfo",
57
+ value: function exchangePermissionTokenWithHttpInfo(ExchangePermissionTokenRequest) {
58
+ var postBody = ExchangePermissionTokenRequest;
59
+ if (postBody && postBody.toJSON) {
60
+ postBody = postBody.toJSON();
61
+ }
62
+ // verify the required parameter 'ExchangePermissionTokenRequest' is set
63
+ if (ExchangePermissionTokenRequest === undefined || ExchangePermissionTokenRequest === null) {
64
+ throw new Error("Missing the required parameter 'ExchangePermissionTokenRequest' when calling exchangePermissionToken");
65
+ }
66
+ var pathParams = {};
67
+ var queryParams = {};
68
+ var headerParams = {};
69
+ var formParams = {};
70
+ var authNames = ['CoboAuth'];
71
+ var contentTypes = ['application/json'];
72
+ var accepts = ['application/json'];
73
+ var returnType = _ExchangePermissionToken201Response["default"];
74
+ return this.apiClient.callApi('/oauth/permission_token/exchange', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
75
+ }
76
+
77
+ /**
78
+ * Exchange Permission Access Token by API Key
79
+ * <Note>This operation is only applicable to Cobo Portal Checkout SDK developers. To call this operation, you need to use the Cobo OAuth authentication method that requires an api key.</Note> This operation allows Portal Checkout SDK to obtain a new Permission Access Token with a specified client ID, grant type and a Permission Refresh Token. For security purposes, Permission Access Tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new Permission Access Token and a new Permission Refresh Token.
80
+ * @param {module:model/ExchangePermissionTokenRequest} ExchangePermissionTokenRequest The request body for exchanging an Permission Access Token.
81
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ExchangePermissionToken201Response}
82
+ */
83
+ }, {
84
+ key: "exchangePermissionToken",
85
+ value: function exchangePermissionToken(ExchangePermissionTokenRequest) {
86
+ return this.exchangePermissionTokenWithHttpInfo(ExchangePermissionTokenRequest).then(function (response_and_data) {
87
+ return response_and_data.data;
88
+ });
89
+ }
90
+
91
+ /**
92
+ * Get Org Access Token
93
+ * <Note>This operation is only applicable to Cobo Portal App developers. To call this operation, you need to use the Cobo OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to get an Org Access Token and a Refresh Token with a specified client ID, organization ID, and grant type. Access tokens allow the app to signal to the WaaS service that it has received permission to access specific resources of the app user's [organization](https://manuals.cobo.com/en/portal/organization/introduction). Once the app has been granted permission by the organization's admin, it can use this operation to obtain both an Org Access Token and a Refresh Token. For security purposes, Org Access Tokens expire after a certain period. Once they expire, the app needs to call [Refresh token](https://www.cobo.com/developers/v2/api-references/oauth/refresh-org-access-token) to get a new Org Access Token and a new Refresh Token.
94
+ * @param {String} client_id The client ID, a unique identifier to distinguish Cobo Portal Apps. You can get the client ID by retrieving the manifest file after publishing the app.
95
+ * @param {String} org_id Organization ID, a unique identifier to distinguish different organizations. You can get the organization ID from the callback message sent to the URL that was configured in the manifest file.
96
+ * @param {String} grant_type The OAuth grant type. Set the value as `org_implicit`.
97
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetToken2XXResponse} and HTTP response
98
+ */
99
+ }, {
55
100
  key: "getTokenWithHttpInfo",
56
101
  value: function getTokenWithHttpInfo(client_id, org_id, grant_type) {
57
102
  var postBody = null;
@@ -101,6 +146,48 @@ var OAuthApi = exports["default"] = /*#__PURE__*/function () {
101
146
  });
102
147
  }
103
148
 
149
+ /**
150
+ * Refresh Permission Access Token by Permission Refresh Token
151
+ * <Note>This operation is only applicable to Cobo Portal Checkout SDK developers. To call this operation, you need to use the Cobo OAuth authentication method that requires an api key.</Note> This operation allows Portal Checkout SDK to refresh a new Permission Access Token with a specified client ID, grant type and a Permission Refresh Token. For security purposes, Permission Access Tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new Permission Access Token and a new Permission Refresh Token.
152
+ * @param {module:model/RefreshPermissionTokenRequest} RefreshPermissionTokenRequest The request body for refreshing an Permission Access Token.
153
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ExchangePermissionToken201Response} and HTTP response
154
+ */
155
+ }, {
156
+ key: "refreshPermissionTokenWithHttpInfo",
157
+ value: function refreshPermissionTokenWithHttpInfo(RefreshPermissionTokenRequest) {
158
+ var postBody = RefreshPermissionTokenRequest;
159
+ if (postBody && postBody.toJSON) {
160
+ postBody = postBody.toJSON();
161
+ }
162
+ // verify the required parameter 'RefreshPermissionTokenRequest' is set
163
+ if (RefreshPermissionTokenRequest === undefined || RefreshPermissionTokenRequest === null) {
164
+ throw new Error("Missing the required parameter 'RefreshPermissionTokenRequest' when calling refreshPermissionToken");
165
+ }
166
+ var pathParams = {};
167
+ var queryParams = {};
168
+ var headerParams = {};
169
+ var formParams = {};
170
+ var authNames = ['CoboAuth'];
171
+ var contentTypes = ['application/json'];
172
+ var accepts = ['application/json'];
173
+ var returnType = _ExchangePermissionToken201Response["default"];
174
+ return this.apiClient.callApi('/oauth/permission_token/refresh', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
175
+ }
176
+
177
+ /**
178
+ * Refresh Permission Access Token by Permission Refresh Token
179
+ * <Note>This operation is only applicable to Cobo Portal Checkout SDK developers. To call this operation, you need to use the Cobo OAuth authentication method that requires an api key.</Note> This operation allows Portal Checkout SDK to refresh a new Permission Access Token with a specified client ID, grant type and a Permission Refresh Token. For security purposes, Permission Access Tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new Permission Access Token and a new Permission Refresh Token.
180
+ * @param {module:model/RefreshPermissionTokenRequest} RefreshPermissionTokenRequest The request body for refreshing an Permission Access Token.
181
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ExchangePermissionToken201Response}
182
+ */
183
+ }, {
184
+ key: "refreshPermissionToken",
185
+ value: function refreshPermissionToken(RefreshPermissionTokenRequest) {
186
+ return this.refreshPermissionTokenWithHttpInfo(RefreshPermissionTokenRequest).then(function (response_and_data) {
187
+ return response_and_data.data;
188
+ });
189
+ }
190
+
104
191
  /**
105
192
  * Refresh Org Access Token
106
193
  * <Note>This operation is only applicable to Cobo Portal Apps developers. To call this operation, you need to use the Cobo OAuth authentication method that requires an app key.</Note> This operation allows Cobo Portal Apps to obtain a new Org Access Token with a specified client ID, grant type and a Refresh Token. For security purposes, Org Access Tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new Org Access Token and a new Refresh Token.