files.com 1.0.421 → 1.0.423
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.js +179 -0
- package/README.md +1 -0
- package/_VERSION +1 -1
- package/lib/Api.js +14 -13
- package/lib/Errors.js +4 -2
- package/lib/Files.js +6 -6
- package/lib/Logger.js +20 -12
- package/lib/models/AccountLineItem.js +2 -2
- package/lib/models/Action.js +2 -2
- package/lib/models/ActionNotificationExport.js +2 -1
- package/lib/models/ActionNotificationExportResult.js +2 -1
- package/lib/models/ActionWebhookFailure.js +3 -3
- package/lib/models/ApiKey.js +8 -7
- package/lib/models/App.js +2 -1
- package/lib/models/As2IncomingMessage.js +2 -1
- package/lib/models/As2OutgoingMessage.js +2 -1
- package/lib/models/As2Partner.js +8 -7
- package/lib/models/As2Station.js +8 -7
- package/lib/models/Auto.js +2 -2
- package/lib/models/Automation.js +21 -20
- package/lib/models/AutomationRun.js +2 -1
- package/lib/models/BandwidthSnapshot.js +2 -1
- package/lib/models/Behavior.js +9 -8
- package/lib/models/Bundle.js +21 -20
- package/lib/models/BundleDownload.js +2 -1
- package/lib/models/BundleNotification.js +4 -3
- package/lib/models/BundleRecipient.js +2 -1
- package/lib/models/BundleRegistration.js +2 -1
- package/lib/models/Clickwrap.js +9 -8
- package/lib/models/DnsRecord.js +2 -1
- package/lib/models/EmailIncomingMessage.js +2 -1
- package/lib/models/Errors.js +2 -2
- package/lib/models/ExternalEvent.js +2 -1
- package/lib/models/File.js +51 -42
- package/lib/models/FileAction.js +2 -2
- package/lib/models/FileComment.js +5 -4
- package/lib/models/FileCommentReaction.js +3 -2
- package/lib/models/FileMigration.js +2 -1
- package/lib/models/FileUploadPart.js +2 -2
- package/lib/models/Folder.js +10 -7
- package/lib/models/FormField.js +2 -2
- package/lib/models/FormFieldSet.js +6 -5
- package/lib/models/GpgKey.js +8 -7
- package/lib/models/Group.js +8 -7
- package/lib/models/GroupUser.js +8 -7
- package/lib/models/History.js +19 -8
- package/lib/models/HistoryExport.js +2 -1
- package/lib/models/HistoryExportResult.js +2 -1
- package/lib/models/Image.js +2 -2
- package/lib/models/InboxRecipient.js +2 -1
- package/lib/models/InboxRegistration.js +2 -1
- package/lib/models/InboxUpload.js +2 -1
- package/lib/models/Invoice.js +8 -3
- package/lib/models/InvoiceLineItem.js +2 -2
- package/lib/models/IpAddress.js +8 -3
- package/lib/models/Lock.js +4 -3
- package/lib/models/Message.js +7 -6
- package/lib/models/MessageComment.js +5 -4
- package/lib/models/MessageCommentReaction.js +3 -2
- package/lib/models/MessageReaction.js +3 -2
- package/lib/models/Notification.js +9 -8
- package/lib/models/Payment.js +8 -3
- package/lib/models/PaymentLineItem.js +2 -2
- package/lib/models/Permission.js +3 -2
- package/lib/models/Preview.js +2 -2
- package/lib/models/Priority.js +2 -1
- package/lib/models/Project.js +5 -4
- package/lib/models/PublicIpAddress.js +2 -2
- package/lib/models/PublicKey.js +5 -4
- package/lib/models/RemoteBandwidthSnapshot.js +2 -1
- package/lib/models/RemoteServer.js +81 -76
- package/lib/models/RemoteServerConfigurationFile.js +2 -2
- package/lib/models/Request.js +3 -2
- package/lib/models/Session.js +2 -1
- package/lib/models/SettingsChange.js +2 -1
- package/lib/models/SftpHostKey.js +6 -5
- package/lib/models/ShareGroup.js +7 -6
- package/lib/models/ShareGroupMember.js +2 -2
- package/lib/models/Site.js +5 -2
- package/lib/models/Snapshot.js +7 -6
- package/lib/models/SsoStrategy.js +3 -2
- package/lib/models/Status.js +2 -2
- package/lib/models/Style.js +4 -3
- package/lib/models/UsageDailySnapshot.js +2 -1
- package/lib/models/UsageSnapshot.js +2 -1
- package/lib/models/User.js +33 -32
- package/lib/models/UserCipherUse.js +2 -1
- package/lib/models/UserRequest.js +3 -2
- package/lib/models/WebhookTest.js +2 -1
- package/lib/utils/pathNormalizer.js +2 -2
- package/lib/utils/pathNormalizer.test.js +1 -1
- package/lib/utils.js +2 -0
- package/package.json +7 -1
- package/src/Api.js +17 -13
- package/src/Errors.js +2 -1
- package/src/Files.js +16 -6
- package/src/Logger.js +16 -16
- package/src/isomorphic/File.node.js +7 -7
- package/src/models/AccountLineItem.js +3 -2
- package/src/models/Action.js +3 -2
- package/src/models/ActionNotificationExport.js +5 -2
- package/src/models/ActionNotificationExportResult.js +4 -2
- package/src/models/ActionWebhookFailure.js +4 -3
- package/src/models/ApiKey.js +15 -8
- package/src/models/App.js +4 -2
- package/src/models/As2IncomingMessage.js +4 -2
- package/src/models/As2OutgoingMessage.js +4 -2
- package/src/models/As2Partner.js +13 -8
- package/src/models/As2Station.js +13 -8
- package/src/models/Auto.js +3 -2
- package/src/models/Automation.js +26 -21
- package/src/models/AutomationRun.js +5 -2
- package/src/models/BandwidthSnapshot.js +4 -2
- package/src/models/Behavior.js +15 -9
- package/src/models/Bundle.js +26 -21
- package/src/models/BundleDownload.js +4 -2
- package/src/models/BundleNotification.js +9 -4
- package/src/models/BundleRecipient.js +5 -2
- package/src/models/BundleRegistration.js +4 -2
- package/src/models/Clickwrap.js +14 -9
- package/src/models/DnsRecord.js +4 -2
- package/src/models/EmailIncomingMessage.js +4 -2
- package/src/models/Errors.js +3 -2
- package/src/models/ExternalEvent.js +6 -2
- package/src/models/File.js +39 -28
- package/src/models/FileAction.js +3 -2
- package/src/models/FileComment.js +9 -5
- package/src/models/FileCommentReaction.js +5 -3
- package/src/models/FileMigration.js +4 -2
- package/src/models/FileUploadPart.js +3 -2
- package/src/models/Folder.js +5 -3
- package/src/models/FormField.js +3 -2
- package/src/models/FormFieldSet.js +11 -6
- package/src/models/GpgKey.js +13 -8
- package/src/models/Group.js +13 -8
- package/src/models/GroupUser.js +12 -8
- package/src/models/History.js +10 -4
- package/src/models/HistoryExport.js +5 -2
- package/src/models/HistoryExportResult.js +4 -2
- package/src/models/Image.js +3 -2
- package/src/models/InboxRecipient.js +5 -2
- package/src/models/InboxRegistration.js +4 -2
- package/src/models/InboxUpload.js +4 -2
- package/src/models/Invoice.js +5 -2
- package/src/models/InvoiceLineItem.js +3 -2
- package/src/models/IpAddress.js +6 -2
- package/src/models/Lock.js +7 -4
- package/src/models/Message.js +12 -7
- package/src/models/MessageComment.js +10 -5
- package/src/models/MessageCommentReaction.js +7 -3
- package/src/models/MessageReaction.js +7 -3
- package/src/models/Notification.js +14 -9
- package/src/models/Payment.js +5 -2
- package/src/models/PaymentLineItem.js +3 -2
- package/src/models/Permission.js +6 -3
- package/src/models/Preview.js +3 -2
- package/src/models/Priority.js +4 -2
- package/src/models/Project.js +10 -5
- package/src/models/PublicIpAddress.js +3 -2
- package/src/models/PublicKey.js +10 -5
- package/src/models/RemoteBandwidthSnapshot.js +4 -2
- package/src/models/RemoteServer.js +82 -75
- package/src/models/RemoteServerConfigurationFile.js +3 -2
- package/src/models/Request.js +7 -3
- package/src/models/Session.js +4 -2
- package/src/models/SettingsChange.js +4 -2
- package/src/models/SftpHostKey.js +11 -6
- package/src/models/ShareGroup.js +12 -7
- package/src/models/ShareGroupMember.js +3 -2
- package/src/models/Site.js +6 -2
- package/src/models/Snapshot.js +12 -7
- package/src/models/SsoStrategy.js +6 -3
- package/src/models/Status.js +3 -2
- package/src/models/Style.js +7 -4
- package/src/models/UsageDailySnapshot.js +4 -2
- package/src/models/UsageSnapshot.js +4 -2
- package/src/models/User.js +38 -33
- package/src/models/UserCipherUse.js +4 -2
- package/src/models/UserRequest.js +7 -3
- package/src/models/WebhookTest.js +4 -2
- package/src/utils/pathNormalizer.js +1 -1
- package/src/utils/pathNormalizer.test.js +2 -2
- package/src/utils.js +6 -5
- package/test.sh +10 -0
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class Notification
|
@@ -203,22 +204,22 @@ class Notification {
|
|
203
204
|
|
204
205
|
params.id = this.attributes.id
|
205
206
|
if (params['id'] && !isInt(params['id'])) {
|
206
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
207
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
207
208
|
}
|
208
209
|
if (params['send_interval'] && !isString(params['send_interval'])) {
|
209
|
-
throw new errors.InvalidParameterError(`Bad parameter: send_interval must be of type String, received ${getType(send_interval)}`)
|
210
|
+
throw new errors.InvalidParameterError(`Bad parameter: send_interval must be of type String, received ${getType(params['send_interval'])}`)
|
210
211
|
}
|
211
212
|
if (params['message'] && !isString(params['message'])) {
|
212
|
-
throw new errors.InvalidParameterError(`Bad parameter: message must be of type String, received ${getType(message)}`)
|
213
|
+
throw new errors.InvalidParameterError(`Bad parameter: message must be of type String, received ${getType(params['message'])}`)
|
213
214
|
}
|
214
215
|
if (params['triggering_filenames'] && !isArray(params['triggering_filenames'])) {
|
215
|
-
throw new errors.InvalidParameterError(`Bad parameter: triggering_filenames must be of type Array, received ${getType(triggering_filenames)}`)
|
216
|
+
throw new errors.InvalidParameterError(`Bad parameter: triggering_filenames must be of type Array, received ${getType(params['triggering_filenames'])}`)
|
216
217
|
}
|
217
218
|
if (params['triggering_group_ids'] && !isArray(params['triggering_group_ids'])) {
|
218
|
-
throw new errors.InvalidParameterError(`Bad parameter: triggering_group_ids must be of type Array, received ${getType(triggering_group_ids)}`)
|
219
|
+
throw new errors.InvalidParameterError(`Bad parameter: triggering_group_ids must be of type Array, received ${getType(params['triggering_group_ids'])}`)
|
219
220
|
}
|
220
221
|
if (params['triggering_user_ids'] && !isArray(params['triggering_user_ids'])) {
|
221
|
-
throw new errors.InvalidParameterError(`Bad parameter: triggering_user_ids must be of type Array, received ${getType(triggering_user_ids)}`)
|
222
|
+
throw new errors.InvalidParameterError(`Bad parameter: triggering_user_ids must be of type Array, received ${getType(params['triggering_user_ids'])}`)
|
222
223
|
}
|
223
224
|
|
224
225
|
if (!params['id']) {
|
@@ -231,6 +232,7 @@ class Notification {
|
|
231
232
|
|
232
233
|
const response = await Api.sendRequest(`/notifications/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
233
234
|
|
235
|
+
|
234
236
|
return new Notification(response?.data, this.options)
|
235
237
|
}
|
236
238
|
|
@@ -245,7 +247,7 @@ class Notification {
|
|
245
247
|
|
246
248
|
params.id = this.attributes.id
|
247
249
|
if (params['id'] && !isInt(params['id'])) {
|
248
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
250
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
249
251
|
}
|
250
252
|
|
251
253
|
if (!params['id']) {
|
@@ -307,6 +309,7 @@ class Notification {
|
|
307
309
|
|
308
310
|
const response = await Api.sendRequest(`/notifications`, 'GET', params, options)
|
309
311
|
|
312
|
+
|
310
313
|
return response?.data?.map(obj => new Notification(obj, options)) || []
|
311
314
|
}
|
312
315
|
|
@@ -332,6 +335,7 @@ class Notification {
|
|
332
335
|
|
333
336
|
const response = await Api.sendRequest(`/notifications/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
334
337
|
|
338
|
+
|
335
339
|
return new Notification(response?.data, options)
|
336
340
|
}
|
337
341
|
|
@@ -395,6 +399,7 @@ class Notification {
|
|
395
399
|
|
396
400
|
const response = await Api.sendRequest(`/notifications`, 'POST', params, options)
|
397
401
|
|
402
|
+
|
398
403
|
return new Notification(response?.data, options)
|
399
404
|
}
|
400
405
|
}
|
package/src/models/Payment.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class Payment
|
@@ -80,6 +81,7 @@ class Payment {
|
|
80
81
|
|
81
82
|
const response = await Api.sendRequest(`/payments`, 'GET', params, options)
|
82
83
|
|
84
|
+
const AccountLineItem = require("./AccountLineItem.js").default
|
83
85
|
return response?.data?.map(obj => new AccountLineItem(obj, options)) || []
|
84
86
|
}
|
85
87
|
|
@@ -105,6 +107,7 @@ class Payment {
|
|
105
107
|
|
106
108
|
const response = await Api.sendRequest(`/payments/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
107
109
|
|
110
|
+
const AccountLineItem = require("./AccountLineItem.js").default
|
108
111
|
return new AccountLineItem(response?.data, options)
|
109
112
|
}
|
110
113
|
|
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class PaymentLineItem
|
package/src/models/Permission.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class Permission
|
@@ -91,7 +92,7 @@ class Permission {
|
|
91
92
|
|
92
93
|
params.id = this.attributes.id
|
93
94
|
if (params['id'] && !isInt(params['id'])) {
|
94
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
95
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
95
96
|
}
|
96
97
|
|
97
98
|
if (!params['id']) {
|
@@ -153,6 +154,7 @@ class Permission {
|
|
153
154
|
|
154
155
|
const response = await Api.sendRequest(`/permissions`, 'GET', params, options)
|
155
156
|
|
157
|
+
|
156
158
|
return response?.data?.map(obj => new Permission(obj, options)) || []
|
157
159
|
}
|
158
160
|
|
@@ -189,6 +191,7 @@ class Permission {
|
|
189
191
|
|
190
192
|
const response = await Api.sendRequest(`/permissions`, 'POST', params, options)
|
191
193
|
|
194
|
+
|
192
195
|
return new Permission(response?.data, options)
|
193
196
|
}
|
194
197
|
}
|
package/src/models/Preview.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class Preview
|
package/src/models/Priority.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class Priority
|
@@ -59,6 +60,7 @@ class Priority {
|
|
59
60
|
|
60
61
|
const response = await Api.sendRequest(`/priorities`, 'GET', params, options)
|
61
62
|
|
63
|
+
|
62
64
|
return response?.data?.map(obj => new Priority(obj, options)) || []
|
63
65
|
}
|
64
66
|
|
package/src/models/Project.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class Project
|
@@ -51,10 +52,10 @@ class Project {
|
|
51
52
|
|
52
53
|
params.id = this.attributes.id
|
53
54
|
if (params['id'] && !isInt(params['id'])) {
|
54
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
55
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
55
56
|
}
|
56
57
|
if (params['global_access'] && !isString(params['global_access'])) {
|
57
|
-
throw new errors.InvalidParameterError(`Bad parameter: global_access must be of type String, received ${getType(global_access)}`)
|
58
|
+
throw new errors.InvalidParameterError(`Bad parameter: global_access must be of type String, received ${getType(params['global_access'])}`)
|
58
59
|
}
|
59
60
|
|
60
61
|
if (!params['id']) {
|
@@ -75,6 +76,7 @@ class Project {
|
|
75
76
|
|
76
77
|
const response = await Api.sendRequest(`/projects/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
77
78
|
|
79
|
+
|
78
80
|
return new Project(response?.data, this.options)
|
79
81
|
}
|
80
82
|
|
@@ -89,7 +91,7 @@ class Project {
|
|
89
91
|
|
90
92
|
params.id = this.attributes.id
|
91
93
|
if (params['id'] && !isInt(params['id'])) {
|
92
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
94
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
93
95
|
}
|
94
96
|
|
95
97
|
if (!params['id']) {
|
@@ -132,6 +134,7 @@ class Project {
|
|
132
134
|
|
133
135
|
const response = await Api.sendRequest(`/projects`, 'GET', params, options)
|
134
136
|
|
137
|
+
|
135
138
|
return response?.data?.map(obj => new Project(obj, options)) || []
|
136
139
|
}
|
137
140
|
|
@@ -157,6 +160,7 @@ class Project {
|
|
157
160
|
|
158
161
|
const response = await Api.sendRequest(`/projects/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
159
162
|
|
163
|
+
|
160
164
|
return new Project(response?.data, options)
|
161
165
|
}
|
162
166
|
|
@@ -176,6 +180,7 @@ class Project {
|
|
176
180
|
|
177
181
|
const response = await Api.sendRequest(`/projects`, 'POST', params, options)
|
178
182
|
|
183
|
+
|
179
184
|
return new Project(response?.data, options)
|
180
185
|
}
|
181
186
|
}
|
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class PublicIpAddress
|
package/src/models/PublicKey.js
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class PublicKey
|
@@ -82,10 +83,10 @@ class PublicKey {
|
|
82
83
|
|
83
84
|
params.id = this.attributes.id
|
84
85
|
if (params['id'] && !isInt(params['id'])) {
|
85
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
86
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
86
87
|
}
|
87
88
|
if (params['title'] && !isString(params['title'])) {
|
88
|
-
throw new errors.InvalidParameterError(`Bad parameter: title must be of type String, received ${getType(title)}`)
|
89
|
+
throw new errors.InvalidParameterError(`Bad parameter: title must be of type String, received ${getType(params['title'])}`)
|
89
90
|
}
|
90
91
|
|
91
92
|
if (!params['id']) {
|
@@ -106,6 +107,7 @@ class PublicKey {
|
|
106
107
|
|
107
108
|
const response = await Api.sendRequest(`/public_keys/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
108
109
|
|
110
|
+
|
109
111
|
return new PublicKey(response?.data, this.options)
|
110
112
|
}
|
111
113
|
|
@@ -120,7 +122,7 @@ class PublicKey {
|
|
120
122
|
|
121
123
|
params.id = this.attributes.id
|
122
124
|
if (params['id'] && !isInt(params['id'])) {
|
123
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
125
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
124
126
|
}
|
125
127
|
|
126
128
|
if (!params['id']) {
|
@@ -168,6 +170,7 @@ class PublicKey {
|
|
168
170
|
|
169
171
|
const response = await Api.sendRequest(`/public_keys`, 'GET', params, options)
|
170
172
|
|
173
|
+
|
171
174
|
return response?.data?.map(obj => new PublicKey(obj, options)) || []
|
172
175
|
}
|
173
176
|
|
@@ -193,6 +196,7 @@ class PublicKey {
|
|
193
196
|
|
194
197
|
const response = await Api.sendRequest(`/public_keys/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
195
198
|
|
199
|
+
|
196
200
|
return new PublicKey(response?.data, options)
|
197
201
|
}
|
198
202
|
|
@@ -226,6 +230,7 @@ class PublicKey {
|
|
226
230
|
|
227
231
|
const response = await Api.sendRequest(`/public_keys`, 'POST', params, options)
|
228
232
|
|
233
|
+
|
229
234
|
return new PublicKey(response?.data, options)
|
230
235
|
}
|
231
236
|
}
|
@@ -1,7 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
5
6
|
|
6
7
|
/**
|
7
8
|
* Class RemoteBandwidthSnapshot
|
@@ -59,6 +60,7 @@ class RemoteBandwidthSnapshot {
|
|
59
60
|
|
60
61
|
const response = await Api.sendRequest(`/remote_bandwidth_snapshots`, 'GET', params, options)
|
61
62
|
|
63
|
+
|
62
64
|
return response?.data?.map(obj => new RemoteBandwidthSnapshot(obj, options)) || []
|
63
65
|
}
|
64
66
|
|