@cobo/cobo-waas2 1.15.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 (140) hide show
  1. package/README.md +42 -6
  2. package/dist/ApiClient.js +1 -1
  3. package/dist/PreRequestScript.js +27 -33
  4. package/dist/api/AddressBooksApi.js +4 -4
  5. package/dist/api/AppWorkflowsApi.js +275 -0
  6. package/dist/api/DevelopersApi.js +4 -4
  7. package/dist/api/DevelopersWebhooksApi.js +12 -12
  8. package/dist/api/FeeStationApi.js +12 -12
  9. package/dist/api/OAuthApi.js +93 -6
  10. package/dist/api/PaymentApi.js +107 -161
  11. package/dist/api/StakingsApi.js +28 -28
  12. package/dist/api/TransactionsApi.js +4 -4
  13. package/dist/api/WalletsApi.js +102 -51
  14. package/dist/api/WalletsExchangeWalletApi.js +8 -8
  15. package/dist/api/WalletsMPCWalletsApi.js +20 -20
  16. package/dist/index.js +224 -14
  17. package/dist/model/AppWorkflow.js +173 -0
  18. package/dist/model/AppWorkflowField.js +137 -0
  19. package/dist/model/AppWorkflowPolicy.js +144 -0
  20. package/dist/model/ApprovalEntry.js +148 -0
  21. package/dist/model/ApprovalRequest.js +180 -0
  22. package/dist/model/ApprovalRequestDetail.js +177 -0
  23. package/dist/model/ApprovalStatus.js +71 -0
  24. package/dist/model/ApprovalUser.js +146 -0
  25. package/dist/model/BabylonStakeExtra.js +16 -0
  26. package/dist/model/BatchCheckUtxo201Response.js +107 -0
  27. package/dist/model/BatchCheckUtxoRequest.js +142 -0
  28. package/dist/model/{CreateBankAccountRequest.js → BatchUTXOParam.js} +43 -28
  29. package/dist/model/ChainInfo.js +9 -0
  30. package/dist/model/CreateApprovalRequest201Response.js +110 -0
  31. package/dist/model/CreatePaymentOrderRequest.js +5 -5
  32. package/dist/model/CreateRefundRequest.js +35 -0
  33. package/dist/model/CreateSettlement.js +39 -29
  34. package/dist/model/CreateStakeActivityExtra.js +6 -0
  35. package/dist/model/CryptoAddress.js +171 -0
  36. package/dist/model/{OrderAddressInfo.js → CustodialTransferDestination.js} +36 -46
  37. package/dist/model/CustodialWeb3TransferSource.js +1 -1
  38. package/dist/model/EstimateContractCallFeeParams.js +13 -0
  39. package/dist/model/EstimateFeeParams.js +6 -0
  40. package/dist/model/EstimateTransferFeeParams.js +13 -0
  41. package/dist/model/ExchangePermissionToken201Response.js +122 -0
  42. package/dist/model/ExchangePermissionTokenRequest.js +110 -0
  43. package/dist/model/ListApprovalRequests200Response.js +123 -0
  44. package/dist/model/MpcTransferSource.js +1 -1
  45. package/dist/model/Order.js +4 -4
  46. package/dist/model/PaymentOrderEventData.js +6 -6
  47. package/dist/model/PayoutChannel.js +61 -0
  48. package/dist/model/PolicyAction.js +123 -0
  49. package/dist/model/PolicyActionContent.js +169 -0
  50. package/dist/model/PolicyActionType.js +66 -0
  51. package/dist/model/PolicyCondition.js +148 -0
  52. package/dist/model/PolicyFieldOperator.js +76 -0
  53. package/dist/model/PolicyFieldValueType.js +61 -0
  54. package/dist/model/RefreshPermissionTokenRequest.js +110 -0
  55. package/dist/model/RequestApproval.js +188 -0
  56. package/dist/model/RevokeApprovalRequest201Response.js +119 -0
  57. package/dist/model/RevokeApprovalRequestRequest.js +110 -0
  58. package/dist/model/SettlementDetail.js +22 -0
  59. package/dist/model/SupportedToken.js +222 -0
  60. package/dist/model/SwapActivityApprovers.js +122 -0
  61. package/dist/model/SwapActivityDetail.js +30 -0
  62. package/dist/model/SwapApproversStatus.js +66 -0
  63. package/dist/model/TransactionCoboCategory.js +102 -7
  64. package/dist/model/TransactionDestination.js +4 -0
  65. package/dist/model/TransactionDestinationType.js +5 -0
  66. package/dist/model/TransactionRbfSource.js +1 -1
  67. package/dist/model/TransactionSubStatus.js +10 -0
  68. package/dist/model/TransactionTransferToWalletDestination.js +2 -2
  69. package/dist/model/TransferDestination.js +42 -14
  70. package/dist/model/TransferDestinationType.js +5 -0
  71. package/dist/model/UTXO.js +9 -0
  72. package/docs/AddressBooksApi.md +2 -2
  73. package/docs/AppWorkflow.md +12 -0
  74. package/docs/AppWorkflowField.md +11 -0
  75. package/docs/AppWorkflowPolicy.md +10 -0
  76. package/docs/AppWorkflowsApi.md +273 -0
  77. package/docs/ApprovalEntry.md +11 -0
  78. package/docs/ApprovalRequest.md +13 -0
  79. package/docs/ApprovalRequestDetail.md +13 -0
  80. package/docs/ApprovalStatus.md +16 -0
  81. package/docs/ApprovalUser.md +12 -0
  82. package/docs/BabylonStakeExtra.md +1 -0
  83. package/docs/BatchCheckUtxo201Response.md +9 -0
  84. package/docs/BatchCheckUtxoRequest.md +10 -0
  85. package/docs/BatchUTXOParam.md +10 -0
  86. package/docs/ChainInfo.md +1 -0
  87. package/docs/CreateApprovalRequest201Response.md +9 -0
  88. package/docs/CreatePaymentOrderRequest.md +1 -1
  89. package/docs/CreateRefundRequest.md +3 -0
  90. package/docs/CreateSettlement.md +5 -2
  91. package/docs/CreateStakeActivityExtra.md +1 -0
  92. package/docs/CryptoAddress.md +14 -0
  93. package/docs/CustodialTransferDestination.md +11 -0
  94. package/docs/CustodialWeb3TransferSource.md +1 -1
  95. package/docs/DevelopersApi.md +2 -2
  96. package/docs/DevelopersWebhooksApi.md +6 -6
  97. package/docs/EstimateContractCallFeeParams.md +1 -0
  98. package/docs/EstimateFeeParams.md +1 -0
  99. package/docs/EstimateTransferFeeParams.md +1 -0
  100. package/docs/ExchangePermissionToken201Response.md +12 -0
  101. package/docs/ExchangePermissionTokenRequest.md +9 -0
  102. package/docs/FeeStationApi.md +6 -6
  103. package/docs/ListApprovalRequests200Response.md +10 -0
  104. package/docs/MpcTransferSource.md +1 -1
  105. package/docs/OAuthApi.md +102 -0
  106. package/docs/Order.md +2 -2
  107. package/docs/PaymentApi.md +86 -147
  108. package/docs/PaymentOrderEventData.md +2 -2
  109. package/docs/PayoutChannel.md +12 -0
  110. package/docs/PolicyAction.md +10 -0
  111. package/docs/PolicyActionContent.md +25 -0
  112. package/docs/PolicyActionType.md +14 -0
  113. package/docs/PolicyCondition.md +12 -0
  114. package/docs/PolicyFieldOperator.md +18 -0
  115. package/docs/PolicyFieldValueType.md +12 -0
  116. package/docs/RefreshPermissionTokenRequest.md +9 -0
  117. package/docs/RequestApproval.md +13 -0
  118. package/docs/RevokeApprovalRequest201Response.md +10 -0
  119. package/docs/RevokeApprovalRequestRequest.md +9 -0
  120. package/docs/SettlementDetail.md +2 -0
  121. package/docs/StakingsApi.md +14 -14
  122. package/docs/SupportedToken.md +17 -0
  123. package/docs/SwapActivityApprovers.md +10 -0
  124. package/docs/SwapActivityDetail.md +1 -0
  125. package/docs/SwapApproversStatus.md +14 -0
  126. package/docs/TransactionCoboCategory.md +41 -3
  127. package/docs/TransactionDestinationType.md +2 -0
  128. package/docs/TransactionRbfSource.md +1 -1
  129. package/docs/TransactionSubStatus.md +4 -0
  130. package/docs/TransactionTransferToWalletDestination.md +1 -1
  131. package/docs/TransactionsApi.md +2 -2
  132. package/docs/TransferDestination.md +1 -1
  133. package/docs/TransferDestinationType.md +2 -0
  134. package/docs/UTXO.md +1 -0
  135. package/docs/WalletsApi.md +78 -23
  136. package/docs/WalletsExchangeWalletApi.md +4 -4
  137. package/docs/WalletsMPCWalletsApi.md +10 -10
  138. package/package.json +1 -1
  139. package/docs/CreateBankAccountRequest.md +0 -9
  140. package/docs/OrderAddressInfo.md +0 -12
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _PolicyFieldValueType = _interopRequireDefault(require("./PolicyFieldValueType"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13
+ 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; }
14
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19
+ * Cobo Wallet as a Service 2.0
20
+ *
21
+ * Contact: help@cobo.com
22
+ *
23
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24
+ * https://openapi-generator.tech
25
+ * Do not edit the class manually.
26
+ *
27
+ */
28
+ /**
29
+ * The AppWorkflowField model module.
30
+ * @module model/AppWorkflowField
31
+ */
32
+ var AppWorkflowField = /*#__PURE__*/function () {
33
+ /**
34
+ * Constructs a new <code>AppWorkflowField</code>.
35
+ * The information of a workflow field.
36
+ * @alias module:model/AppWorkflowField
37
+ * @param field {String} The workflow field name.
38
+ * @param value_type {module:model/PolicyFieldValueType}
39
+ * @param value {String} The workflow field value.
40
+ */
41
+ function AppWorkflowField(field, value_type, value) {
42
+ _classCallCheck(this, AppWorkflowField);
43
+ AppWorkflowField.initialize(this, field, value_type, value);
44
+ }
45
+
46
+ /**
47
+ * Initializes the fields of this object.
48
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49
+ * Only for internal use.
50
+ */
51
+ return _createClass(AppWorkflowField, null, [{
52
+ key: "initialize",
53
+ value: function initialize(obj, field, value_type, value) {
54
+ obj['field'] = field;
55
+ obj['value_type'] = value_type;
56
+ obj['value'] = value;
57
+ }
58
+
59
+ /**
60
+ * Constructs a <code>AppWorkflowField</code> from a plain JavaScript object, optionally creating a new instance.
61
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
62
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
63
+ * @param {module:model/AppWorkflowField} obj Optional instance to populate.
64
+ * @return {module:model/AppWorkflowField} The populated <code>AppWorkflowField</code> instance.
65
+ */
66
+ }, {
67
+ key: "constructFromObject",
68
+ value: function constructFromObject(data, obj) {
69
+ if (data) {
70
+ obj = obj || new AppWorkflowField();
71
+ if (data.hasOwnProperty('field')) {
72
+ obj['field'] = _ApiClient["default"].convertToType(data['field'], 'String');
73
+ }
74
+ if (data.hasOwnProperty('value_type')) {
75
+ obj['value_type'] = _PolicyFieldValueType["default"].constructFromObject(data['value_type']);
76
+ }
77
+ if (data.hasOwnProperty('value')) {
78
+ obj['value'] = _ApiClient["default"].convertToType(data['value'], 'String');
79
+ }
80
+ }
81
+ return obj;
82
+ }
83
+
84
+ /**
85
+ * Validates the JSON data with respect to <code>AppWorkflowField</code>.
86
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
87
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>AppWorkflowField</code>.
88
+ */
89
+ }, {
90
+ key: "validateJSON",
91
+ value: function validateJSON(data) {
92
+ // check to make sure all required properties are present in the JSON string
93
+ var _iterator = _createForOfIteratorHelper(AppWorkflowField.RequiredProperties),
94
+ _step;
95
+ try {
96
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
97
+ var property = _step.value;
98
+ if (!data.hasOwnProperty(property)) {
99
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
100
+ }
101
+ }
102
+ // ensure the json data is a string
103
+ } catch (err) {
104
+ _iterator.e(err);
105
+ } finally {
106
+ _iterator.f();
107
+ }
108
+ if (data['field'] && !(typeof data['field'] === 'string' || data['field'] instanceof String)) {
109
+ throw new Error("Expected the field `field` to be a primitive type in the JSON string but got " + data['field']);
110
+ }
111
+ // ensure the json data is a string
112
+ if (data['value'] && !(typeof data['value'] === 'string' || data['value'] instanceof String)) {
113
+ throw new Error("Expected the field `value` to be a primitive type in the JSON string but got " + data['value']);
114
+ }
115
+ return true;
116
+ }
117
+ }]);
118
+ }();
119
+ AppWorkflowField.RequiredProperties = ["field", "value_type", "value"];
120
+
121
+ /**
122
+ * The workflow field name.
123
+ * @member {String} field
124
+ */
125
+ AppWorkflowField.prototype['field'] = undefined;
126
+
127
+ /**
128
+ * @member {module:model/PolicyFieldValueType} value_type
129
+ */
130
+ AppWorkflowField.prototype['value_type'] = undefined;
131
+
132
+ /**
133
+ * The workflow field value.
134
+ * @member {String} value
135
+ */
136
+ AppWorkflowField.prototype['value'] = undefined;
137
+ var _default = exports["default"] = AppWorkflowField;
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _PolicyAction = _interopRequireDefault(require("./PolicyAction"));
9
+ var _PolicyCondition = _interopRequireDefault(require("./PolicyCondition"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
13
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
14
+ 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; }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
17
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
20
+ * Cobo Wallet as a Service 2.0
21
+ *
22
+ * Contact: help@cobo.com
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The AppWorkflowPolicy model module.
31
+ * @module model/AppWorkflowPolicy
32
+ */
33
+ var AppWorkflowPolicy = /*#__PURE__*/function () {
34
+ /**
35
+ * Constructs a new <code>AppWorkflowPolicy</code>.
36
+ * The current approval workflow policy, consisting of one or more conditions and an associated action. When the conditions are met, the action is triggered.
37
+ * @alias module:model/AppWorkflowPolicy
38
+ * @param action {module:model/PolicyAction}
39
+ */
40
+ function AppWorkflowPolicy(action) {
41
+ _classCallCheck(this, AppWorkflowPolicy);
42
+ AppWorkflowPolicy.initialize(this, action);
43
+ }
44
+
45
+ /**
46
+ * Initializes the fields of this object.
47
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
48
+ * Only for internal use.
49
+ */
50
+ return _createClass(AppWorkflowPolicy, null, [{
51
+ key: "initialize",
52
+ value: function initialize(obj, action) {
53
+ obj['action'] = action;
54
+ }
55
+
56
+ /**
57
+ * Constructs a <code>AppWorkflowPolicy</code> from a plain JavaScript object, optionally creating a new instance.
58
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
59
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
60
+ * @param {module:model/AppWorkflowPolicy} obj Optional instance to populate.
61
+ * @return {module:model/AppWorkflowPolicy} The populated <code>AppWorkflowPolicy</code> instance.
62
+ */
63
+ }, {
64
+ key: "constructFromObject",
65
+ value: function constructFromObject(data, obj) {
66
+ if (data) {
67
+ obj = obj || new AppWorkflowPolicy();
68
+ if (data.hasOwnProperty('action')) {
69
+ obj['action'] = _PolicyAction["default"].constructFromObject(data['action']);
70
+ }
71
+ if (data.hasOwnProperty('conditions')) {
72
+ obj['conditions'] = _ApiClient["default"].convertToType(data['conditions'], [_PolicyCondition["default"]]);
73
+ }
74
+ }
75
+ return obj;
76
+ }
77
+
78
+ /**
79
+ * Validates the JSON data with respect to <code>AppWorkflowPolicy</code>.
80
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
81
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>AppWorkflowPolicy</code>.
82
+ */
83
+ }, {
84
+ key: "validateJSON",
85
+ value: function validateJSON(data) {
86
+ // check to make sure all required properties are present in the JSON string
87
+ var _iterator = _createForOfIteratorHelper(AppWorkflowPolicy.RequiredProperties),
88
+ _step;
89
+ try {
90
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
91
+ var property = _step.value;
92
+ if (!data.hasOwnProperty(property)) {
93
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
94
+ }
95
+ }
96
+ // validate the optional field `action`
97
+ } catch (err) {
98
+ _iterator.e(err);
99
+ } finally {
100
+ _iterator.f();
101
+ }
102
+ if (data['action']) {
103
+ // data not null
104
+ if (!!_PolicyAction["default"].validateJSON) {
105
+ _PolicyAction["default"].validateJSON(data['action']);
106
+ }
107
+ }
108
+ if (data['conditions']) {
109
+ // data not null
110
+ // ensure the json data is an array
111
+ if (!Array.isArray(data['conditions'])) {
112
+ throw new Error("Expected the field `conditions` to be an array in the JSON data but got " + data['conditions']);
113
+ }
114
+ // validate the optional field `conditions` (array)
115
+ var _iterator2 = _createForOfIteratorHelper(data['conditions']),
116
+ _step2;
117
+ try {
118
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
119
+ var item = _step2.value;
120
+ _PolicyCondition["default"].validateJSON(item);
121
+ }
122
+ } catch (err) {
123
+ _iterator2.e(err);
124
+ } finally {
125
+ _iterator2.f();
126
+ }
127
+ ;
128
+ }
129
+ return true;
130
+ }
131
+ }]);
132
+ }();
133
+ AppWorkflowPolicy.RequiredProperties = ["action"];
134
+
135
+ /**
136
+ * @member {module:model/PolicyAction} action
137
+ */
138
+ AppWorkflowPolicy.prototype['action'] = undefined;
139
+
140
+ /**
141
+ * @member {Array.<module:model/PolicyCondition>} conditions
142
+ */
143
+ AppWorkflowPolicy.prototype['conditions'] = undefined;
144
+ var _default = exports["default"] = AppWorkflowPolicy;
@@ -0,0 +1,148 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _ApprovalStatus = _interopRequireDefault(require("./ApprovalStatus"));
9
+ var _ApprovalUser = _interopRequireDefault(require("./ApprovalUser"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
13
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
14
+ 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; }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
17
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
20
+ * Cobo Wallet as a Service 2.0
21
+ *
22
+ * Contact: help@cobo.com
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The ApprovalEntry model module.
31
+ * @module model/ApprovalEntry
32
+ */
33
+ var ApprovalEntry = /*#__PURE__*/function () {
34
+ /**
35
+ * Constructs a new <code>ApprovalEntry</code>.
36
+ * The information of an approval request.
37
+ * @alias module:model/ApprovalEntry
38
+ * @param status {module:model/ApprovalStatus}
39
+ * @param created_timestamp {Number} The time when the approval was created, in Unix timestamp format, measured in milliseconds.
40
+ */
41
+ function ApprovalEntry(status, created_timestamp) {
42
+ _classCallCheck(this, ApprovalEntry);
43
+ ApprovalEntry.initialize(this, status, created_timestamp);
44
+ }
45
+
46
+ /**
47
+ * Initializes the fields of this object.
48
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49
+ * Only for internal use.
50
+ */
51
+ return _createClass(ApprovalEntry, null, [{
52
+ key: "initialize",
53
+ value: function initialize(obj, status, created_timestamp) {
54
+ obj['status'] = status;
55
+ obj['created_timestamp'] = created_timestamp;
56
+ }
57
+
58
+ /**
59
+ * Constructs a <code>ApprovalEntry</code> from a plain JavaScript object, optionally creating a new instance.
60
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
61
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
62
+ * @param {module:model/ApprovalEntry} obj Optional instance to populate.
63
+ * @return {module:model/ApprovalEntry} The populated <code>ApprovalEntry</code> instance.
64
+ */
65
+ }, {
66
+ key: "constructFromObject",
67
+ value: function constructFromObject(data, obj) {
68
+ if (data) {
69
+ obj = obj || new ApprovalEntry();
70
+ if (data.hasOwnProperty('status')) {
71
+ obj['status'] = _ApprovalStatus["default"].constructFromObject(data['status']);
72
+ }
73
+ if (data.hasOwnProperty('created_timestamp')) {
74
+ obj['created_timestamp'] = _ApiClient["default"].convertToType(data['created_timestamp'], 'Number');
75
+ }
76
+ if (data.hasOwnProperty('approval_users')) {
77
+ obj['approval_users'] = _ApiClient["default"].convertToType(data['approval_users'], [_ApprovalUser["default"]]);
78
+ }
79
+ }
80
+ return obj;
81
+ }
82
+
83
+ /**
84
+ * Validates the JSON data with respect to <code>ApprovalEntry</code>.
85
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
86
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ApprovalEntry</code>.
87
+ */
88
+ }, {
89
+ key: "validateJSON",
90
+ value: function validateJSON(data) {
91
+ // check to make sure all required properties are present in the JSON string
92
+ var _iterator = _createForOfIteratorHelper(ApprovalEntry.RequiredProperties),
93
+ _step;
94
+ try {
95
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
96
+ var property = _step.value;
97
+ if (!data.hasOwnProperty(property)) {
98
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
99
+ }
100
+ }
101
+ } catch (err) {
102
+ _iterator.e(err);
103
+ } finally {
104
+ _iterator.f();
105
+ }
106
+ if (data['approval_users']) {
107
+ // data not null
108
+ // ensure the json data is an array
109
+ if (!Array.isArray(data['approval_users'])) {
110
+ throw new Error("Expected the field `approval_users` to be an array in the JSON data but got " + data['approval_users']);
111
+ }
112
+ // validate the optional field `approval_users` (array)
113
+ var _iterator2 = _createForOfIteratorHelper(data['approval_users']),
114
+ _step2;
115
+ try {
116
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
117
+ var item = _step2.value;
118
+ _ApprovalUser["default"].validateJSON(item);
119
+ }
120
+ } catch (err) {
121
+ _iterator2.e(err);
122
+ } finally {
123
+ _iterator2.f();
124
+ }
125
+ ;
126
+ }
127
+ return true;
128
+ }
129
+ }]);
130
+ }();
131
+ ApprovalEntry.RequiredProperties = ["status", "created_timestamp"];
132
+
133
+ /**
134
+ * @member {module:model/ApprovalStatus} status
135
+ */
136
+ ApprovalEntry.prototype['status'] = undefined;
137
+
138
+ /**
139
+ * The time when the approval was created, in Unix timestamp format, measured in milliseconds.
140
+ * @member {Number} created_timestamp
141
+ */
142
+ ApprovalEntry.prototype['created_timestamp'] = undefined;
143
+
144
+ /**
145
+ * @member {Array.<module:model/ApprovalUser>} approval_users
146
+ */
147
+ ApprovalEntry.prototype['approval_users'] = undefined;
148
+ var _default = exports["default"] = ApprovalEntry;
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8
+ var _AppWorkflowField = _interopRequireDefault(require("./AppWorkflowField"));
9
+ var _ApprovalStatus = _interopRequireDefault(require("./ApprovalStatus"));
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
13
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
14
+ 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; }
15
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
16
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
17
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
19
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
20
+ * Cobo Wallet as a Service 2.0
21
+ *
22
+ * Contact: help@cobo.com
23
+ *
24
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25
+ * https://openapi-generator.tech
26
+ * Do not edit the class manually.
27
+ *
28
+ */
29
+ /**
30
+ * The ApprovalRequest model module.
31
+ * @module model/ApprovalRequest
32
+ */
33
+ var ApprovalRequest = /*#__PURE__*/function () {
34
+ /**
35
+ * Constructs a new <code>ApprovalRequest</code>.
36
+ * The information of an approval request.
37
+ * @alias module:model/ApprovalRequest
38
+ * @param approval_id {String} The system-generated unique ID of the approval request.
39
+ * @param request_id {String} An identifier provided by you when requesting the approval.
40
+ * @param fields {Array.<module:model/AppWorkflowField>}
41
+ * @param status {module:model/ApprovalStatus}
42
+ * @param initiated_timestamp {Number} The time when the approval was initiated, in Unix timestamp format, measured in milliseconds.
43
+ */
44
+ function ApprovalRequest(approval_id, request_id, fields, status, initiated_timestamp) {
45
+ _classCallCheck(this, ApprovalRequest);
46
+ ApprovalRequest.initialize(this, approval_id, request_id, fields, status, initiated_timestamp);
47
+ }
48
+
49
+ /**
50
+ * Initializes the fields of this object.
51
+ * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
52
+ * Only for internal use.
53
+ */
54
+ return _createClass(ApprovalRequest, null, [{
55
+ key: "initialize",
56
+ value: function initialize(obj, approval_id, request_id, fields, status, initiated_timestamp) {
57
+ obj['approval_id'] = approval_id;
58
+ obj['request_id'] = request_id;
59
+ obj['fields'] = fields;
60
+ obj['status'] = status;
61
+ obj['initiated_timestamp'] = initiated_timestamp;
62
+ }
63
+
64
+ /**
65
+ * Constructs a <code>ApprovalRequest</code> from a plain JavaScript object, optionally creating a new instance.
66
+ * Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
67
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
68
+ * @param {module:model/ApprovalRequest} obj Optional instance to populate.
69
+ * @return {module:model/ApprovalRequest} The populated <code>ApprovalRequest</code> instance.
70
+ */
71
+ }, {
72
+ key: "constructFromObject",
73
+ value: function constructFromObject(data, obj) {
74
+ if (data) {
75
+ obj = obj || new ApprovalRequest();
76
+ if (data.hasOwnProperty('approval_id')) {
77
+ obj['approval_id'] = _ApiClient["default"].convertToType(data['approval_id'], 'String');
78
+ }
79
+ if (data.hasOwnProperty('request_id')) {
80
+ obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
81
+ }
82
+ if (data.hasOwnProperty('fields')) {
83
+ obj['fields'] = _ApiClient["default"].convertToType(data['fields'], [_AppWorkflowField["default"]]);
84
+ }
85
+ if (data.hasOwnProperty('status')) {
86
+ obj['status'] = _ApprovalStatus["default"].constructFromObject(data['status']);
87
+ }
88
+ if (data.hasOwnProperty('initiated_timestamp')) {
89
+ obj['initiated_timestamp'] = _ApiClient["default"].convertToType(data['initiated_timestamp'], 'Number');
90
+ }
91
+ }
92
+ return obj;
93
+ }
94
+
95
+ /**
96
+ * Validates the JSON data with respect to <code>ApprovalRequest</code>.
97
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
98
+ * @return {boolean} to indicate whether the JSON data is valid with respect to <code>ApprovalRequest</code>.
99
+ */
100
+ }, {
101
+ key: "validateJSON",
102
+ value: function validateJSON(data) {
103
+ // check to make sure all required properties are present in the JSON string
104
+ var _iterator = _createForOfIteratorHelper(ApprovalRequest.RequiredProperties),
105
+ _step;
106
+ try {
107
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
108
+ var property = _step.value;
109
+ if (!data.hasOwnProperty(property)) {
110
+ throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
111
+ }
112
+ }
113
+ // ensure the json data is a string
114
+ } catch (err) {
115
+ _iterator.e(err);
116
+ } finally {
117
+ _iterator.f();
118
+ }
119
+ if (data['approval_id'] && !(typeof data['approval_id'] === 'string' || data['approval_id'] instanceof String)) {
120
+ throw new Error("Expected the field `approval_id` to be a primitive type in the JSON string but got " + data['approval_id']);
121
+ }
122
+ // ensure the json data is a string
123
+ if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
124
+ throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
125
+ }
126
+ if (data['fields']) {
127
+ // data not null
128
+ // ensure the json data is an array
129
+ if (!Array.isArray(data['fields'])) {
130
+ throw new Error("Expected the field `fields` to be an array in the JSON data but got " + data['fields']);
131
+ }
132
+ // validate the optional field `fields` (array)
133
+ var _iterator2 = _createForOfIteratorHelper(data['fields']),
134
+ _step2;
135
+ try {
136
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
137
+ var item = _step2.value;
138
+ _AppWorkflowField["default"].validateJSON(item);
139
+ }
140
+ } catch (err) {
141
+ _iterator2.e(err);
142
+ } finally {
143
+ _iterator2.f();
144
+ }
145
+ ;
146
+ }
147
+ return true;
148
+ }
149
+ }]);
150
+ }();
151
+ ApprovalRequest.RequiredProperties = ["approval_id", "request_id", "fields", "status", "initiated_timestamp"];
152
+
153
+ /**
154
+ * The system-generated unique ID of the approval request.
155
+ * @member {String} approval_id
156
+ */
157
+ ApprovalRequest.prototype['approval_id'] = undefined;
158
+
159
+ /**
160
+ * An identifier provided by you when requesting the approval.
161
+ * @member {String} request_id
162
+ */
163
+ ApprovalRequest.prototype['request_id'] = undefined;
164
+
165
+ /**
166
+ * @member {Array.<module:model/AppWorkflowField>} fields
167
+ */
168
+ ApprovalRequest.prototype['fields'] = undefined;
169
+
170
+ /**
171
+ * @member {module:model/ApprovalStatus} status
172
+ */
173
+ ApprovalRequest.prototype['status'] = undefined;
174
+
175
+ /**
176
+ * The time when the approval was initiated, in Unix timestamp format, measured in milliseconds.
177
+ * @member {Number} initiated_timestamp
178
+ */
179
+ ApprovalRequest.prototype['initiated_timestamp'] = undefined;
180
+ var _default = exports["default"] = ApprovalRequest;