files.com 1.0.167 → 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/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.167
1
+ 1.0.168
@@ -65,6 +65,12 @@ 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
  });
@@ -159,40 +165,48 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
159
165
  throw new Error("Bad parameter: uri must be of type String, received ".concat((0, _utils.getType)(uri)));
160
166
 
161
167
  case 12:
162
- if (!(params['public_certificate'] && !(0, _utils.isString)(params['public_certificate']))) {
168
+ if (!(params['server_certificate'] && !(0, _utils.isString)(params['server_certificate']))) {
163
169
  _context.next = 14;
164
170
  break;
165
171
  }
166
172
 
167
- throw new Error("Bad parameter: public_certificate must be of type String, received ".concat((0, _utils.getType)(public_certificate)));
173
+ throw new Error("Bad parameter: server_certificate must be of type String, received ".concat((0, _utils.getType)(server_certificate)));
168
174
 
169
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:
170
184
  if (params['id']) {
171
- _context.next = 20;
185
+ _context.next = 22;
172
186
  break;
173
187
  }
174
188
 
175
189
  if (!_this.attributes.id) {
176
- _context.next = 19;
190
+ _context.next = 21;
177
191
  break;
178
192
  }
179
193
 
180
194
  params['id'] = _this.id;
181
- _context.next = 20;
195
+ _context.next = 22;
182
196
  break;
183
197
 
184
- case 19:
198
+ case 21:
185
199
  throw new Error('Parameter missing: id');
186
200
 
187
- case 20:
188
- _context.next = 22;
201
+ case 22:
202
+ _context.next = 24;
189
203
  return _Api.default.sendRequest("/as2_partners/".concat(params['id']), 'PATCH', params, _this.options);
190
204
 
191
- case 22:
205
+ case 24:
192
206
  response = _context.sent;
193
207
  return _context.abrupt("return", new As2Partner(response === null || response === void 0 ? void 0 : response.data, _this.options));
194
208
 
195
- case 24:
209
+ case 26:
196
210
  case "end":
197
211
  return _context.stop();
198
212
  }
@@ -484,14 +498,22 @@ var As2Partner = /*#__PURE__*/(0, _createClass2.default)(function As2Partner() {
484
498
  throw new Error("Bad parameter: as2_station_id must be of type Int, received ".concat((0, _utils.getType)(as2_station_id)));
485
499
 
486
500
  case 18:
487
- _context5.next = 20;
488
- return _Api.default.sendRequest("/as2_partners", 'POST', params, options);
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)));
489
507
 
490
508
  case 20:
509
+ _context5.next = 22;
510
+ return _Api.default.sendRequest("/as2_partners", 'POST', params, options);
511
+
512
+ case 22:
491
513
  response = _context5.sent;
492
514
  return _context5.abrupt("return", new As2Partner(response === null || response === void 0 ? void 0 : response.data, options));
493
515
 
494
- case 22:
516
+ case 24:
495
517
  case "end":
496
518
  return _context5.stop();
497
519
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.167",
3
+ "version": "1.0.168",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -50,6 +50,13 @@ class As2Partner {
50
50
  this.attributes.uri = value
51
51
  }
52
52
 
53
+ // string # Remote server certificate security setting
54
+ getServerCertificate = () => this.attributes.server_certificate
55
+
56
+ setServerCertificate = value => {
57
+ this.attributes.server_certificate = value
58
+ }
59
+
53
60
  // string # MD5 hash of public certificate used for message security.
54
61
  getPublicCertificateMd5 = () => this.attributes.public_certificate_md5
55
62
 
@@ -103,6 +110,7 @@ class As2Partner {
103
110
  // Parameters:
104
111
  // name - string - AS2 Name
105
112
  // uri - string - URL base for AS2 responses
113
+ // server_certificate - string - Remote server certificate security setting
106
114
  // public_certificate - string
107
115
  update = async (params = {}) => {
108
116
  if (!this.attributes.id) {
@@ -123,6 +131,9 @@ class As2Partner {
123
131
  if (params['uri'] && !isString(params['uri'])) {
124
132
  throw new Error(`Bad parameter: uri must be of type String, received ${getType(uri)}`)
125
133
  }
134
+ if (params['server_certificate'] && !isString(params['server_certificate'])) {
135
+ throw new Error(`Bad parameter: server_certificate must be of type String, received ${getType(server_certificate)}`)
136
+ }
126
137
  if (params['public_certificate'] && !isString(params['public_certificate'])) {
127
138
  throw new Error(`Bad parameter: public_certificate must be of type String, received ${getType(public_certificate)}`)
128
139
  }
@@ -230,6 +241,7 @@ class As2Partner {
230
241
  // uri (required) - string - URL base for AS2 responses
231
242
  // public_certificate (required) - string
232
243
  // as2_station_id (required) - int64 - Id of As2Station for this partner
244
+ // server_certificate - string - Remote server certificate security setting
233
245
  static create = async (params = {}, options = {}) => {
234
246
  if (!params['name']) {
235
247
  throw new Error('Parameter missing: name')
@@ -263,6 +275,10 @@ class As2Partner {
263
275
  throw new Error(`Bad parameter: as2_station_id must be of type Int, received ${getType(as2_station_id)}`)
264
276
  }
265
277
 
278
+ if (params['server_certificate'] && !isString(params['server_certificate'])) {
279
+ throw new Error(`Bad parameter: server_certificate must be of type String, received ${getType(server_certificate)}`)
280
+ }
281
+
266
282
  const response = await Api.sendRequest(`/as2_partners`, 'POST', params, options)
267
283
 
268
284
  return new As2Partner(response?.data, options)