files.com 1.0.168 → 1.0.169

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/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.168
1
+ 1.0.169
@@ -107,6 +107,12 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
107
107
  (0, _defineProperty2.default)(this, "setPublicCertificateNotAfter", function (value) {
108
108
  _this.attributes.public_certificate_not_after = value;
109
109
  });
110
+ (0, _defineProperty2.default)(this, "getPrivateKeyPasswordMd5", function () {
111
+ return _this.attributes.private_key_password_md5;
112
+ });
113
+ (0, _defineProperty2.default)(this, "setPrivateKeyPasswordMd5", function (value) {
114
+ _this.attributes.private_key_password_md5 = value;
115
+ });
110
116
  (0, _defineProperty2.default)(this, "getPublicCertificate", function () {
111
117
  return _this.attributes.public_certificate;
112
118
  });
@@ -119,6 +125,12 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
119
125
  (0, _defineProperty2.default)(this, "setPrivateKey", function (value) {
120
126
  _this.attributes.private_key = value;
121
127
  });
128
+ (0, _defineProperty2.default)(this, "getPrivateKeyPassword", function () {
129
+ return _this.attributes.private_key_password;
130
+ });
131
+ (0, _defineProperty2.default)(this, "setPrivateKeyPassword", function (value) {
132
+ _this.attributes.private_key_password = value;
133
+ });
122
134
  (0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
123
135
  var params,
124
136
  response,
@@ -179,32 +191,40 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
179
191
  throw new Error("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(private_key)));
180
192
 
181
193
  case 14:
194
+ if (!(params['private_key_password'] && !(0, _utils.isString)(params['private_key_password']))) {
195
+ _context.next = 16;
196
+ break;
197
+ }
198
+
199
+ throw new Error("Bad parameter: private_key_password must be of type String, received ".concat((0, _utils.getType)(private_key_password)));
200
+
201
+ case 16:
182
202
  if (params['id']) {
183
- _context.next = 20;
203
+ _context.next = 22;
184
204
  break;
185
205
  }
186
206
 
187
207
  if (!_this.attributes.id) {
188
- _context.next = 19;
208
+ _context.next = 21;
189
209
  break;
190
210
  }
191
211
 
192
212
  params['id'] = _this.id;
193
- _context.next = 20;
213
+ _context.next = 22;
194
214
  break;
195
215
 
196
- case 19:
216
+ case 21:
197
217
  throw new Error('Parameter missing: id');
198
218
 
199
- case 20:
200
- _context.next = 22;
219
+ case 22:
220
+ _context.next = 24;
201
221
  return _Api.default.sendRequest("/as2_stations/".concat(params['id']), 'PATCH', params, _this.options);
202
222
 
203
- case 22:
223
+ case 24:
204
224
  response = _context.sent;
205
225
  return _context.abrupt("return", new As2Station(response === null || response === void 0 ? void 0 : response.data, _this.options));
206
226
 
207
- case 24:
227
+ case 26:
208
228
  case "end":
209
229
  return _context.stop();
210
230
  }
@@ -480,14 +500,22 @@ var As2Station = /*#__PURE__*/(0, _createClass2.default)(function As2Station() {
480
500
  throw new Error("Bad parameter: private_key must be of type String, received ".concat((0, _utils.getType)(private_key)));
481
501
 
482
502
  case 14:
483
- _context5.next = 16;
484
- return _Api.default.sendRequest("/as2_stations", 'POST', params, options);
503
+ if (!(params['private_key_password'] && !(0, _utils.isString)(params['private_key_password']))) {
504
+ _context5.next = 16;
505
+ break;
506
+ }
507
+
508
+ throw new Error("Bad parameter: private_key_password must be of type String, received ".concat((0, _utils.getType)(private_key_password)));
485
509
 
486
510
  case 16:
511
+ _context5.next = 18;
512
+ return _Api.default.sendRequest("/as2_stations", 'POST', params, options);
513
+
514
+ case 18:
487
515
  response = _context5.sent;
488
516
  return _context5.abrupt("return", new As2Station(response === null || response === void 0 ? void 0 : response.data, options));
489
517
 
490
- case 18:
518
+ case 20:
491
519
  case "end":
492
520
  return _context5.stop();
493
521
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.168",
3
+ "version": "1.0.169",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -37,7 +37,7 @@ class As2OutgoingMessage {
37
37
  // string # JSON Structure of the activity log.
38
38
  getActivityLog = () => this.attributes.activity_log
39
39
 
40
- // string # Result of processing. Valid values: `send_failed`, `send_success`
40
+ // string # Result of processing. Valid values: `send_failed`, `send_success`, `send_no_mdn`
41
41
  getProcessingResult = () => this.attributes.processing_result
42
42
 
43
43
  // string # AS2 Message Integrity Check
@@ -99,6 +99,13 @@ class As2Station {
99
99
  this.attributes.public_certificate_not_after = value
100
100
  }
101
101
 
102
+ // string # MD5 hash of private key password used for message security.
103
+ getPrivateKeyPasswordMd5 = () => this.attributes.private_key_password_md5
104
+
105
+ setPrivateKeyPasswordMd5 = value => {
106
+ this.attributes.private_key_password_md5 = value
107
+ }
108
+
102
109
  // string
103
110
  getPublicCertificate = () => this.attributes.public_certificate
104
111
 
@@ -113,11 +120,19 @@ class As2Station {
113
120
  this.attributes.private_key = value
114
121
  }
115
122
 
123
+ // string
124
+ getPrivateKeyPassword = () => this.attributes.private_key_password
125
+
126
+ setPrivateKeyPassword = value => {
127
+ this.attributes.private_key_password = value
128
+ }
129
+
116
130
 
117
131
  // Parameters:
118
132
  // name - string - AS2 Name
119
133
  // public_certificate - string
120
134
  // private_key - string
135
+ // private_key_password - string
121
136
  update = async (params = {}) => {
122
137
  if (!this.attributes.id) {
123
138
  throw new Error('Current object has no id')
@@ -140,6 +155,9 @@ class As2Station {
140
155
  if (params['private_key'] && !isString(params['private_key'])) {
141
156
  throw new Error(`Bad parameter: private_key must be of type String, received ${getType(private_key)}`)
142
157
  }
158
+ if (params['private_key_password'] && !isString(params['private_key_password'])) {
159
+ throw new Error(`Bad parameter: private_key_password must be of type String, received ${getType(private_key_password)}`)
160
+ }
143
161
 
144
162
  if (!params['id']) {
145
163
  if (this.attributes.id) {
@@ -243,6 +261,7 @@ class As2Station {
243
261
  // name (required) - string - AS2 Name
244
262
  // public_certificate (required) - string
245
263
  // private_key (required) - string
264
+ // private_key_password - string
246
265
  static create = async (params = {}, options = {}) => {
247
266
  if (!params['name']) {
248
267
  throw new Error('Parameter missing: name')
@@ -268,6 +287,10 @@ class As2Station {
268
287
  throw new Error(`Bad parameter: private_key must be of type String, received ${getType(private_key)}`)
269
288
  }
270
289
 
290
+ if (params['private_key_password'] && !isString(params['private_key_password'])) {
291
+ throw new Error(`Bad parameter: private_key_password must be of type String, received ${getType(private_key_password)}`)
292
+ }
293
+
271
294
  const response = await Api.sendRequest(`/as2_stations`, 'POST', params, options)
272
295
 
273
296
  return new As2Station(response?.data, options)