@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.
- package/README.md +42 -6
- package/dist/ApiClient.js +1 -1
- package/dist/PreRequestScript.js +27 -33
- package/dist/api/AddressBooksApi.js +4 -4
- package/dist/api/AppWorkflowsApi.js +275 -0
- package/dist/api/DevelopersApi.js +4 -4
- package/dist/api/DevelopersWebhooksApi.js +12 -12
- package/dist/api/FeeStationApi.js +12 -12
- package/dist/api/OAuthApi.js +93 -6
- package/dist/api/PaymentApi.js +107 -161
- package/dist/api/StakingsApi.js +28 -28
- package/dist/api/TransactionsApi.js +4 -4
- package/dist/api/WalletsApi.js +102 -51
- package/dist/api/WalletsExchangeWalletApi.js +8 -8
- package/dist/api/WalletsMPCWalletsApi.js +20 -20
- package/dist/index.js +224 -14
- package/dist/model/AppWorkflow.js +173 -0
- package/dist/model/AppWorkflowField.js +137 -0
- package/dist/model/AppWorkflowPolicy.js +144 -0
- package/dist/model/ApprovalEntry.js +148 -0
- package/dist/model/ApprovalRequest.js +180 -0
- package/dist/model/ApprovalRequestDetail.js +177 -0
- package/dist/model/ApprovalStatus.js +71 -0
- package/dist/model/ApprovalUser.js +146 -0
- package/dist/model/BabylonStakeExtra.js +16 -0
- package/dist/model/BatchCheckUtxo201Response.js +107 -0
- package/dist/model/BatchCheckUtxoRequest.js +142 -0
- package/dist/model/{CreateBankAccountRequest.js → BatchUTXOParam.js} +43 -28
- package/dist/model/ChainInfo.js +9 -0
- package/dist/model/CreateApprovalRequest201Response.js +110 -0
- package/dist/model/CreatePaymentOrderRequest.js +5 -5
- package/dist/model/CreateRefundRequest.js +35 -0
- package/dist/model/CreateSettlement.js +39 -29
- package/dist/model/CreateStakeActivityExtra.js +6 -0
- package/dist/model/CryptoAddress.js +171 -0
- package/dist/model/{OrderAddressInfo.js → CustodialTransferDestination.js} +36 -46
- package/dist/model/CustodialWeb3TransferSource.js +1 -1
- package/dist/model/EstimateContractCallFeeParams.js +13 -0
- package/dist/model/EstimateFeeParams.js +6 -0
- package/dist/model/EstimateTransferFeeParams.js +13 -0
- package/dist/model/ExchangePermissionToken201Response.js +122 -0
- package/dist/model/ExchangePermissionTokenRequest.js +110 -0
- package/dist/model/ListApprovalRequests200Response.js +123 -0
- package/dist/model/MpcTransferSource.js +1 -1
- package/dist/model/Order.js +4 -4
- package/dist/model/PaymentOrderEventData.js +6 -6
- package/dist/model/PayoutChannel.js +61 -0
- package/dist/model/PolicyAction.js +123 -0
- package/dist/model/PolicyActionContent.js +169 -0
- package/dist/model/PolicyActionType.js +66 -0
- package/dist/model/PolicyCondition.js +148 -0
- package/dist/model/PolicyFieldOperator.js +76 -0
- package/dist/model/PolicyFieldValueType.js +61 -0
- package/dist/model/RefreshPermissionTokenRequest.js +110 -0
- package/dist/model/RequestApproval.js +188 -0
- package/dist/model/RevokeApprovalRequest201Response.js +119 -0
- package/dist/model/RevokeApprovalRequestRequest.js +110 -0
- package/dist/model/SettlementDetail.js +22 -0
- package/dist/model/SupportedToken.js +222 -0
- package/dist/model/SwapActivityApprovers.js +122 -0
- package/dist/model/SwapActivityDetail.js +30 -0
- package/dist/model/SwapApproversStatus.js +66 -0
- package/dist/model/TransactionCoboCategory.js +102 -7
- package/dist/model/TransactionDestination.js +4 -0
- package/dist/model/TransactionDestinationType.js +5 -0
- package/dist/model/TransactionRbfSource.js +1 -1
- package/dist/model/TransactionSubStatus.js +10 -0
- package/dist/model/TransactionTransferToWalletDestination.js +2 -2
- package/dist/model/TransferDestination.js +42 -14
- package/dist/model/TransferDestinationType.js +5 -0
- package/dist/model/UTXO.js +9 -0
- package/docs/AddressBooksApi.md +2 -2
- package/docs/AppWorkflow.md +12 -0
- package/docs/AppWorkflowField.md +11 -0
- package/docs/AppWorkflowPolicy.md +10 -0
- package/docs/AppWorkflowsApi.md +273 -0
- package/docs/ApprovalEntry.md +11 -0
- package/docs/ApprovalRequest.md +13 -0
- package/docs/ApprovalRequestDetail.md +13 -0
- package/docs/ApprovalStatus.md +16 -0
- package/docs/ApprovalUser.md +12 -0
- package/docs/BabylonStakeExtra.md +1 -0
- package/docs/BatchCheckUtxo201Response.md +9 -0
- package/docs/BatchCheckUtxoRequest.md +10 -0
- package/docs/BatchUTXOParam.md +10 -0
- package/docs/ChainInfo.md +1 -0
- package/docs/CreateApprovalRequest201Response.md +9 -0
- package/docs/CreatePaymentOrderRequest.md +1 -1
- package/docs/CreateRefundRequest.md +3 -0
- package/docs/CreateSettlement.md +5 -2
- package/docs/CreateStakeActivityExtra.md +1 -0
- package/docs/CryptoAddress.md +14 -0
- package/docs/CustodialTransferDestination.md +11 -0
- package/docs/CustodialWeb3TransferSource.md +1 -1
- package/docs/DevelopersApi.md +2 -2
- package/docs/DevelopersWebhooksApi.md +6 -6
- package/docs/EstimateContractCallFeeParams.md +1 -0
- package/docs/EstimateFeeParams.md +1 -0
- package/docs/EstimateTransferFeeParams.md +1 -0
- package/docs/ExchangePermissionToken201Response.md +12 -0
- package/docs/ExchangePermissionTokenRequest.md +9 -0
- package/docs/FeeStationApi.md +6 -6
- package/docs/ListApprovalRequests200Response.md +10 -0
- package/docs/MpcTransferSource.md +1 -1
- package/docs/OAuthApi.md +102 -0
- package/docs/Order.md +2 -2
- package/docs/PaymentApi.md +86 -147
- package/docs/PaymentOrderEventData.md +2 -2
- package/docs/PayoutChannel.md +12 -0
- package/docs/PolicyAction.md +10 -0
- package/docs/PolicyActionContent.md +25 -0
- package/docs/PolicyActionType.md +14 -0
- package/docs/PolicyCondition.md +12 -0
- package/docs/PolicyFieldOperator.md +18 -0
- package/docs/PolicyFieldValueType.md +12 -0
- package/docs/RefreshPermissionTokenRequest.md +9 -0
- package/docs/RequestApproval.md +13 -0
- package/docs/RevokeApprovalRequest201Response.md +10 -0
- package/docs/RevokeApprovalRequestRequest.md +9 -0
- package/docs/SettlementDetail.md +2 -0
- package/docs/StakingsApi.md +14 -14
- package/docs/SupportedToken.md +17 -0
- package/docs/SwapActivityApprovers.md +10 -0
- package/docs/SwapActivityDetail.md +1 -0
- package/docs/SwapApproversStatus.md +14 -0
- package/docs/TransactionCoboCategory.md +41 -3
- package/docs/TransactionDestinationType.md +2 -0
- package/docs/TransactionRbfSource.md +1 -1
- package/docs/TransactionSubStatus.md +4 -0
- package/docs/TransactionTransferToWalletDestination.md +1 -1
- package/docs/TransactionsApi.md +2 -2
- package/docs/TransferDestination.md +1 -1
- package/docs/TransferDestinationType.md +2 -0
- package/docs/UTXO.md +1 -0
- package/docs/WalletsApi.md +78 -23
- package/docs/WalletsExchangeWalletApi.md +4 -4
- package/docs/WalletsMPCWalletsApi.md +10 -10
- package/package.json +1 -1
- package/docs/CreateBankAccountRequest.md +0 -9
- package/docs/OrderAddressInfo.md +0 -12
|
@@ -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 _PolicyFieldOperator = _interopRequireDefault(require("./PolicyFieldOperator"));
|
|
9
|
+
var _PolicyFieldValueType = _interopRequireDefault(require("./PolicyFieldValueType"));
|
|
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 PolicyCondition model module.
|
|
31
|
+
* @module model/PolicyCondition
|
|
32
|
+
*/
|
|
33
|
+
var PolicyCondition = /*#__PURE__*/function () {
|
|
34
|
+
/**
|
|
35
|
+
* Constructs a new <code>PolicyCondition</code>.
|
|
36
|
+
* A condition that defines under what circumstances the policy’s action should be triggered.
|
|
37
|
+
* @alias module:model/PolicyCondition
|
|
38
|
+
* @param field {String} The field name.
|
|
39
|
+
* @param value_type {module:model/PolicyFieldValueType}
|
|
40
|
+
* @param value {String} The field value.
|
|
41
|
+
* @param operator {module:model/PolicyFieldOperator}
|
|
42
|
+
*/
|
|
43
|
+
function PolicyCondition(field, value_type, value, operator) {
|
|
44
|
+
_classCallCheck(this, PolicyCondition);
|
|
45
|
+
PolicyCondition.initialize(this, field, value_type, value, operator);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Initializes the fields of this object.
|
|
50
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
51
|
+
* Only for internal use.
|
|
52
|
+
*/
|
|
53
|
+
return _createClass(PolicyCondition, null, [{
|
|
54
|
+
key: "initialize",
|
|
55
|
+
value: function initialize(obj, field, value_type, value, operator) {
|
|
56
|
+
obj['field'] = field;
|
|
57
|
+
obj['value_type'] = value_type;
|
|
58
|
+
obj['value'] = value;
|
|
59
|
+
obj['operator'] = operator;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Constructs a <code>PolicyCondition</code> from a plain JavaScript object, optionally creating a new instance.
|
|
64
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
65
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
66
|
+
* @param {module:model/PolicyCondition} obj Optional instance to populate.
|
|
67
|
+
* @return {module:model/PolicyCondition} The populated <code>PolicyCondition</code> instance.
|
|
68
|
+
*/
|
|
69
|
+
}, {
|
|
70
|
+
key: "constructFromObject",
|
|
71
|
+
value: function constructFromObject(data, obj) {
|
|
72
|
+
if (data) {
|
|
73
|
+
obj = obj || new PolicyCondition();
|
|
74
|
+
if (data.hasOwnProperty('field')) {
|
|
75
|
+
obj['field'] = _ApiClient["default"].convertToType(data['field'], 'String');
|
|
76
|
+
}
|
|
77
|
+
if (data.hasOwnProperty('value_type')) {
|
|
78
|
+
obj['value_type'] = _PolicyFieldValueType["default"].constructFromObject(data['value_type']);
|
|
79
|
+
}
|
|
80
|
+
if (data.hasOwnProperty('value')) {
|
|
81
|
+
obj['value'] = _ApiClient["default"].convertToType(data['value'], 'String');
|
|
82
|
+
}
|
|
83
|
+
if (data.hasOwnProperty('operator')) {
|
|
84
|
+
obj['operator'] = _PolicyFieldOperator["default"].constructFromObject(data['operator']);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return obj;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Validates the JSON data with respect to <code>PolicyCondition</code>.
|
|
92
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
93
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>PolicyCondition</code>.
|
|
94
|
+
*/
|
|
95
|
+
}, {
|
|
96
|
+
key: "validateJSON",
|
|
97
|
+
value: function validateJSON(data) {
|
|
98
|
+
// check to make sure all required properties are present in the JSON string
|
|
99
|
+
var _iterator = _createForOfIteratorHelper(PolicyCondition.RequiredProperties),
|
|
100
|
+
_step;
|
|
101
|
+
try {
|
|
102
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
103
|
+
var property = _step.value;
|
|
104
|
+
if (!data.hasOwnProperty(property)) {
|
|
105
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// ensure the json data is a string
|
|
109
|
+
} catch (err) {
|
|
110
|
+
_iterator.e(err);
|
|
111
|
+
} finally {
|
|
112
|
+
_iterator.f();
|
|
113
|
+
}
|
|
114
|
+
if (data['field'] && !(typeof data['field'] === 'string' || data['field'] instanceof String)) {
|
|
115
|
+
throw new Error("Expected the field `field` to be a primitive type in the JSON string but got " + data['field']);
|
|
116
|
+
}
|
|
117
|
+
// ensure the json data is a string
|
|
118
|
+
if (data['value'] && !(typeof data['value'] === 'string' || data['value'] instanceof String)) {
|
|
119
|
+
throw new Error("Expected the field `value` to be a primitive type in the JSON string but got " + data['value']);
|
|
120
|
+
}
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
}]);
|
|
124
|
+
}();
|
|
125
|
+
PolicyCondition.RequiredProperties = ["field", "value_type", "value", "operator"];
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The field name.
|
|
129
|
+
* @member {String} field
|
|
130
|
+
*/
|
|
131
|
+
PolicyCondition.prototype['field'] = undefined;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* @member {module:model/PolicyFieldValueType} value_type
|
|
135
|
+
*/
|
|
136
|
+
PolicyCondition.prototype['value_type'] = undefined;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The field value.
|
|
140
|
+
* @member {String} value
|
|
141
|
+
*/
|
|
142
|
+
PolicyCondition.prototype['value'] = undefined;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* @member {module:model/PolicyFieldOperator} operator
|
|
146
|
+
*/
|
|
147
|
+
PolicyCondition.prototype['operator'] = undefined;
|
|
148
|
+
var _default = exports["default"] = PolicyCondition;
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
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); }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
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); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
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); } /**
|
|
16
|
+
* Cobo Wallet as a Service 2.0
|
|
17
|
+
*
|
|
18
|
+
* Contact: help@cobo.com
|
|
19
|
+
*
|
|
20
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
21
|
+
* https://openapi-generator.tech
|
|
22
|
+
* Do not edit the class manually.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Enum class PolicyFieldOperator.
|
|
27
|
+
* @enum {}
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
var PolicyFieldOperator = exports["default"] = /*#__PURE__*/function () {
|
|
31
|
+
function PolicyFieldOperator() {
|
|
32
|
+
_classCallCheck(this, PolicyFieldOperator);
|
|
33
|
+
/**
|
|
34
|
+
* value: ">"
|
|
35
|
+
* @const
|
|
36
|
+
*/
|
|
37
|
+
_defineProperty(this, "GREATER_THAN", ">");
|
|
38
|
+
/**
|
|
39
|
+
* value: ">="
|
|
40
|
+
* @const
|
|
41
|
+
*/
|
|
42
|
+
_defineProperty(this, "GREATER_THAN_OR_EQUAL_TO", ">=");
|
|
43
|
+
/**
|
|
44
|
+
* value: "<"
|
|
45
|
+
* @const
|
|
46
|
+
*/
|
|
47
|
+
_defineProperty(this, "LESS_THAN", "<");
|
|
48
|
+
/**
|
|
49
|
+
* value: "<="
|
|
50
|
+
* @const
|
|
51
|
+
*/
|
|
52
|
+
_defineProperty(this, "LESS_THAN_OR_EQUAL_TO", "<=");
|
|
53
|
+
/**
|
|
54
|
+
* value: "="
|
|
55
|
+
* @const
|
|
56
|
+
*/
|
|
57
|
+
_defineProperty(this, "EQUAL", "=");
|
|
58
|
+
/**
|
|
59
|
+
* value: "unknown_default_open_api"
|
|
60
|
+
* @const
|
|
61
|
+
*/
|
|
62
|
+
_defineProperty(this, "unknown_default_open_api", "unknown_default_open_api");
|
|
63
|
+
}
|
|
64
|
+
return _createClass(PolicyFieldOperator, null, [{
|
|
65
|
+
key: "constructFromObject",
|
|
66
|
+
value:
|
|
67
|
+
/**
|
|
68
|
+
* Returns a <code>PolicyFieldOperator</code> enum value from a Javascript object name.
|
|
69
|
+
* @param {Object} data The plain JavaScript object containing the name of the enum value.
|
|
70
|
+
* @return {module:model/PolicyFieldOperator} The enum <code>PolicyFieldOperator</code> value.
|
|
71
|
+
*/
|
|
72
|
+
function constructFromObject(object) {
|
|
73
|
+
return object;
|
|
74
|
+
}
|
|
75
|
+
}]);
|
|
76
|
+
}();
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
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); }
|
|
10
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
|
+
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); } }
|
|
12
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
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); } /**
|
|
16
|
+
* Cobo Wallet as a Service 2.0
|
|
17
|
+
*
|
|
18
|
+
* Contact: help@cobo.com
|
|
19
|
+
*
|
|
20
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
21
|
+
* https://openapi-generator.tech
|
|
22
|
+
* Do not edit the class manually.
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* Enum class PolicyFieldValueType.
|
|
27
|
+
* @enum {}
|
|
28
|
+
* @readonly
|
|
29
|
+
*/
|
|
30
|
+
var PolicyFieldValueType = exports["default"] = /*#__PURE__*/function () {
|
|
31
|
+
function PolicyFieldValueType() {
|
|
32
|
+
_classCallCheck(this, PolicyFieldValueType);
|
|
33
|
+
/**
|
|
34
|
+
* value: "INT"
|
|
35
|
+
* @const
|
|
36
|
+
*/
|
|
37
|
+
_defineProperty(this, "INT", "INT");
|
|
38
|
+
/**
|
|
39
|
+
* value: "Float2"
|
|
40
|
+
* @const
|
|
41
|
+
*/
|
|
42
|
+
_defineProperty(this, "Float2", "Float2");
|
|
43
|
+
/**
|
|
44
|
+
* value: "unknown_default_open_api"
|
|
45
|
+
* @const
|
|
46
|
+
*/
|
|
47
|
+
_defineProperty(this, "unknown_default_open_api", "unknown_default_open_api");
|
|
48
|
+
}
|
|
49
|
+
return _createClass(PolicyFieldValueType, null, [{
|
|
50
|
+
key: "constructFromObject",
|
|
51
|
+
value:
|
|
52
|
+
/**
|
|
53
|
+
* Returns a <code>PolicyFieldValueType</code> enum value from a Javascript object name.
|
|
54
|
+
* @param {Object} data The plain JavaScript object containing the name of the enum value.
|
|
55
|
+
* @return {module:model/PolicyFieldValueType} The enum <code>PolicyFieldValueType</code> value.
|
|
56
|
+
*/
|
|
57
|
+
function constructFromObject(object) {
|
|
58
|
+
return object;
|
|
59
|
+
}
|
|
60
|
+
}]);
|
|
61
|
+
}();
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
|
+
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); }
|
|
10
|
+
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; } } }; }
|
|
11
|
+
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; } }
|
|
12
|
+
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; }
|
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
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); } }
|
|
15
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
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); } /**
|
|
18
|
+
* Cobo Wallet as a Service 2.0
|
|
19
|
+
*
|
|
20
|
+
* Contact: help@cobo.com
|
|
21
|
+
*
|
|
22
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
23
|
+
* https://openapi-generator.tech
|
|
24
|
+
* Do not edit the class manually.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The RefreshPermissionTokenRequest model module.
|
|
29
|
+
* @module model/RefreshPermissionTokenRequest
|
|
30
|
+
*/
|
|
31
|
+
var RefreshPermissionTokenRequest = /*#__PURE__*/function () {
|
|
32
|
+
/**
|
|
33
|
+
* Constructs a new <code>RefreshPermissionTokenRequest</code>.
|
|
34
|
+
* @alias module:model/RefreshPermissionTokenRequest
|
|
35
|
+
* @param refresh_token {String} The Refresh Token of the current Org Access Token.
|
|
36
|
+
*/
|
|
37
|
+
function RefreshPermissionTokenRequest(refresh_token) {
|
|
38
|
+
_classCallCheck(this, RefreshPermissionTokenRequest);
|
|
39
|
+
RefreshPermissionTokenRequest.initialize(this, refresh_token);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Initializes the fields of this object.
|
|
44
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
45
|
+
* Only for internal use.
|
|
46
|
+
*/
|
|
47
|
+
return _createClass(RefreshPermissionTokenRequest, null, [{
|
|
48
|
+
key: "initialize",
|
|
49
|
+
value: function initialize(obj, refresh_token) {
|
|
50
|
+
obj['refresh_token'] = refresh_token;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Constructs a <code>RefreshPermissionTokenRequest</code> from a plain JavaScript object, optionally creating a new instance.
|
|
55
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
56
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
57
|
+
* @param {module:model/RefreshPermissionTokenRequest} obj Optional instance to populate.
|
|
58
|
+
* @return {module:model/RefreshPermissionTokenRequest} The populated <code>RefreshPermissionTokenRequest</code> instance.
|
|
59
|
+
*/
|
|
60
|
+
}, {
|
|
61
|
+
key: "constructFromObject",
|
|
62
|
+
value: function constructFromObject(data, obj) {
|
|
63
|
+
if (data) {
|
|
64
|
+
obj = obj || new RefreshPermissionTokenRequest();
|
|
65
|
+
if (data.hasOwnProperty('refresh_token')) {
|
|
66
|
+
obj['refresh_token'] = _ApiClient["default"].convertToType(data['refresh_token'], 'String');
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return obj;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Validates the JSON data with respect to <code>RefreshPermissionTokenRequest</code>.
|
|
74
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
75
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>RefreshPermissionTokenRequest</code>.
|
|
76
|
+
*/
|
|
77
|
+
}, {
|
|
78
|
+
key: "validateJSON",
|
|
79
|
+
value: function validateJSON(data) {
|
|
80
|
+
// check to make sure all required properties are present in the JSON string
|
|
81
|
+
var _iterator = _createForOfIteratorHelper(RefreshPermissionTokenRequest.RequiredProperties),
|
|
82
|
+
_step;
|
|
83
|
+
try {
|
|
84
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
85
|
+
var property = _step.value;
|
|
86
|
+
if (!data.hasOwnProperty(property)) {
|
|
87
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// ensure the json data is a string
|
|
91
|
+
} catch (err) {
|
|
92
|
+
_iterator.e(err);
|
|
93
|
+
} finally {
|
|
94
|
+
_iterator.f();
|
|
95
|
+
}
|
|
96
|
+
if (data['refresh_token'] && !(typeof data['refresh_token'] === 'string' || data['refresh_token'] instanceof String)) {
|
|
97
|
+
throw new Error("Expected the field `refresh_token` to be a primitive type in the JSON string but got " + data['refresh_token']);
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}]);
|
|
102
|
+
}();
|
|
103
|
+
RefreshPermissionTokenRequest.RequiredProperties = ["refresh_token"];
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The Refresh Token of the current Org Access Token.
|
|
107
|
+
* @member {String} refresh_token
|
|
108
|
+
*/
|
|
109
|
+
RefreshPermissionTokenRequest.prototype['refresh_token'] = undefined;
|
|
110
|
+
var _default = exports["default"] = RefreshPermissionTokenRequest;
|
|
@@ -0,0 +1,188 @@
|
|
|
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
|
+
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 RequestApproval model module.
|
|
30
|
+
* @module model/RequestApproval
|
|
31
|
+
*/
|
|
32
|
+
var RequestApproval = /*#__PURE__*/function () {
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new <code>RequestApproval</code>.
|
|
35
|
+
* The information about a approval request.
|
|
36
|
+
* @alias module:model/RequestApproval
|
|
37
|
+
* @param operation_id {String} The unique ID of the approval workflow.
|
|
38
|
+
* @param request_id {String} An identifier provided by you to track this request.
|
|
39
|
+
* @param initiator_email {String} The email of the user who requested the approval.
|
|
40
|
+
* @param fields {Array.<module:model/AppWorkflowField>}
|
|
41
|
+
* @param guard_template {String} The template of a Cobo Guard message. Please connect [help@cobo.com](mailto:help@cobo.com) to get the template content.
|
|
42
|
+
*/
|
|
43
|
+
function RequestApproval(operation_id, request_id, initiator_email, fields, guard_template) {
|
|
44
|
+
_classCallCheck(this, RequestApproval);
|
|
45
|
+
RequestApproval.initialize(this, operation_id, request_id, initiator_email, fields, guard_template);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Initializes the fields of this object.
|
|
50
|
+
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
|
|
51
|
+
* Only for internal use.
|
|
52
|
+
*/
|
|
53
|
+
return _createClass(RequestApproval, null, [{
|
|
54
|
+
key: "initialize",
|
|
55
|
+
value: function initialize(obj, operation_id, request_id, initiator_email, fields, guard_template) {
|
|
56
|
+
obj['operation_id'] = operation_id;
|
|
57
|
+
obj['request_id'] = request_id;
|
|
58
|
+
obj['initiator_email'] = initiator_email;
|
|
59
|
+
obj['fields'] = fields;
|
|
60
|
+
obj['guard_template'] = guard_template;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Constructs a <code>RequestApproval</code> from a plain JavaScript object, optionally creating a new instance.
|
|
65
|
+
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
|
|
66
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
67
|
+
* @param {module:model/RequestApproval} obj Optional instance to populate.
|
|
68
|
+
* @return {module:model/RequestApproval} The populated <code>RequestApproval</code> instance.
|
|
69
|
+
*/
|
|
70
|
+
}, {
|
|
71
|
+
key: "constructFromObject",
|
|
72
|
+
value: function constructFromObject(data, obj) {
|
|
73
|
+
if (data) {
|
|
74
|
+
obj = obj || new RequestApproval();
|
|
75
|
+
if (data.hasOwnProperty('operation_id')) {
|
|
76
|
+
obj['operation_id'] = _ApiClient["default"].convertToType(data['operation_id'], 'String');
|
|
77
|
+
}
|
|
78
|
+
if (data.hasOwnProperty('request_id')) {
|
|
79
|
+
obj['request_id'] = _ApiClient["default"].convertToType(data['request_id'], 'String');
|
|
80
|
+
}
|
|
81
|
+
if (data.hasOwnProperty('initiator_email')) {
|
|
82
|
+
obj['initiator_email'] = _ApiClient["default"].convertToType(data['initiator_email'], 'String');
|
|
83
|
+
}
|
|
84
|
+
if (data.hasOwnProperty('fields')) {
|
|
85
|
+
obj['fields'] = _ApiClient["default"].convertToType(data['fields'], [_AppWorkflowField["default"]]);
|
|
86
|
+
}
|
|
87
|
+
if (data.hasOwnProperty('guard_template')) {
|
|
88
|
+
obj['guard_template'] = _ApiClient["default"].convertToType(data['guard_template'], 'String');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return obj;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Validates the JSON data with respect to <code>RequestApproval</code>.
|
|
96
|
+
* @param {Object} data The plain JavaScript object bearing properties of interest.
|
|
97
|
+
* @return {boolean} to indicate whether the JSON data is valid with respect to <code>RequestApproval</code>.
|
|
98
|
+
*/
|
|
99
|
+
}, {
|
|
100
|
+
key: "validateJSON",
|
|
101
|
+
value: function validateJSON(data) {
|
|
102
|
+
// check to make sure all required properties are present in the JSON string
|
|
103
|
+
var _iterator = _createForOfIteratorHelper(RequestApproval.RequiredProperties),
|
|
104
|
+
_step;
|
|
105
|
+
try {
|
|
106
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
107
|
+
var property = _step.value;
|
|
108
|
+
if (!data.hasOwnProperty(property)) {
|
|
109
|
+
throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// ensure the json data is a string
|
|
113
|
+
} catch (err) {
|
|
114
|
+
_iterator.e(err);
|
|
115
|
+
} finally {
|
|
116
|
+
_iterator.f();
|
|
117
|
+
}
|
|
118
|
+
if (data['operation_id'] && !(typeof data['operation_id'] === 'string' || data['operation_id'] instanceof String)) {
|
|
119
|
+
throw new Error("Expected the field `operation_id` to be a primitive type in the JSON string but got " + data['operation_id']);
|
|
120
|
+
}
|
|
121
|
+
// ensure the json data is a string
|
|
122
|
+
if (data['request_id'] && !(typeof data['request_id'] === 'string' || data['request_id'] instanceof String)) {
|
|
123
|
+
throw new Error("Expected the field `request_id` to be a primitive type in the JSON string but got " + data['request_id']);
|
|
124
|
+
}
|
|
125
|
+
// ensure the json data is a string
|
|
126
|
+
if (data['initiator_email'] && !(typeof data['initiator_email'] === 'string' || data['initiator_email'] instanceof String)) {
|
|
127
|
+
throw new Error("Expected the field `initiator_email` to be a primitive type in the JSON string but got " + data['initiator_email']);
|
|
128
|
+
}
|
|
129
|
+
if (data['fields']) {
|
|
130
|
+
// data not null
|
|
131
|
+
// ensure the json data is an array
|
|
132
|
+
if (!Array.isArray(data['fields'])) {
|
|
133
|
+
throw new Error("Expected the field `fields` to be an array in the JSON data but got " + data['fields']);
|
|
134
|
+
}
|
|
135
|
+
// validate the optional field `fields` (array)
|
|
136
|
+
var _iterator2 = _createForOfIteratorHelper(data['fields']),
|
|
137
|
+
_step2;
|
|
138
|
+
try {
|
|
139
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
140
|
+
var item = _step2.value;
|
|
141
|
+
_AppWorkflowField["default"].validateJSON(item);
|
|
142
|
+
}
|
|
143
|
+
} catch (err) {
|
|
144
|
+
_iterator2.e(err);
|
|
145
|
+
} finally {
|
|
146
|
+
_iterator2.f();
|
|
147
|
+
}
|
|
148
|
+
;
|
|
149
|
+
}
|
|
150
|
+
// ensure the json data is a string
|
|
151
|
+
if (data['guard_template'] && !(typeof data['guard_template'] === 'string' || data['guard_template'] instanceof String)) {
|
|
152
|
+
throw new Error("Expected the field `guard_template` to be a primitive type in the JSON string but got " + data['guard_template']);
|
|
153
|
+
}
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
}]);
|
|
157
|
+
}();
|
|
158
|
+
RequestApproval.RequiredProperties = ["operation_id", "request_id", "initiator_email", "fields", "guard_template"];
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The unique ID of the approval workflow.
|
|
162
|
+
* @member {String} operation_id
|
|
163
|
+
*/
|
|
164
|
+
RequestApproval.prototype['operation_id'] = undefined;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* An identifier provided by you to track this request.
|
|
168
|
+
* @member {String} request_id
|
|
169
|
+
*/
|
|
170
|
+
RequestApproval.prototype['request_id'] = undefined;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* The email of the user who requested the approval.
|
|
174
|
+
* @member {String} initiator_email
|
|
175
|
+
*/
|
|
176
|
+
RequestApproval.prototype['initiator_email'] = undefined;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @member {Array.<module:model/AppWorkflowField>} fields
|
|
180
|
+
*/
|
|
181
|
+
RequestApproval.prototype['fields'] = undefined;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* The template of a Cobo Guard message. Please connect [help@cobo.com](mailto:help@cobo.com) to get the template content.
|
|
185
|
+
* @member {String} guard_template
|
|
186
|
+
*/
|
|
187
|
+
RequestApproval.prototype['guard_template'] = undefined;
|
|
188
|
+
var _default = exports["default"] = RequestApproval;
|