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
package/src/models/GroupUser.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 GroupUser
|
@@ -81,13 +82,13 @@ class GroupUser {
|
|
81
82
|
|
82
83
|
params.id = this.attributes.id
|
83
84
|
if (params['id'] && !isInt(params['id'])) {
|
84
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
85
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
85
86
|
}
|
86
87
|
if (params['group_id'] && !isInt(params['group_id'])) {
|
87
|
-
throw new errors.InvalidParameterError(`Bad parameter: group_id must be of type Int, received ${getType(group_id)}`)
|
88
|
+
throw new errors.InvalidParameterError(`Bad parameter: group_id must be of type Int, received ${getType(params['group_id'])}`)
|
88
89
|
}
|
89
90
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
90
|
-
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
91
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params['user_id'])}`)
|
91
92
|
}
|
92
93
|
|
93
94
|
if (!params['id']) {
|
@@ -116,6 +117,7 @@ class GroupUser {
|
|
116
117
|
|
117
118
|
const response = await Api.sendRequest(`/group_users/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
118
119
|
|
120
|
+
|
119
121
|
return new GroupUser(response?.data, this.options)
|
120
122
|
}
|
121
123
|
|
@@ -133,13 +135,13 @@ class GroupUser {
|
|
133
135
|
|
134
136
|
params.id = this.attributes.id
|
135
137
|
if (params['id'] && !isInt(params['id'])) {
|
136
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
138
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
137
139
|
}
|
138
140
|
if (params['group_id'] && !isInt(params['group_id'])) {
|
139
|
-
throw new errors.InvalidParameterError(`Bad parameter: group_id must be of type Int, received ${getType(group_id)}`)
|
141
|
+
throw new errors.InvalidParameterError(`Bad parameter: group_id must be of type Int, received ${getType(params['group_id'])}`)
|
140
142
|
}
|
141
143
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
142
|
-
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
144
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params['user_id'])}`)
|
143
145
|
}
|
144
146
|
|
145
147
|
if (!params['id']) {
|
@@ -208,6 +210,7 @@ class GroupUser {
|
|
208
210
|
|
209
211
|
const response = await Api.sendRequest(`/group_users`, 'GET', params, options)
|
210
212
|
|
213
|
+
|
211
214
|
return response?.data?.map(obj => new GroupUser(obj, options)) || []
|
212
215
|
}
|
213
216
|
|
@@ -237,6 +240,7 @@ class GroupUser {
|
|
237
240
|
|
238
241
|
const response = await Api.sendRequest(`/group_users`, 'POST', params, options)
|
239
242
|
|
243
|
+
|
240
244
|
return new GroupUser(response?.data, options)
|
241
245
|
}
|
242
246
|
}
|
package/src/models/History.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 History
|
@@ -108,6 +109,7 @@ class History {
|
|
108
109
|
|
109
110
|
const response = await Api.sendRequest(`/history/files/${encodeURIComponent(params['path'])}`, 'GET', params, options)
|
110
111
|
|
112
|
+
const Action = require("./Action.js").default
|
111
113
|
return response?.data?.map(obj => new Action(obj, options)) || []
|
112
114
|
}
|
113
115
|
|
@@ -156,6 +158,7 @@ class History {
|
|
156
158
|
|
157
159
|
const response = await Api.sendRequest(`/history/folders/${encodeURIComponent(params['path'])}`, 'GET', params, options)
|
158
160
|
|
161
|
+
const Action = require("./Action.js").default
|
159
162
|
return response?.data?.map(obj => new Action(obj, options)) || []
|
160
163
|
}
|
161
164
|
|
@@ -167,12 +170,12 @@ class History {
|
|
167
170
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
168
171
|
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction (e.g. `sort_by[user_id]=desc`). Valid fields are `user_id` and `created_at`.
|
169
172
|
// user_id (required) - int64 - User ID.
|
170
|
-
static listForUser = async (
|
173
|
+
static listForUser = async (userId, params = {}, options = {}) => {
|
171
174
|
if (!isObject(params)) {
|
172
175
|
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
173
176
|
}
|
174
177
|
|
175
|
-
params['user_id'] =
|
178
|
+
params['user_id'] = userId
|
176
179
|
|
177
180
|
if (!params['user_id']) {
|
178
181
|
throw new errors.MissingParameterError('Parameter missing: user_id')
|
@@ -204,6 +207,7 @@ class History {
|
|
204
207
|
|
205
208
|
const response = await Api.sendRequest(`/history/users/${encodeURIComponent(params['user_id'])}`, 'GET', params, options)
|
206
209
|
|
210
|
+
const Action = require("./Action.js").default
|
207
211
|
return response?.data?.map(obj => new Action(obj, options)) || []
|
208
212
|
}
|
209
213
|
|
@@ -237,6 +241,7 @@ class History {
|
|
237
241
|
|
238
242
|
const response = await Api.sendRequest(`/history/login`, 'GET', params, options)
|
239
243
|
|
244
|
+
const Action = require("./Action.js").default
|
240
245
|
return response?.data?.map(obj => new Action(obj, options)) || []
|
241
246
|
}
|
242
247
|
|
@@ -272,6 +277,7 @@ class History {
|
|
272
277
|
|
273
278
|
const response = await Api.sendRequest(`/history`, 'GET', params, options)
|
274
279
|
|
280
|
+
const Action = require("./Action.js").default
|
275
281
|
return response?.data?.map(obj => new Action(obj, options)) || []
|
276
282
|
}
|
277
283
|
|
@@ -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 HistoryExport
|
@@ -235,6 +236,7 @@ class HistoryExport {
|
|
235
236
|
|
236
237
|
const response = await Api.sendRequest(`/history_exports/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
237
238
|
|
239
|
+
|
238
240
|
return new HistoryExport(response?.data, options)
|
239
241
|
}
|
240
242
|
|
@@ -355,6 +357,7 @@ class HistoryExport {
|
|
355
357
|
|
356
358
|
const response = await Api.sendRequest(`/history_exports`, 'POST', params, options)
|
357
359
|
|
360
|
+
|
358
361
|
return new HistoryExport(response?.data, options)
|
359
362
|
}
|
360
363
|
}
|
@@ -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 HistoryExportResult
|
@@ -127,6 +128,7 @@ class HistoryExportResult {
|
|
127
128
|
|
128
129
|
const response = await Api.sendRequest(`/history_export_results`, 'GET', params, options)
|
129
130
|
|
131
|
+
|
130
132
|
return response?.data?.map(obj => new HistoryExportResult(obj, options)) || []
|
131
133
|
}
|
132
134
|
|
package/src/models/Image.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 Image
|
@@ -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 InboxRecipient
|
@@ -108,6 +109,7 @@ class InboxRecipient {
|
|
108
109
|
|
109
110
|
const response = await Api.sendRequest(`/inbox_recipients`, 'GET', params, options)
|
110
111
|
|
112
|
+
|
111
113
|
return response?.data?.map(obj => new InboxRecipient(obj, options)) || []
|
112
114
|
}
|
113
115
|
|
@@ -152,6 +154,7 @@ class InboxRecipient {
|
|
152
154
|
|
153
155
|
const response = await Api.sendRequest(`/inbox_recipients`, 'POST', params, options)
|
154
156
|
|
157
|
+
|
155
158
|
return new InboxRecipient(response?.data, options)
|
156
159
|
}
|
157
160
|
}
|
@@ -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 InboxRegistration
|
@@ -79,6 +80,7 @@ class InboxRegistration {
|
|
79
80
|
|
80
81
|
const response = await Api.sendRequest(`/inbox_registrations`, 'GET', params, options)
|
81
82
|
|
83
|
+
|
82
84
|
return response?.data?.map(obj => new InboxRegistration(obj, options)) || []
|
83
85
|
}
|
84
86
|
|
@@ -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 InboxUpload
|
@@ -63,6 +64,7 @@ class InboxUpload {
|
|
63
64
|
|
64
65
|
const response = await Api.sendRequest(`/inbox_uploads`, 'GET', params, options)
|
65
66
|
|
67
|
+
|
66
68
|
return response?.data?.map(obj => new InboxUpload(obj, options)) || []
|
67
69
|
}
|
68
70
|
|
package/src/models/Invoice.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 Invoice
|
@@ -80,6 +81,7 @@ class Invoice {
|
|
80
81
|
|
81
82
|
const response = await Api.sendRequest(`/invoices`, '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 Invoice {
|
|
105
107
|
|
106
108
|
const response = await Api.sendRequest(`/invoices/${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 InvoiceLineItem
|
package/src/models/IpAddress.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 IpAddress
|
@@ -50,6 +51,7 @@ class IpAddress {
|
|
50
51
|
|
51
52
|
const response = await Api.sendRequest(`/ip_addresses`, 'GET', params, options)
|
52
53
|
|
54
|
+
|
53
55
|
return response?.data?.map(obj => new IpAddress(obj, options)) || []
|
54
56
|
}
|
55
57
|
|
@@ -70,6 +72,7 @@ class IpAddress {
|
|
70
72
|
|
71
73
|
const response = await Api.sendRequest(`/ip_addresses/exavault-reserved`, 'GET', params, options)
|
72
74
|
|
75
|
+
const PublicIpAddress = require("./PublicIpAddress.js").default
|
73
76
|
return response?.data?.map(obj => new PublicIpAddress(obj, options)) || []
|
74
77
|
}
|
75
78
|
|
@@ -87,6 +90,7 @@ class IpAddress {
|
|
87
90
|
|
88
91
|
const response = await Api.sendRequest(`/ip_addresses/reserved`, 'GET', params, options)
|
89
92
|
|
93
|
+
const PublicIpAddress = require("./PublicIpAddress.js").default
|
90
94
|
return response?.data?.map(obj => new PublicIpAddress(obj, options)) || []
|
91
95
|
}
|
92
96
|
}
|
package/src/models/Lock.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 Lock
|
@@ -121,10 +122,10 @@ class Lock {
|
|
121
122
|
|
122
123
|
params.path = this.attributes.path
|
123
124
|
if (params['path'] && !isString(params['path'])) {
|
124
|
-
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
125
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params['path'])}`)
|
125
126
|
}
|
126
127
|
if (params['token'] && !isString(params['token'])) {
|
127
|
-
throw new errors.InvalidParameterError(`Bad parameter: token must be of type String, received ${getType(token)}`)
|
128
|
+
throw new errors.InvalidParameterError(`Bad parameter: token must be of type String, received ${getType(params['token'])}`)
|
128
129
|
}
|
129
130
|
|
130
131
|
if (!params['path']) {
|
@@ -187,6 +188,7 @@ class Lock {
|
|
187
188
|
|
188
189
|
const response = await Api.sendRequest(`/locks/${encodeURIComponent(params['path'])}`, 'GET', params, options)
|
189
190
|
|
191
|
+
|
190
192
|
return response?.data?.map(obj => new Lock(obj, options)) || []
|
191
193
|
}
|
192
194
|
|
@@ -221,6 +223,7 @@ class Lock {
|
|
221
223
|
|
222
224
|
const response = await Api.sendRequest(`/locks/${encodeURIComponent(params['path'])}`, 'POST', params, options)
|
223
225
|
|
226
|
+
|
224
227
|
return new Lock(response?.data, options)
|
225
228
|
}
|
226
229
|
}
|
package/src/models/Message.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 Message
|
@@ -81,16 +82,16 @@ class Message {
|
|
81
82
|
|
82
83
|
params.id = this.attributes.id
|
83
84
|
if (params['id'] && !isInt(params['id'])) {
|
84
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
85
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
85
86
|
}
|
86
87
|
if (params['project_id'] && !isInt(params['project_id'])) {
|
87
|
-
throw new errors.InvalidParameterError(`Bad parameter: project_id must be of type Int, received ${getType(project_id)}`)
|
88
|
+
throw new errors.InvalidParameterError(`Bad parameter: project_id must be of type Int, received ${getType(params['project_id'])}`)
|
88
89
|
}
|
89
90
|
if (params['subject'] && !isString(params['subject'])) {
|
90
|
-
throw new errors.InvalidParameterError(`Bad parameter: subject must be of type String, received ${getType(subject)}`)
|
91
|
+
throw new errors.InvalidParameterError(`Bad parameter: subject must be of type String, received ${getType(params['subject'])}`)
|
91
92
|
}
|
92
93
|
if (params['body'] && !isString(params['body'])) {
|
93
|
-
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(body)}`)
|
94
|
+
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(params['body'])}`)
|
94
95
|
}
|
95
96
|
|
96
97
|
if (!params['id']) {
|
@@ -127,6 +128,7 @@ class Message {
|
|
127
128
|
|
128
129
|
const response = await Api.sendRequest(`/messages/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
129
130
|
|
131
|
+
|
130
132
|
return new Message(response?.data, this.options)
|
131
133
|
}
|
132
134
|
|
@@ -141,7 +143,7 @@ class Message {
|
|
141
143
|
|
142
144
|
params.id = this.attributes.id
|
143
145
|
if (params['id'] && !isInt(params['id'])) {
|
144
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
146
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
145
147
|
}
|
146
148
|
|
147
149
|
if (!params['id']) {
|
@@ -198,6 +200,7 @@ class Message {
|
|
198
200
|
|
199
201
|
const response = await Api.sendRequest(`/messages`, 'GET', params, options)
|
200
202
|
|
203
|
+
|
201
204
|
return response?.data?.map(obj => new Message(obj, options)) || []
|
202
205
|
}
|
203
206
|
|
@@ -223,6 +226,7 @@ class Message {
|
|
223
226
|
|
224
227
|
const response = await Api.sendRequest(`/messages/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
225
228
|
|
229
|
+
|
226
230
|
return new Message(response?.data, options)
|
227
231
|
}
|
228
232
|
|
@@ -265,6 +269,7 @@ class Message {
|
|
265
269
|
|
266
270
|
const response = await Api.sendRequest(`/messages`, 'POST', params, options)
|
267
271
|
|
272
|
+
|
268
273
|
return new Message(response?.data, options)
|
269
274
|
}
|
270
275
|
}
|
@@ -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 MessageComment
|
@@ -65,10 +66,10 @@ class MessageComment {
|
|
65
66
|
|
66
67
|
params.id = this.attributes.id
|
67
68
|
if (params['id'] && !isInt(params['id'])) {
|
68
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
69
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
69
70
|
}
|
70
71
|
if (params['body'] && !isString(params['body'])) {
|
71
|
-
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(body)}`)
|
72
|
+
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(params['body'])}`)
|
72
73
|
}
|
73
74
|
|
74
75
|
if (!params['id']) {
|
@@ -89,6 +90,7 @@ class MessageComment {
|
|
89
90
|
|
90
91
|
const response = await Api.sendRequest(`/message_comments/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
91
92
|
|
93
|
+
|
92
94
|
return new MessageComment(response?.data, this.options)
|
93
95
|
}
|
94
96
|
|
@@ -103,7 +105,7 @@ class MessageComment {
|
|
103
105
|
|
104
106
|
params.id = this.attributes.id
|
105
107
|
if (params['id'] && !isInt(params['id'])) {
|
106
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
108
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
107
109
|
}
|
108
110
|
|
109
111
|
if (!params['id']) {
|
@@ -160,6 +162,7 @@ class MessageComment {
|
|
160
162
|
|
161
163
|
const response = await Api.sendRequest(`/message_comments`, 'GET', params, options)
|
162
164
|
|
165
|
+
|
163
166
|
return response?.data?.map(obj => new MessageComment(obj, options)) || []
|
164
167
|
}
|
165
168
|
|
@@ -185,6 +188,7 @@ class MessageComment {
|
|
185
188
|
|
186
189
|
const response = await Api.sendRequest(`/message_comments/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
187
190
|
|
191
|
+
|
188
192
|
return new MessageComment(response?.data, options)
|
189
193
|
}
|
190
194
|
|
@@ -209,6 +213,7 @@ class MessageComment {
|
|
209
213
|
|
210
214
|
const response = await Api.sendRequest(`/message_comments`, 'POST', params, options)
|
211
215
|
|
216
|
+
|
212
217
|
return new MessageComment(response?.data, options)
|
213
218
|
}
|
214
219
|
}
|
@@ -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 MessageCommentReaction
|
@@ -56,7 +57,7 @@ class MessageCommentReaction {
|
|
56
57
|
|
57
58
|
params.id = this.attributes.id
|
58
59
|
if (params['id'] && !isInt(params['id'])) {
|
59
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
60
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
60
61
|
}
|
61
62
|
|
62
63
|
if (!params['id']) {
|
@@ -113,6 +114,7 @@ class MessageCommentReaction {
|
|
113
114
|
|
114
115
|
const response = await Api.sendRequest(`/message_comment_reactions`, 'GET', params, options)
|
115
116
|
|
117
|
+
|
116
118
|
return response?.data?.map(obj => new MessageCommentReaction(obj, options)) || []
|
117
119
|
}
|
118
120
|
|
@@ -138,6 +140,7 @@ class MessageCommentReaction {
|
|
138
140
|
|
139
141
|
const response = await Api.sendRequest(`/message_comment_reactions/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
140
142
|
|
143
|
+
|
141
144
|
return new MessageCommentReaction(response?.data, options)
|
142
145
|
}
|
143
146
|
|
@@ -162,6 +165,7 @@ class MessageCommentReaction {
|
|
162
165
|
|
163
166
|
const response = await Api.sendRequest(`/message_comment_reactions`, 'POST', params, options)
|
164
167
|
|
168
|
+
|
165
169
|
return new MessageCommentReaction(response?.data, options)
|
166
170
|
}
|
167
171
|
}
|
@@ -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 MessageReaction
|
@@ -56,7 +57,7 @@ class MessageReaction {
|
|
56
57
|
|
57
58
|
params.id = this.attributes.id
|
58
59
|
if (params['id'] && !isInt(params['id'])) {
|
59
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
60
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
60
61
|
}
|
61
62
|
|
62
63
|
if (!params['id']) {
|
@@ -113,6 +114,7 @@ class MessageReaction {
|
|
113
114
|
|
114
115
|
const response = await Api.sendRequest(`/message_reactions`, 'GET', params, options)
|
115
116
|
|
117
|
+
|
116
118
|
return response?.data?.map(obj => new MessageReaction(obj, options)) || []
|
117
119
|
}
|
118
120
|
|
@@ -138,6 +140,7 @@ class MessageReaction {
|
|
138
140
|
|
139
141
|
const response = await Api.sendRequest(`/message_reactions/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
140
142
|
|
143
|
+
|
141
144
|
return new MessageReaction(response?.data, options)
|
142
145
|
}
|
143
146
|
|
@@ -162,6 +165,7 @@ class MessageReaction {
|
|
162
165
|
|
163
166
|
const response = await Api.sendRequest(`/message_reactions`, 'POST', params, options)
|
164
167
|
|
168
|
+
|
165
169
|
return new MessageReaction(response?.data, options)
|
166
170
|
}
|
167
171
|
}
|