files.com 1.0.165 → 1.0.168
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 +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 +78 -14
- 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/ActionWebhookFailure.js +3 -1
- package/src/models/ApiKey.js +6 -2
- package/src/models/As2Partner.js +57 -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 +9 -3
- package/src/models/Clickwrap.js +6 -2
- package/src/models/File.js +26 -19
- package/src/models/FileComment.js +6 -2
- package/src/models/FileCommentReaction.js +3 -1
- package/src/models/FormFieldSet.js +6 -2
- package/src/models/Group.js +6 -2
- package/src/models/GroupUser.js +6 -2
- package/src/models/Lock.js +3 -1
- package/src/models/Message.js +6 -2
- package/src/models/MessageComment.js +6 -2
- package/src/models/MessageCommentReaction.js +3 -1
- package/src/models/MessageReaction.js +3 -1
- package/src/models/Notification.js +6 -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/SsoStrategy.js +3 -1
- package/src/models/Style.js +6 -2
- package/src/models/User.js +15 -5
- package/src/models/UserRequest.js +3 -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.168
|
@@ -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
@@ -65,12 +65,48 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
65
65
|
(0, _defineProperty2.default)(this, "setUri", function (value) {
|
66
66
|
_this.attributes.uri = value;
|
67
67
|
});
|
68
|
+
(0, _defineProperty2.default)(this, "getServerCertificate", function () {
|
69
|
+
return _this.attributes.server_certificate;
|
70
|
+
});
|
71
|
+
(0, _defineProperty2.default)(this, "setServerCertificate", function (value) {
|
72
|
+
_this.attributes.server_certificate = value;
|
73
|
+
});
|
68
74
|
(0, _defineProperty2.default)(this, "getPublicCertificateMd5", function () {
|
69
75
|
return _this.attributes.public_certificate_md5;
|
70
76
|
});
|
71
77
|
(0, _defineProperty2.default)(this, "setPublicCertificateMd5", function (value) {
|
72
78
|
_this.attributes.public_certificate_md5 = value;
|
73
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
|
+
});
|
74
110
|
(0, _defineProperty2.default)(this, "getPublicCertificate", function () {
|
75
111
|
return _this.attributes.public_certificate;
|
76
112
|
});
|
@@ -79,6 +115,7 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
79
115
|
});
|
80
116
|
(0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
81
117
|
var params,
|
118
|
+
response,
|
82
119
|
_args = arguments;
|
83
120
|
return _regenerator.default.wrap(function _callee$(_context) {
|
84
121
|
while (1) {
|
@@ -128,35 +165,48 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
128
165
|
throw new Error("Bad parameter: uri must be of type String, received ".concat((0, _utils.getType)(uri)));
|
129
166
|
|
130
167
|
case 12:
|
131
|
-
if (!(params['
|
168
|
+
if (!(params['server_certificate'] && !(0, _utils.isString)(params['server_certificate']))) {
|
132
169
|
_context.next = 14;
|
133
170
|
break;
|
134
171
|
}
|
135
172
|
|
136
|
-
throw new Error("Bad parameter:
|
173
|
+
throw new Error("Bad parameter: server_certificate must be of type String, received ".concat((0, _utils.getType)(server_certificate)));
|
137
174
|
|
138
175
|
case 14:
|
176
|
+
if (!(params['public_certificate'] && !(0, _utils.isString)(params['public_certificate']))) {
|
177
|
+
_context.next = 16;
|
178
|
+
break;
|
179
|
+
}
|
180
|
+
|
181
|
+
throw new Error("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(public_certificate)));
|
182
|
+
|
183
|
+
case 16:
|
139
184
|
if (params['id']) {
|
140
|
-
_context.next =
|
185
|
+
_context.next = 22;
|
141
186
|
break;
|
142
187
|
}
|
143
188
|
|
144
189
|
if (!_this.attributes.id) {
|
145
|
-
_context.next =
|
190
|
+
_context.next = 21;
|
146
191
|
break;
|
147
192
|
}
|
148
193
|
|
149
194
|
params['id'] = _this.id;
|
150
|
-
_context.next =
|
195
|
+
_context.next = 22;
|
151
196
|
break;
|
152
197
|
|
153
|
-
case
|
198
|
+
case 21:
|
154
199
|
throw new Error('Parameter missing: id');
|
155
200
|
|
156
|
-
case
|
157
|
-
|
201
|
+
case 22:
|
202
|
+
_context.next = 24;
|
203
|
+
return _Api.default.sendRequest("/as2_partners/".concat(params['id']), 'PATCH', params, _this.options);
|
158
204
|
|
159
|
-
case
|
205
|
+
case 24:
|
206
|
+
response = _context.sent;
|
207
|
+
return _context.abrupt("return", new As2Partner(response === null || response === void 0 ? void 0 : response.data, _this.options));
|
208
|
+
|
209
|
+
case 26:
|
160
210
|
case "end":
|
161
211
|
return _context.stop();
|
162
212
|
}
|
@@ -165,6 +215,7 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
165
215
|
})));
|
166
216
|
(0, _defineProperty2.default)(this, "delete", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
167
217
|
var params,
|
218
|
+
response,
|
168
219
|
_args2 = arguments;
|
169
220
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
170
221
|
while (1) {
|
@@ -216,9 +267,14 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
216
267
|
throw new Error('Parameter missing: id');
|
217
268
|
|
218
269
|
case 14:
|
219
|
-
|
270
|
+
_context2.next = 16;
|
271
|
+
return _Api.default.sendRequest("/as2_partners/".concat(params['id']), 'DELETE', params, _this.options);
|
272
|
+
|
273
|
+
case 16:
|
274
|
+
response = _context2.sent;
|
275
|
+
return _context2.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
|
220
276
|
|
221
|
-
case
|
277
|
+
case 18:
|
222
278
|
case "end":
|
223
279
|
return _context2.stop();
|
224
280
|
}
|
@@ -442,14 +498,22 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
|
|
442
498
|
throw new Error("Bad parameter: as2_station_id must be of type Int, received ".concat((0, _utils.getType)(as2_station_id)));
|
443
499
|
|
444
500
|
case 18:
|
445
|
-
|
446
|
-
|
501
|
+
if (!(params['server_certificate'] && !(0, _utils.isString)(params['server_certificate']))) {
|
502
|
+
_context5.next = 20;
|
503
|
+
break;
|
504
|
+
}
|
505
|
+
|
506
|
+
throw new Error("Bad parameter: server_certificate must be of type String, received ".concat((0, _utils.getType)(server_certificate)));
|
447
507
|
|
448
508
|
case 20:
|
509
|
+
_context5.next = 22;
|
510
|
+
return _Api.default.sendRequest("/as2_partners", 'POST', params, options);
|
511
|
+
|
512
|
+
case 22:
|
449
513
|
response = _context5.sent;
|
450
514
|
return _context5.abrupt("return", new As2Partner(response === null || response === void 0 ? void 0 : response.data, options));
|
451
515
|
|
452
|
-
case
|
516
|
+
case 24:
|
453
517
|
case "end":
|
454
518
|
return _context5.stop();
|
455
519
|
}
|
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
|
}
|