files.com 1.0.164 → 1.0.167
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +9 -5
- package/_VERSION +1 -1
- package/lib/models/ActionWebhookFailure.js +8 -2
- package/lib/models/ApiKey.js +16 -4
- package/lib/models/As2Partner.js +46 -4
- package/lib/models/As2Station.js +74 -80
- package/lib/models/Automation.js +16 -4
- package/lib/models/Behavior.js +16 -4
- package/lib/models/Bundle.js +24 -6
- package/lib/models/Clickwrap.js +16 -4
- package/lib/models/File.js +309 -311
- package/lib/models/FileComment.js +16 -4
- package/lib/models/FileCommentReaction.js +8 -2
- package/lib/models/FormFieldSet.js +16 -4
- package/lib/models/Group.js +16 -4
- package/lib/models/GroupUser.js +16 -4
- package/lib/models/Lock.js +8 -2
- package/lib/models/Message.js +16 -4
- package/lib/models/MessageComment.js +16 -4
- package/lib/models/MessageCommentReaction.js +8 -2
- package/lib/models/MessageReaction.js +8 -2
- package/lib/models/Notification.js +16 -4
- package/lib/models/Permission.js +8 -2
- package/lib/models/Project.js +16 -4
- package/lib/models/PublicKey.js +16 -4
- package/lib/models/RemoteServer.js +16 -4
- package/lib/models/Request.js +8 -2
- package/lib/models/SsoStrategy.js +8 -2
- package/lib/models/Style.js +16 -4
- package/lib/models/User.js +40 -10
- package/lib/models/UserRequest.js +8 -2
- package/package.json +1 -1
- package/src/models/AccountLineItem.js +2 -2
- package/src/models/ActionWebhookFailure.js +3 -1
- package/src/models/ApiKey.js +6 -2
- package/src/models/As2Partner.js +41 -2
- package/src/models/As2Station.js +48 -35
- package/src/models/Automation.js +6 -2
- package/src/models/Behavior.js +6 -2
- package/src/models/Bundle.js +11 -5
- package/src/models/BundleDownload.js +1 -0
- package/src/models/Clickwrap.js +6 -2
- package/src/models/File.js +27 -20
- package/src/models/FileComment.js +7 -3
- package/src/models/FileCommentReaction.js +3 -1
- package/src/models/Folder.js +1 -1
- package/src/models/FormFieldSet.js +7 -3
- package/src/models/Group.js +6 -2
- package/src/models/GroupUser.js +6 -2
- package/src/models/InboxUpload.js +1 -0
- package/src/models/Invoice.js +2 -2
- package/src/models/Lock.js +3 -1
- package/src/models/Message.js +7 -3
- package/src/models/MessageComment.js +7 -3
- package/src/models/MessageCommentReaction.js +3 -1
- package/src/models/MessageReaction.js +3 -1
- package/src/models/Notification.js +6 -2
- package/src/models/Payment.js +2 -2
- package/src/models/Permission.js +3 -1
- package/src/models/Project.js +6 -2
- package/src/models/PublicKey.js +6 -2
- package/src/models/RemoteServer.js +6 -2
- package/src/models/Request.js +3 -1
- package/src/models/Site.js +8 -8
- package/src/models/SsoStrategy.js +3 -1
- package/src/models/Status.js +2 -2
- package/src/models/Style.js +8 -4
- package/src/models/User.js +15 -5
- package/src/models/UserRequest.js +3 -1
- package/src/models/WebhookTest.js +1 -1
- package/test/src/index.js +7 -3
package/README.md
CHANGED
@@ -133,21 +133,25 @@ You can set the following global properties using static methods on the `Files`
|
|
133
133
|
await File.uploadFile(destinationFileName, sourceFilePath)
|
134
134
|
}
|
135
135
|
|
136
|
-
####
|
136
|
+
#### Downloading a file
|
137
|
+
|
138
|
+
##### Get a downloadable file object by path
|
137
139
|
|
138
140
|
import File from 'files.com/lib/models/File'
|
139
|
-
const foundFile = await File.findDownload(remoteFilePath)
|
140
141
|
|
141
|
-
|
142
|
+
const foundFile = await File.find(remoteFilePath)
|
143
|
+
const downloadableFile = await foundFile.download()
|
144
|
+
|
145
|
+
##### Download a file (not available in browser)
|
142
146
|
|
143
147
|
import { isBrowser } from 'files.com/lib/utils'
|
144
148
|
|
145
149
|
if (!isBrowser()) {
|
146
150
|
// download to a file on disk
|
147
|
-
await
|
151
|
+
await downloadableFile.downloadToFile(localFilePath)
|
148
152
|
|
149
153
|
// download to a writable stream
|
150
|
-
await
|
154
|
+
await downloadableFile.downloadToStream(stream)
|
151
155
|
}
|
152
156
|
|
153
157
|
### Additional Object Documentation
|
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.167
|
@@ -43,6 +43,7 @@ var ActionWebhookFailure = /*#__PURE__*/(0, _createClass2.default)(function Acti
|
|
43
43
|
});
|
44
44
|
(0, _defineProperty2.default)(this, "retry", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
45
45
|
var params,
|
46
|
+
response,
|
46
47
|
_args = arguments;
|
47
48
|
return _regenerator.default.wrap(function _callee$(_context) {
|
48
49
|
while (1) {
|
@@ -94,9 +95,14 @@ var ActionWebhookFailure = /*#__PURE__*/(0, _createClass2.default)(function Acti
|
|
94
95
|
throw new Error('Parameter missing: id');
|
95
96
|
|
96
97
|
case 14:
|
97
|
-
|
98
|
+
_context.next = 16;
|
99
|
+
return _Api.default.sendRequest("/action_webhook_failures/".concat(params['id'], "/retry"), 'POST', params, _this.options);
|
98
100
|
|
99
|
-
case
|
101
|
+
case 16:
|
102
|
+
response = _context.sent;
|
103
|
+
return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
104
|
+
|
105
|
+
case 18:
|
100
106
|
case "end":
|
101
107
|
return _context.stop();
|
102
108
|
}
|
package/lib/models/ApiKey.js
CHANGED
@@ -106,6 +106,7 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
|
|
106
106
|
});
|
107
107
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
108
108
|
var params,
|
109
|
+
response,
|
109
110
|
_args = arguments;
|
110
111
|
return _regenerator.default.wrap(function _callee$(_context) {
|
111
112
|
while (1) {
|
@@ -181,9 +182,14 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
|
|
181
182
|
throw new Error('Parameter missing: id');
|
182
183
|
|
183
184
|
case 20:
|
184
|
-
|
185
|
+
_context.next = 22;
|
186
|
+
return _Api.default.sendRequest("/api_keys/".concat(params['id']), 'PATCH', params, _this.options);
|
187
|
+
|
188
|
+
case 22:
|
189
|
+
response = _context.sent;
|
190
|
+
return _context.abrupt("return", new ApiKey(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
185
191
|
|
186
|
-
case
|
192
|
+
case 24:
|
187
193
|
case "end":
|
188
194
|
return _context.stop();
|
189
195
|
}
|
@@ -192,6 +198,7 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
|
|
192
198
|
})));
|
193
199
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
194
200
|
var params,
|
201
|
+
response,
|
195
202
|
_args2 = arguments;
|
196
203
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
197
204
|
while (1) {
|
@@ -243,9 +250,14 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() {
|
|
243
250
|
throw new Error('Parameter missing: id');
|
244
251
|
|
245
252
|
case 14:
|
246
|
-
|
253
|
+
_context2.next = 16;
|
254
|
+
return _Api.default.sendRequest("/api_keys/".concat(params['id']), 'DELETE', params, _this.options);
|
255
|
+
|
256
|
+
case 16:
|
257
|
+
response = _context2.sent;
|
258
|
+
return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
247
259
|
|
248
|
-
case
|
260
|
+
case 18:
|
249
261
|
case "end":
|
250
262
|
return _context2.stop();
|
251
263
|
}
|
package/lib/models/As2Partner.js
CHANGED
@@ -71,6 +71,36 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
71
71
|
(0, _defineProperty2.default)(this, "setPublicCertificateMd5", function (value) {
|
72
72
|
_this.attributes.public_certificate_md5 = value;
|
73
73
|
});
|
74
|
+
(0, _defineProperty2.default)(this, "getPublicCertificateSubject", function () {
|
75
|
+
return _this.attributes.public_certificate_subject;
|
76
|
+
});
|
77
|
+
(0, _defineProperty2.default)(this, "setPublicCertificateSubject", function (value) {
|
78
|
+
_this.attributes.public_certificate_subject = value;
|
79
|
+
});
|
80
|
+
(0, _defineProperty2.default)(this, "getPublicCertificateIssuer", function () {
|
81
|
+
return _this.attributes.public_certificate_issuer;
|
82
|
+
});
|
83
|
+
(0, _defineProperty2.default)(this, "setPublicCertificateIssuer", function (value) {
|
84
|
+
_this.attributes.public_certificate_issuer = value;
|
85
|
+
});
|
86
|
+
(0, _defineProperty2.default)(this, "getPublicCertificateSerial", function () {
|
87
|
+
return _this.attributes.public_certificate_serial;
|
88
|
+
});
|
89
|
+
(0, _defineProperty2.default)(this, "setPublicCertificateSerial", function (value) {
|
90
|
+
_this.attributes.public_certificate_serial = value;
|
91
|
+
});
|
92
|
+
(0, _defineProperty2.default)(this, "getPublicCertificateNotBefore", function () {
|
93
|
+
return _this.attributes.public_certificate_not_before;
|
94
|
+
});
|
95
|
+
(0, _defineProperty2.default)(this, "setPublicCertificateNotBefore", function (value) {
|
96
|
+
_this.attributes.public_certificate_not_before = value;
|
97
|
+
});
|
98
|
+
(0, _defineProperty2.default)(this, "getPublicCertificateNotAfter", function () {
|
99
|
+
return _this.attributes.public_certificate_not_after;
|
100
|
+
});
|
101
|
+
(0, _defineProperty2.default)(this, "setPublicCertificateNotAfter", function (value) {
|
102
|
+
_this.attributes.public_certificate_not_after = value;
|
103
|
+
});
|
74
104
|
(0, _defineProperty2.default)(this, "getPublicCertificate", function () {
|
75
105
|
return _this.attributes.public_certificate;
|
76
106
|
});
|
@@ -79,6 +109,7 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
79
109
|
});
|
80
110
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
81
111
|
var params,
|
112
|
+
response,
|
82
113
|
_args = arguments;
|
83
114
|
return _regenerator.default.wrap(function _callee$(_context) {
|
84
115
|
while (1) {
|
@@ -154,9 +185,14 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
154
185
|
throw new Error('Parameter missing: id');
|
155
186
|
|
156
187
|
case 20:
|
157
|
-
|
188
|
+
_context.next = 22;
|
189
|
+
return _Api.default.sendRequest("/as2_partners/".concat(params['id']), 'PATCH', params, _this.options);
|
158
190
|
|
159
|
-
case
|
191
|
+
case 22:
|
192
|
+
response = _context.sent;
|
193
|
+
return _context.abrupt("return", new As2Partner(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
194
|
+
|
195
|
+
case 24:
|
160
196
|
case "end":
|
161
197
|
return _context.stop();
|
162
198
|
}
|
@@ -165,6 +201,7 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
165
201
|
})));
|
166
202
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
167
203
|
var params,
|
204
|
+
response,
|
168
205
|
_args2 = arguments;
|
169
206
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
170
207
|
while (1) {
|
@@ -216,9 +253,14 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
216
253
|
throw new Error('Parameter missing: id');
|
217
254
|
|
218
255
|
case 14:
|
219
|
-
|
256
|
+
_context2.next = 16;
|
257
|
+
return _Api.default.sendRequest("/as2_partners/".concat(params['id']), 'DELETE', params, _this.options);
|
258
|
+
|
259
|
+
case 16:
|
260
|
+
response = _context2.sent;
|
261
|
+
return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
220
262
|
|
221
|
-
case
|
263
|
+
case 18:
|
222
264
|
case "end":
|
223
265
|
return _context2.stop();
|
224
266
|
}
|
package/lib/models/As2Station.js
CHANGED
@@ -65,12 +65,6 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
65
65
|
(0, _defineProperty2.default)(this, "setDomain", function (value) {
|
66
66
|
_this.attributes.domain = value;
|
67
67
|
});
|
68
|
-
(0, _defineProperty2.default)(this, "getPublicCertificate", function () {
|
69
|
-
return _this.attributes.public_certificate;
|
70
|
-
});
|
71
|
-
(0, _defineProperty2.default)(this, "setPublicCertificate", function (value) {
|
72
|
-
_this.attributes.public_certificate = value;
|
73
|
-
});
|
74
68
|
(0, _defineProperty2.default)(this, "getPublicCertificateMd5", function () {
|
75
69
|
return _this.attributes.public_certificate_md5;
|
76
70
|
});
|
@@ -83,6 +77,42 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
83
77
|
(0, _defineProperty2.default)(this, "setPrivateKeyMd5", function (value) {
|
84
78
|
_this.attributes.private_key_md5 = value;
|
85
79
|
});
|
80
|
+
(0, _defineProperty2.default)(this, "getPublicCertificateSubject", function () {
|
81
|
+
return _this.attributes.public_certificate_subject;
|
82
|
+
});
|
83
|
+
(0, _defineProperty2.default)(this, "setPublicCertificateSubject", function (value) {
|
84
|
+
_this.attributes.public_certificate_subject = value;
|
85
|
+
});
|
86
|
+
(0, _defineProperty2.default)(this, "getPublicCertificateIssuer", function () {
|
87
|
+
return _this.attributes.public_certificate_issuer;
|
88
|
+
});
|
89
|
+
(0, _defineProperty2.default)(this, "setPublicCertificateIssuer", function (value) {
|
90
|
+
_this.attributes.public_certificate_issuer = value;
|
91
|
+
});
|
92
|
+
(0, _defineProperty2.default)(this, "getPublicCertificateSerial", function () {
|
93
|
+
return _this.attributes.public_certificate_serial;
|
94
|
+
});
|
95
|
+
(0, _defineProperty2.default)(this, "setPublicCertificateSerial", function (value) {
|
96
|
+
_this.attributes.public_certificate_serial = value;
|
97
|
+
});
|
98
|
+
(0, _defineProperty2.default)(this, "getPublicCertificateNotBefore", function () {
|
99
|
+
return _this.attributes.public_certificate_not_before;
|
100
|
+
});
|
101
|
+
(0, _defineProperty2.default)(this, "setPublicCertificateNotBefore", function (value) {
|
102
|
+
_this.attributes.public_certificate_not_before = value;
|
103
|
+
});
|
104
|
+
(0, _defineProperty2.default)(this, "getPublicCertificateNotAfter", function () {
|
105
|
+
return _this.attributes.public_certificate_not_after;
|
106
|
+
});
|
107
|
+
(0, _defineProperty2.default)(this, "setPublicCertificateNotAfter", function (value) {
|
108
|
+
_this.attributes.public_certificate_not_after = value;
|
109
|
+
});
|
110
|
+
(0, _defineProperty2.default)(this, "getPublicCertificate", function () {
|
111
|
+
return _this.attributes.public_certificate;
|
112
|
+
});
|
113
|
+
(0, _defineProperty2.default)(this, "setPublicCertificate", function (value) {
|
114
|
+
_this.attributes.public_certificate = value;
|
115
|
+
});
|
86
116
|
(0, _defineProperty2.default)(this, "getPrivateKey", function () {
|
87
117
|
return _this.attributes.private_key;
|
88
118
|
});
|
@@ -91,6 +121,7 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
91
121
|
});
|
92
122
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
93
123
|
var params,
|
124
|
+
response,
|
94
125
|
_args = arguments;
|
95
126
|
return _regenerator.default.wrap(function _callee$(_context) {
|
96
127
|
while (1) {
|
@@ -132,59 +163,48 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
132
163
|
throw new Error("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(name)));
|
133
164
|
|
134
165
|
case 10:
|
135
|
-
if (!(params['domain'] && !(0, _utils.isString)(params['domain']))) {
|
136
|
-
_context.next = 12;
|
137
|
-
break;
|
138
|
-
}
|
139
|
-
|
140
|
-
throw new Error("Bad parameter: domain must be of type String, received ".concat((0, _utils.getType)(domain)));
|
141
|
-
|
142
|
-
case 12:
|
143
|
-
if (!(params['uri'] && !(0, _utils.isString)(params['uri']))) {
|
144
|
-
_context.next = 14;
|
145
|
-
break;
|
146
|
-
}
|
147
|
-
|
148
|
-
throw new Error("Bad parameter: uri must be of type String, received ".concat((0, _utils.getType)(uri)));
|
149
|
-
|
150
|
-
case 14:
|
151
166
|
if (!(params['public_certificate'] && !(0, _utils.isString)(params['public_certificate']))) {
|
152
|
-
_context.next =
|
167
|
+
_context.next = 12;
|
153
168
|
break;
|
154
169
|
}
|
155
170
|
|
156
171
|
throw new Error("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(public_certificate)));
|
157
172
|
|
158
|
-
case
|
173
|
+
case 12:
|
159
174
|
if (!(params['private_key'] && !(0, _utils.isString)(params['private_key']))) {
|
160
|
-
_context.next =
|
175
|
+
_context.next = 14;
|
161
176
|
break;
|
162
177
|
}
|
163
178
|
|
164
179
|
throw new Error("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(private_key)));
|
165
180
|
|
166
|
-
case
|
181
|
+
case 14:
|
167
182
|
if (params['id']) {
|
168
|
-
_context.next =
|
183
|
+
_context.next = 20;
|
169
184
|
break;
|
170
185
|
}
|
171
186
|
|
172
187
|
if (!_this.attributes.id) {
|
173
|
-
_context.next =
|
188
|
+
_context.next = 19;
|
174
189
|
break;
|
175
190
|
}
|
176
191
|
|
177
192
|
params['id'] = _this.id;
|
178
|
-
_context.next =
|
193
|
+
_context.next = 20;
|
179
194
|
break;
|
180
195
|
|
181
|
-
case
|
196
|
+
case 19:
|
182
197
|
throw new Error('Parameter missing: id');
|
183
198
|
|
184
|
-
case
|
185
|
-
|
199
|
+
case 20:
|
200
|
+
_context.next = 22;
|
201
|
+
return _Api.default.sendRequest("/as2_stations/".concat(params['id']), 'PATCH', params, _this.options);
|
186
202
|
|
187
|
-
case
|
203
|
+
case 22:
|
204
|
+
response = _context.sent;
|
205
|
+
return _context.abrupt("return", new As2Station(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
206
|
+
|
207
|
+
case 24:
|
188
208
|
case "end":
|
189
209
|
return _context.stop();
|
190
210
|
}
|
@@ -193,6 +213,7 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
193
213
|
})));
|
194
214
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
195
215
|
var params,
|
216
|
+
response,
|
196
217
|
_args2 = arguments;
|
197
218
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
198
219
|
while (1) {
|
@@ -244,9 +265,14 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
244
265
|
throw new Error('Parameter missing: id');
|
245
266
|
|
246
267
|
case 14:
|
247
|
-
|
268
|
+
_context2.next = 16;
|
269
|
+
return _Api.default.sendRequest("/as2_stations/".concat(params['id']), 'DELETE', params, _this.options);
|
270
|
+
|
271
|
+
case 16:
|
272
|
+
response = _context2.sent;
|
273
|
+
return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
248
274
|
|
249
|
-
case
|
275
|
+
case 18:
|
250
276
|
case "end":
|
251
277
|
return _context2.stop();
|
252
278
|
}
|
@@ -414,86 +440,54 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
|
|
414
440
|
throw new Error('Parameter missing: name');
|
415
441
|
|
416
442
|
case 4:
|
417
|
-
if (params['domain']) {
|
418
|
-
_context5.next = 6;
|
419
|
-
break;
|
420
|
-
}
|
421
|
-
|
422
|
-
throw new Error('Parameter missing: domain');
|
423
|
-
|
424
|
-
case 6:
|
425
|
-
if (params['uri']) {
|
426
|
-
_context5.next = 8;
|
427
|
-
break;
|
428
|
-
}
|
429
|
-
|
430
|
-
throw new Error('Parameter missing: uri');
|
431
|
-
|
432
|
-
case 8:
|
433
443
|
if (params['public_certificate']) {
|
434
|
-
_context5.next =
|
444
|
+
_context5.next = 6;
|
435
445
|
break;
|
436
446
|
}
|
437
447
|
|
438
448
|
throw new Error('Parameter missing: public_certificate');
|
439
449
|
|
440
|
-
case
|
450
|
+
case 6:
|
441
451
|
if (params['private_key']) {
|
442
|
-
_context5.next =
|
452
|
+
_context5.next = 8;
|
443
453
|
break;
|
444
454
|
}
|
445
455
|
|
446
456
|
throw new Error('Parameter missing: private_key');
|
447
457
|
|
448
|
-
case
|
458
|
+
case 8:
|
449
459
|
if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
|
450
|
-
_context5.next =
|
460
|
+
_context5.next = 10;
|
451
461
|
break;
|
452
462
|
}
|
453
463
|
|
454
464
|
throw new Error("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(name)));
|
455
465
|
|
456
|
-
case
|
457
|
-
if (!(params['domain'] && !(0, _utils.isString)(params['domain']))) {
|
458
|
-
_context5.next = 16;
|
459
|
-
break;
|
460
|
-
}
|
461
|
-
|
462
|
-
throw new Error("Bad parameter: domain must be of type String, received ".concat((0, _utils.getType)(domain)));
|
463
|
-
|
464
|
-
case 16:
|
465
|
-
if (!(params['uri'] && !(0, _utils.isString)(params['uri']))) {
|
466
|
-
_context5.next = 18;
|
467
|
-
break;
|
468
|
-
}
|
469
|
-
|
470
|
-
throw new Error("Bad parameter: uri must be of type String, received ".concat((0, _utils.getType)(uri)));
|
471
|
-
|
472
|
-
case 18:
|
466
|
+
case 10:
|
473
467
|
if (!(params['public_certificate'] && !(0, _utils.isString)(params['public_certificate']))) {
|
474
|
-
_context5.next =
|
468
|
+
_context5.next = 12;
|
475
469
|
break;
|
476
470
|
}
|
477
471
|
|
478
472
|
throw new Error("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(public_certificate)));
|
479
473
|
|
480
|
-
case
|
474
|
+
case 12:
|
481
475
|
if (!(params['private_key'] && !(0, _utils.isString)(params['private_key']))) {
|
482
|
-
_context5.next =
|
476
|
+
_context5.next = 14;
|
483
477
|
break;
|
484
478
|
}
|
485
479
|
|
486
480
|
throw new Error("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(private_key)));
|
487
481
|
|
488
|
-
case
|
489
|
-
_context5.next =
|
482
|
+
case 14:
|
483
|
+
_context5.next = 16;
|
490
484
|
return _Api.default.sendRequest("/as2_stations", 'POST', params, options);
|
491
485
|
|
492
|
-
case
|
486
|
+
case 16:
|
493
487
|
response = _context5.sent;
|
494
488
|
return _context5.abrupt("return", new As2Station(response === null || response === void 0 ? void 0 : response.data, options));
|
495
489
|
|
496
|
-
case
|
490
|
+
case 18:
|
497
491
|
case "end":
|
498
492
|
return _context5.stop();
|
499
493
|
}
|
package/lib/models/Automation.js
CHANGED
@@ -157,6 +157,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
157
157
|
});
|
158
158
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
159
159
|
var params,
|
160
|
+
response,
|
160
161
|
_args = arguments;
|
161
162
|
return _regenerator.default.wrap(function _callee$(_context) {
|
162
163
|
while (1) {
|
@@ -338,9 +339,14 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
338
339
|
throw new Error('Parameter missing: automation');
|
339
340
|
|
340
341
|
case 48:
|
341
|
-
|
342
|
+
_context.next = 50;
|
343
|
+
return _Api.default.sendRequest("/automations/".concat(params['id']), 'PATCH', params, _this.options);
|
344
|
+
|
345
|
+
case 50:
|
346
|
+
response = _context.sent;
|
347
|
+
return _context.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
342
348
|
|
343
|
-
case
|
349
|
+
case 52:
|
344
350
|
case "end":
|
345
351
|
return _context.stop();
|
346
352
|
}
|
@@ -349,6 +355,7 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
349
355
|
})));
|
350
356
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
351
357
|
var params,
|
358
|
+
response,
|
352
359
|
_args2 = arguments;
|
353
360
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
354
361
|
while (1) {
|
@@ -400,9 +407,14 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
|
|
400
407
|
throw new Error('Parameter missing: id');
|
401
408
|
|
402
409
|
case 14:
|
403
|
-
|
410
|
+
_context2.next = 16;
|
411
|
+
return _Api.default.sendRequest("/automations/".concat(params['id']), 'DELETE', params, _this.options);
|
404
412
|
|
405
|
-
case
|
413
|
+
case 16:
|
414
|
+
response = _context2.sent;
|
415
|
+
return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
416
|
+
|
417
|
+
case 18:
|
406
418
|
case "end":
|
407
419
|
return _context2.stop();
|
408
420
|
}
|
package/lib/models/Behavior.js
CHANGED
@@ -97,6 +97,7 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
97
97
|
});
|
98
98
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
99
99
|
var params,
|
100
|
+
response,
|
100
101
|
_args = arguments;
|
101
102
|
return _regenerator.default.wrap(function _callee$(_context) {
|
102
103
|
while (1) {
|
@@ -188,9 +189,14 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
188
189
|
throw new Error('Parameter missing: id');
|
189
190
|
|
190
191
|
case 24:
|
191
|
-
|
192
|
+
_context.next = 26;
|
193
|
+
return _Api.default.sendRequest("/behaviors/".concat(params['id']), 'PATCH', params, _this.options);
|
194
|
+
|
195
|
+
case 26:
|
196
|
+
response = _context.sent;
|
197
|
+
return _context.abrupt("return", new Behavior(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
192
198
|
|
193
|
-
case
|
199
|
+
case 28:
|
194
200
|
case "end":
|
195
201
|
return _context.stop();
|
196
202
|
}
|
@@ -199,6 +205,7 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
199
205
|
})));
|
200
206
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
201
207
|
var params,
|
208
|
+
response,
|
202
209
|
_args2 = arguments;
|
203
210
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
204
211
|
while (1) {
|
@@ -250,9 +257,14 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
|
|
250
257
|
throw new Error('Parameter missing: id');
|
251
258
|
|
252
259
|
case 14:
|
253
|
-
|
260
|
+
_context2.next = 16;
|
261
|
+
return _Api.default.sendRequest("/behaviors/".concat(params['id']), 'DELETE', params, _this.options);
|
254
262
|
|
255
|
-
case
|
263
|
+
case 16:
|
264
|
+
response = _context2.sent;
|
265
|
+
return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
266
|
+
|
267
|
+
case 18:
|
256
268
|
case "end":
|
257
269
|
return _context2.stop();
|
258
270
|
}
|
package/lib/models/Bundle.js
CHANGED
@@ -196,6 +196,7 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
196
196
|
});
|
197
197
|
(0, _defineProperty2.default)(this, "share", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
198
198
|
var params,
|
199
|
+
response,
|
199
200
|
_args = arguments;
|
200
201
|
return _regenerator.default.wrap(function _callee$(_context) {
|
201
202
|
while (1) {
|
@@ -271,9 +272,14 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
271
272
|
throw new Error('Parameter missing: id');
|
272
273
|
|
273
274
|
case 20:
|
274
|
-
|
275
|
+
_context.next = 22;
|
276
|
+
return _Api.default.sendRequest("/bundles/".concat(params['id'], "/share"), 'POST', params, _this.options);
|
277
|
+
|
278
|
+
case 22:
|
279
|
+
response = _context.sent;
|
280
|
+
return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
275
281
|
|
276
|
-
case
|
282
|
+
case 24:
|
277
283
|
case "end":
|
278
284
|
return _context.stop();
|
279
285
|
}
|
@@ -282,6 +288,7 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
282
288
|
})));
|
283
289
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
284
290
|
var params,
|
291
|
+
response,
|
285
292
|
_args2 = arguments;
|
286
293
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
287
294
|
while (1) {
|
@@ -413,9 +420,14 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
413
420
|
throw new Error('Parameter missing: id');
|
414
421
|
|
415
422
|
case 34:
|
416
|
-
|
423
|
+
_context2.next = 36;
|
424
|
+
return _Api.default.sendRequest("/bundles/".concat(params['id']), 'PATCH', params, _this.options);
|
417
425
|
|
418
|
-
case
|
426
|
+
case 36:
|
427
|
+
response = _context2.sent;
|
428
|
+
return _context2.abrupt("return", new Bundle(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
429
|
+
|
430
|
+
case 38:
|
419
431
|
case "end":
|
420
432
|
return _context2.stop();
|
421
433
|
}
|
@@ -424,6 +436,7 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
424
436
|
})));
|
425
437
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
426
438
|
var params,
|
439
|
+
response,
|
427
440
|
_args3 = arguments;
|
428
441
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
429
442
|
while (1) {
|
@@ -475,9 +488,14 @@ var Bundle = /*#__PURE__*/(0, _createClass2.default)(function Bundle() {
|
|
475
488
|
throw new Error('Parameter missing: id');
|
476
489
|
|
477
490
|
case 14:
|
478
|
-
|
491
|
+
_context3.next = 16;
|
492
|
+
return _Api.default.sendRequest("/bundles/".concat(params['id']), 'DELETE', params, _this.options);
|
479
493
|
|
480
|
-
case
|
494
|
+
case 16:
|
495
|
+
response = _context3.sent;
|
496
|
+
return _context3.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
497
|
+
|
498
|
+
case 18:
|
481
499
|
case "end":
|
482
500
|
return _context3.stop();
|
483
501
|
}
|