files.com 1.0.190 → 1.0.191
Sign up to get free protection for your applications and to get access to all the features.
- package/_VERSION +1 -1
- package/docs/Errors.md +186 -0
- package/docs/models/AccountLineItem.md +53 -0
- package/docs/models/Action.md +37 -0
- package/docs/models/ActionNotificationExport.md +82 -0
- package/docs/models/ActionNotificationExportResult.md +49 -0
- package/docs/models/ActionWebhookFailure.md +16 -0
- package/docs/models/ApiKey.md +183 -0
- package/docs/models/App.md +66 -0
- package/docs/models/As2IncomingMessage.md +104 -0
- package/docs/models/As2OutgoingMessage.md +96 -0
- package/docs/models/As2Partner.md +141 -0
- package/docs/models/As2Station.md +142 -0
- package/docs/models/Auto.md +11 -0
- package/docs/models/Automation.md +257 -0
- package/docs/models/AutomationRun.md +61 -0
- package/docs/models/BandwidthSnapshot.md +50 -0
- package/docs/models/Behavior.md +195 -0
- package/docs/models/Bundle.md +330 -0
- package/docs/models/BundleDownload.md +44 -0
- package/docs/models/BundleRecipient.md +76 -0
- package/docs/models/BundleRegistration.md +53 -0
- package/docs/models/Clickwrap.md +120 -0
- package/docs/models/DnsRecord.md +33 -0
- package/docs/models/Errors.md +17 -0
- package/docs/models/ExternalEvent.md +84 -0
- package/docs/models/File.md +339 -0
- package/docs/models/FileAction.md +13 -0
- package/docs/models/FileComment.md +98 -0
- package/docs/models/FileCommentReaction.md +50 -0
- package/docs/models/FileMigration.md +40 -0
- package/docs/models/FileUploadPart.md +39 -0
- package/docs/models/Folder.md +90 -0
- package/docs/models/FormField.md +29 -0
- package/docs/models/FormFieldSet.md +170 -0
- package/docs/models/Group.md +140 -0
- package/docs/models/GroupUser.md +116 -0
- package/docs/models/History.md +151 -0
- package/docs/models/HistoryExport.md +130 -0
- package/docs/models/HistoryExportResult.md +75 -0
- package/docs/models/Image.md +13 -0
- package/docs/models/InboxRecipient.md +76 -0
- package/docs/models/InboxRegistration.md +47 -0
- package/docs/models/InboxUpload.md +42 -0
- package/docs/models/Invoice.md +82 -0
- package/docs/models/InvoiceLineItem.md +27 -0
- package/docs/models/IpAddress.md +51 -0
- package/docs/models/Lock.md +92 -0
- package/docs/models/Message.md +134 -0
- package/docs/models/MessageComment.md +114 -0
- package/docs/models/MessageCommentReaction.md +79 -0
- package/docs/models/MessageReaction.md +79 -0
- package/docs/models/Notification.md +241 -0
- package/docs/models/Payment.md +82 -0
- package/docs/models/PaymentLineItem.md +19 -0
- package/docs/models/Permission.md +94 -0
- package/docs/models/Preview.md +19 -0
- package/docs/models/Priority.md +30 -0
- package/docs/models/Project.md +98 -0
- package/docs/models/PublicIpAddress.md +17 -0
- package/docs/models/PublicKey.md +112 -0
- package/docs/models/RemoteBandwidthSnapshot.md +42 -0
- package/docs/models/RemoteServer.md +385 -0
- package/docs/models/Request.md +97 -0
- package/docs/models/Session.md +50 -0
- package/docs/models/SettingsChange.md +44 -0
- package/docs/models/Site.md +607 -0
- package/docs/models/SsoStrategy.md +139 -0
- package/docs/models/Status.md +30 -0
- package/docs/models/Style.md +76 -0
- package/docs/models/UsageDailySnapshot.md +56 -0
- package/docs/models/UsageSnapshot.md +63 -0
- package/docs/models/User.md +465 -0
- package/docs/models/UserCipherUse.md +39 -0
- package/docs/models/UserRequest.md +80 -0
- package/docs/models/WebhookTest.md +59 -0
- package/lib/Api.js +12 -11
- package/lib/Errors.js +3126 -0
- package/lib/models/AccountLineItem.js +8 -0
- package/lib/models/Action.js +8 -0
- package/lib/models/ActionNotificationExport.js +21 -13
- package/lib/models/ActionNotificationExportResult.js +13 -5
- package/lib/models/ActionWebhookFailure.js +12 -4
- package/lib/models/ApiKey.js +33 -25
- package/lib/models/App.js +10 -2
- package/lib/models/As2IncomingMessage.js +11 -3
- package/lib/models/As2OutgoingMessage.js +11 -3
- package/lib/models/As2Partner.js +34 -26
- package/lib/models/As2Station.js +32 -24
- package/lib/models/Auto.js +8 -0
- package/lib/models/Automation.js +51 -43
- package/lib/models/AutomationRun.js +16 -8
- package/lib/models/BandwidthSnapshot.js +10 -2
- package/lib/models/Behavior.js +46 -38
- package/lib/models/Bundle.js +51 -43
- package/lib/models/BundleDownload.js +12 -4
- package/lib/models/BundleRecipient.js +22 -14
- package/lib/models/BundleRegistration.js +12 -4
- package/lib/models/Clickwrap.js +31 -23
- package/lib/models/DnsRecord.js +10 -2
- package/lib/models/Errors.js +8 -0
- package/lib/models/ExternalEvent.js +18 -10
- package/lib/models/File.js +68 -60
- package/lib/models/FileAction.js +8 -0
- package/lib/models/FileComment.js +27 -19
- package/lib/models/FileCommentReaction.js +18 -10
- package/lib/models/FileMigration.js +11 -3
- package/lib/models/FileUploadPart.js +8 -0
- package/lib/models/Folder.js +19 -11
- package/lib/models/FormField.js +8 -0
- package/lib/models/FormFieldSet.js +27 -19
- package/lib/models/Group.js +30 -22
- package/lib/models/GroupUser.js +32 -24
- package/lib/models/History.js +42 -34
- package/lib/models/HistoryExport.js +34 -26
- package/lib/models/HistoryExportResult.js +13 -5
- package/lib/models/Image.js +8 -0
- package/lib/models/InboxRecipient.js +22 -14
- package/lib/models/InboxRegistration.js +11 -3
- package/lib/models/InboxUpload.js +12 -4
- package/lib/models/Invoice.js +13 -5
- package/lib/models/InvoiceLineItem.js +8 -0
- package/lib/models/IpAddress.js +12 -4
- package/lib/models/Lock.js +24 -16
- package/lib/models/Message.js +37 -29
- package/lib/models/MessageComment.js +29 -21
- package/lib/models/MessageCommentReaction.js +24 -16
- package/lib/models/MessageReaction.js +24 -16
- package/lib/models/Notification.js +38 -30
- package/lib/models/Payment.js +13 -5
- package/lib/models/PaymentLineItem.js +8 -0
- package/lib/models/Permission.js +23 -15
- package/lib/models/Preview.js +8 -0
- package/lib/models/Priority.js +13 -5
- package/lib/models/Project.js +25 -17
- package/lib/models/PublicIpAddress.js +8 -0
- package/lib/models/PublicKey.js +29 -21
- package/lib/models/RemoteBandwidthSnapshot.js +10 -2
- package/lib/models/RemoteServer.js +113 -105
- package/lib/models/Request.js +27 -19
- package/lib/models/Session.js +13 -5
- package/lib/models/SettingsChange.js +10 -2
- package/lib/models/Site.js +65 -57
- package/lib/models/SsoStrategy.js +17 -9
- package/lib/models/Status.js +8 -0
- package/lib/models/Style.js +20 -12
- package/lib/models/UsageDailySnapshot.js +10 -2
- package/lib/models/UsageSnapshot.js +10 -2
- package/lib/models/User.js +85 -77
- package/lib/models/UserCipherUse.js +11 -3
- package/lib/models/UserRequest.js +24 -16
- package/lib/models/WebhookTest.js +16 -8
- package/package.json +1 -1
- package/src/Api.js +4 -8
- package/src/Errors.js +222 -0
- package/src/models/AccountLineItem.js +1 -0
- package/src/models/Action.js +1 -0
- package/src/models/ActionNotificationExport.js +14 -13
- package/src/models/ActionNotificationExportResult.js +6 -5
- package/src/models/ActionWebhookFailure.js +5 -4
- package/src/models/ApiKey.js +26 -25
- package/src/models/App.js +3 -2
- package/src/models/As2IncomingMessage.js +4 -3
- package/src/models/As2OutgoingMessage.js +4 -3
- package/src/models/As2Partner.js +27 -26
- package/src/models/As2Station.js +25 -24
- package/src/models/Auto.js +1 -0
- package/src/models/Automation.js +44 -43
- package/src/models/AutomationRun.js +9 -8
- package/src/models/BandwidthSnapshot.js +3 -2
- package/src/models/Behavior.js +39 -38
- package/src/models/Bundle.js +44 -43
- package/src/models/BundleDownload.js +5 -4
- package/src/models/BundleRecipient.js +15 -14
- package/src/models/BundleRegistration.js +5 -4
- package/src/models/Clickwrap.js +24 -23
- package/src/models/DnsRecord.js +3 -2
- package/src/models/Errors.js +1 -0
- package/src/models/ExternalEvent.js +11 -10
- package/src/models/File.js +61 -60
- package/src/models/FileAction.js +1 -0
- package/src/models/FileComment.js +20 -19
- package/src/models/FileCommentReaction.js +11 -10
- package/src/models/FileMigration.js +4 -3
- package/src/models/FileUploadPart.js +1 -0
- package/src/models/Folder.js +12 -11
- package/src/models/FormField.js +1 -0
- package/src/models/FormFieldSet.js +20 -19
- package/src/models/Group.js +23 -22
- package/src/models/GroupUser.js +25 -24
- package/src/models/History.js +35 -34
- package/src/models/HistoryExport.js +27 -26
- package/src/models/HistoryExportResult.js +6 -5
- package/src/models/Image.js +1 -0
- package/src/models/InboxRecipient.js +15 -14
- package/src/models/InboxRegistration.js +4 -3
- package/src/models/InboxUpload.js +5 -4
- package/src/models/Invoice.js +6 -5
- package/src/models/InvoiceLineItem.js +1 -0
- package/src/models/IpAddress.js +5 -4
- package/src/models/Lock.js +17 -16
- package/src/models/Message.js +30 -29
- package/src/models/MessageComment.js +22 -21
- package/src/models/MessageCommentReaction.js +17 -16
- package/src/models/MessageReaction.js +17 -16
- package/src/models/Notification.js +31 -30
- package/src/models/Payment.js +6 -5
- package/src/models/PaymentLineItem.js +1 -0
- package/src/models/Permission.js +16 -15
- package/src/models/Preview.js +1 -0
- package/src/models/Priority.js +6 -5
- package/src/models/Project.js +18 -17
- package/src/models/PublicIpAddress.js +1 -0
- package/src/models/PublicKey.js +22 -21
- package/src/models/RemoteBandwidthSnapshot.js +3 -2
- package/src/models/RemoteServer.js +106 -105
- package/src/models/Request.js +20 -19
- package/src/models/Session.js +6 -5
- package/src/models/SettingsChange.js +3 -2
- package/src/models/Site.js +58 -57
- package/src/models/SsoStrategy.js +10 -9
- package/src/models/Status.js +1 -0
- package/src/models/Style.js +13 -12
- package/src/models/UsageDailySnapshot.js +3 -2
- package/src/models/UsageSnapshot.js +3 -2
- package/src/models/User.js +78 -77
- package/src/models/UserCipherUse.js +4 -3
- package/src/models/UserRequest.js +17 -16
- package/src/models/WebhookTest.js +9 -8
- package/test/src/index.js +46 -0
package/src/models/Lock.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
2
3
|
import Logger from '../Logger'
|
3
4
|
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
5
|
|
@@ -111,26 +112,26 @@ class Lock {
|
|
111
112
|
// token (required) - string - Lock token
|
112
113
|
delete = async (params = {}) => {
|
113
114
|
if (!this.attributes.path) {
|
114
|
-
throw new
|
115
|
+
throw new errors.EmptyPropertyError('Current object has no path')
|
115
116
|
}
|
116
117
|
|
117
118
|
if (!isObject(params)) {
|
118
|
-
throw new
|
119
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
119
120
|
}
|
120
121
|
|
121
122
|
params.path = this.attributes.path
|
122
123
|
if (params['path'] && !isString(params['path'])) {
|
123
|
-
throw new
|
124
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
124
125
|
}
|
125
126
|
if (params['token'] && !isString(params['token'])) {
|
126
|
-
throw new
|
127
|
+
throw new errors.InvalidParameterError(`Bad parameter: token must be of type String, received ${getType(token)}`)
|
127
128
|
}
|
128
129
|
|
129
130
|
if (!params['path']) {
|
130
131
|
if (this.attributes.path) {
|
131
132
|
params['path'] = this.path
|
132
133
|
} else {
|
133
|
-
throw new
|
134
|
+
throw new errors.MissingParameterError('Parameter missing: path')
|
134
135
|
}
|
135
136
|
}
|
136
137
|
|
@@ -138,7 +139,7 @@ class Lock {
|
|
138
139
|
if (this.attributes.token) {
|
139
140
|
params['token'] = this.token
|
140
141
|
} else {
|
141
|
-
throw new
|
142
|
+
throw new errors.MissingParameterError('Parameter missing: token')
|
142
143
|
}
|
143
144
|
}
|
144
145
|
|
@@ -163,25 +164,25 @@ class Lock {
|
|
163
164
|
// include_children - boolean - Include locks from children objects?
|
164
165
|
static listFor = async (path, params = {}, options = {}) => {
|
165
166
|
if (!isObject(params)) {
|
166
|
-
throw new
|
167
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
167
168
|
}
|
168
169
|
|
169
170
|
params['path'] = path
|
170
171
|
|
171
172
|
if (!params['path']) {
|
172
|
-
throw new
|
173
|
+
throw new errors.MissingParameterError('Parameter missing: path')
|
173
174
|
}
|
174
175
|
|
175
176
|
if (params['cursor'] && !isString(params['cursor'])) {
|
176
|
-
throw new
|
177
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
177
178
|
}
|
178
179
|
|
179
180
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
180
|
-
throw new
|
181
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
181
182
|
}
|
182
183
|
|
183
184
|
if (params['path'] && !isString(params['path'])) {
|
184
|
-
throw new
|
185
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
185
186
|
}
|
186
187
|
|
187
188
|
const response = await Api.sendRequest(`/locks/${params['path']}`, 'GET', params, options)
|
@@ -197,25 +198,25 @@ class Lock {
|
|
197
198
|
// timeout - int64 - Lock timeout length
|
198
199
|
static create = async (path, params = {}, options = {}) => {
|
199
200
|
if (!isObject(params)) {
|
200
|
-
throw new
|
201
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
201
202
|
}
|
202
203
|
|
203
204
|
params['path'] = path
|
204
205
|
|
205
206
|
if (!params['path']) {
|
206
|
-
throw new
|
207
|
+
throw new errors.MissingParameterError('Parameter missing: path')
|
207
208
|
}
|
208
209
|
|
209
210
|
if (params['path'] && !isString(params['path'])) {
|
210
|
-
throw new
|
211
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
211
212
|
}
|
212
213
|
|
213
214
|
if (params['recursive'] && !isString(params['recursive'])) {
|
214
|
-
throw new
|
215
|
+
throw new errors.InvalidParameterError(`Bad parameter: recursive must be of type String, received ${getType(recursive)}`)
|
215
216
|
}
|
216
217
|
|
217
218
|
if (params['timeout'] && !isInt(params['timeout'])) {
|
218
|
-
throw new
|
219
|
+
throw new errors.InvalidParameterError(`Bad parameter: timeout must be of type Int, received ${getType(timeout)}`)
|
219
220
|
}
|
220
221
|
|
221
222
|
const response = await Api.sendRequest(`/locks/${params['path']}`, 'POST', params, options)
|
package/src/models/Message.js
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
2
3
|
import Logger from '../Logger'
|
3
4
|
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
5
|
|
@@ -71,32 +72,32 @@ class Message {
|
|
71
72
|
// body (required) - string - Message body.
|
72
73
|
update = async (params = {}) => {
|
73
74
|
if (!this.attributes.id) {
|
74
|
-
throw new
|
75
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
75
76
|
}
|
76
77
|
|
77
78
|
if (!isObject(params)) {
|
78
|
-
throw new
|
79
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
79
80
|
}
|
80
81
|
|
81
82
|
params.id = this.attributes.id
|
82
83
|
if (params['id'] && !isInt(params['id'])) {
|
83
|
-
throw new
|
84
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
84
85
|
}
|
85
86
|
if (params['project_id'] && !isInt(params['project_id'])) {
|
86
|
-
throw new
|
87
|
+
throw new errors.InvalidParameterError(`Bad parameter: project_id must be of type Int, received ${getType(project_id)}`)
|
87
88
|
}
|
88
89
|
if (params['subject'] && !isString(params['subject'])) {
|
89
|
-
throw new
|
90
|
+
throw new errors.InvalidParameterError(`Bad parameter: subject must be of type String, received ${getType(subject)}`)
|
90
91
|
}
|
91
92
|
if (params['body'] && !isString(params['body'])) {
|
92
|
-
throw new
|
93
|
+
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(body)}`)
|
93
94
|
}
|
94
95
|
|
95
96
|
if (!params['id']) {
|
96
97
|
if (this.attributes.id) {
|
97
98
|
params['id'] = this.id
|
98
99
|
} else {
|
99
|
-
throw new
|
100
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
100
101
|
}
|
101
102
|
}
|
102
103
|
|
@@ -104,7 +105,7 @@ class Message {
|
|
104
105
|
if (this.attributes.project_id) {
|
105
106
|
params['project_id'] = this.project_id
|
106
107
|
} else {
|
107
|
-
throw new
|
108
|
+
throw new errors.MissingParameterError('Parameter missing: project_id')
|
108
109
|
}
|
109
110
|
}
|
110
111
|
|
@@ -112,7 +113,7 @@ class Message {
|
|
112
113
|
if (this.attributes.subject) {
|
113
114
|
params['subject'] = this.subject
|
114
115
|
} else {
|
115
|
-
throw new
|
116
|
+
throw new errors.MissingParameterError('Parameter missing: subject')
|
116
117
|
}
|
117
118
|
}
|
118
119
|
|
@@ -120,7 +121,7 @@ class Message {
|
|
120
121
|
if (this.attributes.body) {
|
121
122
|
params['body'] = this.body
|
122
123
|
} else {
|
123
|
-
throw new
|
124
|
+
throw new errors.MissingParameterError('Parameter missing: body')
|
124
125
|
}
|
125
126
|
}
|
126
127
|
|
@@ -131,23 +132,23 @@ class Message {
|
|
131
132
|
|
132
133
|
delete = async (params = {}) => {
|
133
134
|
if (!this.attributes.id) {
|
134
|
-
throw new
|
135
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
135
136
|
}
|
136
137
|
|
137
138
|
if (!isObject(params)) {
|
138
|
-
throw new
|
139
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
139
140
|
}
|
140
141
|
|
141
142
|
params.id = this.attributes.id
|
142
143
|
if (params['id'] && !isInt(params['id'])) {
|
143
|
-
throw new
|
144
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
144
145
|
}
|
145
146
|
|
146
147
|
if (!params['id']) {
|
147
148
|
if (this.attributes.id) {
|
148
149
|
params['id'] = this.id
|
149
150
|
} else {
|
150
|
-
throw new
|
151
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
151
152
|
}
|
152
153
|
}
|
153
154
|
|
@@ -176,23 +177,23 @@ class Message {
|
|
176
177
|
// project_id (required) - int64 - Project for which to return messages.
|
177
178
|
static list = async (params = {}, options = {}) => {
|
178
179
|
if (!params['project_id']) {
|
179
|
-
throw new
|
180
|
+
throw new errors.MissingParameterError('Parameter missing: project_id')
|
180
181
|
}
|
181
182
|
|
182
183
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
183
|
-
throw new
|
184
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
184
185
|
}
|
185
186
|
|
186
187
|
if (params['cursor'] && !isString(params['cursor'])) {
|
187
|
-
throw new
|
188
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
188
189
|
}
|
189
190
|
|
190
191
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
191
|
-
throw new
|
192
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
192
193
|
}
|
193
194
|
|
194
195
|
if (params['project_id'] && !isInt(params['project_id'])) {
|
195
|
-
throw new
|
196
|
+
throw new errors.InvalidParameterError(`Bad parameter: project_id must be of type Int, received ${getType(project_id)}`)
|
196
197
|
}
|
197
198
|
|
198
199
|
const response = await Api.sendRequest(`/messages`, 'GET', params, options)
|
@@ -207,17 +208,17 @@ class Message {
|
|
207
208
|
// id (required) - int64 - Message ID.
|
208
209
|
static find = async (id, params = {}, options = {}) => {
|
209
210
|
if (!isObject(params)) {
|
210
|
-
throw new
|
211
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
211
212
|
}
|
212
213
|
|
213
214
|
params['id'] = id
|
214
215
|
|
215
216
|
if (!params['id']) {
|
216
|
-
throw new
|
217
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
217
218
|
}
|
218
219
|
|
219
220
|
if (params['id'] && !isInt(params['id'])) {
|
220
|
-
throw new
|
221
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
221
222
|
}
|
222
223
|
|
223
224
|
const response = await Api.sendRequest(`/messages/${params['id']}`, 'GET', params, options)
|
@@ -235,31 +236,31 @@ class Message {
|
|
235
236
|
// body (required) - string - Message body.
|
236
237
|
static create = async (params = {}, options = {}) => {
|
237
238
|
if (!params['project_id']) {
|
238
|
-
throw new
|
239
|
+
throw new errors.MissingParameterError('Parameter missing: project_id')
|
239
240
|
}
|
240
241
|
|
241
242
|
if (!params['subject']) {
|
242
|
-
throw new
|
243
|
+
throw new errors.MissingParameterError('Parameter missing: subject')
|
243
244
|
}
|
244
245
|
|
245
246
|
if (!params['body']) {
|
246
|
-
throw new
|
247
|
+
throw new errors.MissingParameterError('Parameter missing: body')
|
247
248
|
}
|
248
249
|
|
249
250
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
250
|
-
throw new
|
251
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
251
252
|
}
|
252
253
|
|
253
254
|
if (params['project_id'] && !isInt(params['project_id'])) {
|
254
|
-
throw new
|
255
|
+
throw new errors.InvalidParameterError(`Bad parameter: project_id must be of type Int, received ${getType(project_id)}`)
|
255
256
|
}
|
256
257
|
|
257
258
|
if (params['subject'] && !isString(params['subject'])) {
|
258
|
-
throw new
|
259
|
+
throw new errors.InvalidParameterError(`Bad parameter: subject must be of type String, received ${getType(subject)}`)
|
259
260
|
}
|
260
261
|
|
261
262
|
if (params['body'] && !isString(params['body'])) {
|
262
|
-
throw new
|
263
|
+
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(body)}`)
|
263
264
|
}
|
264
265
|
|
265
266
|
const response = await Api.sendRequest(`/messages`, 'POST', params, options)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
2
3
|
import Logger from '../Logger'
|
3
4
|
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
5
|
|
@@ -55,26 +56,26 @@ class MessageComment {
|
|
55
56
|
// body (required) - string - Comment body.
|
56
57
|
update = async (params = {}) => {
|
57
58
|
if (!this.attributes.id) {
|
58
|
-
throw new
|
59
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
59
60
|
}
|
60
61
|
|
61
62
|
if (!isObject(params)) {
|
62
|
-
throw new
|
63
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
63
64
|
}
|
64
65
|
|
65
66
|
params.id = this.attributes.id
|
66
67
|
if (params['id'] && !isInt(params['id'])) {
|
67
|
-
throw new
|
68
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
68
69
|
}
|
69
70
|
if (params['body'] && !isString(params['body'])) {
|
70
|
-
throw new
|
71
|
+
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(body)}`)
|
71
72
|
}
|
72
73
|
|
73
74
|
if (!params['id']) {
|
74
75
|
if (this.attributes.id) {
|
75
76
|
params['id'] = this.id
|
76
77
|
} else {
|
77
|
-
throw new
|
78
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
78
79
|
}
|
79
80
|
}
|
80
81
|
|
@@ -82,7 +83,7 @@ class MessageComment {
|
|
82
83
|
if (this.attributes.body) {
|
83
84
|
params['body'] = this.body
|
84
85
|
} else {
|
85
|
-
throw new
|
86
|
+
throw new errors.MissingParameterError('Parameter missing: body')
|
86
87
|
}
|
87
88
|
}
|
88
89
|
|
@@ -93,23 +94,23 @@ class MessageComment {
|
|
93
94
|
|
94
95
|
delete = async (params = {}) => {
|
95
96
|
if (!this.attributes.id) {
|
96
|
-
throw new
|
97
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
97
98
|
}
|
98
99
|
|
99
100
|
if (!isObject(params)) {
|
100
|
-
throw new
|
101
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
101
102
|
}
|
102
103
|
|
103
104
|
params.id = this.attributes.id
|
104
105
|
if (params['id'] && !isInt(params['id'])) {
|
105
|
-
throw new
|
106
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
106
107
|
}
|
107
108
|
|
108
109
|
if (!params['id']) {
|
109
110
|
if (this.attributes.id) {
|
110
111
|
params['id'] = this.id
|
111
112
|
} else {
|
112
|
-
throw new
|
113
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
113
114
|
}
|
114
115
|
}
|
115
116
|
|
@@ -138,23 +139,23 @@ class MessageComment {
|
|
138
139
|
// message_id (required) - int64 - Message comment to return comments for.
|
139
140
|
static list = async (params = {}, options = {}) => {
|
140
141
|
if (!params['message_id']) {
|
141
|
-
throw new
|
142
|
+
throw new errors.MissingParameterError('Parameter missing: message_id')
|
142
143
|
}
|
143
144
|
|
144
145
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
145
|
-
throw new
|
146
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
146
147
|
}
|
147
148
|
|
148
149
|
if (params['cursor'] && !isString(params['cursor'])) {
|
149
|
-
throw new
|
150
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
150
151
|
}
|
151
152
|
|
152
153
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
153
|
-
throw new
|
154
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
154
155
|
}
|
155
156
|
|
156
157
|
if (params['message_id'] && !isInt(params['message_id'])) {
|
157
|
-
throw new
|
158
|
+
throw new errors.InvalidParameterError(`Bad parameter: message_id must be of type Int, received ${getType(message_id)}`)
|
158
159
|
}
|
159
160
|
|
160
161
|
const response = await Api.sendRequest(`/message_comments`, 'GET', params, options)
|
@@ -169,17 +170,17 @@ class MessageComment {
|
|
169
170
|
// id (required) - int64 - Message Comment ID.
|
170
171
|
static find = async (id, params = {}, options = {}) => {
|
171
172
|
if (!isObject(params)) {
|
172
|
-
throw new
|
173
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
173
174
|
}
|
174
175
|
|
175
176
|
params['id'] = id
|
176
177
|
|
177
178
|
if (!params['id']) {
|
178
|
-
throw new
|
179
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
179
180
|
}
|
180
181
|
|
181
182
|
if (params['id'] && !isInt(params['id'])) {
|
182
|
-
throw new
|
183
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
183
184
|
}
|
184
185
|
|
185
186
|
const response = await Api.sendRequest(`/message_comments/${params['id']}`, 'GET', params, options)
|
@@ -195,15 +196,15 @@ class MessageComment {
|
|
195
196
|
// body (required) - string - Comment body.
|
196
197
|
static create = async (params = {}, options = {}) => {
|
197
198
|
if (!params['body']) {
|
198
|
-
throw new
|
199
|
+
throw new errors.MissingParameterError('Parameter missing: body')
|
199
200
|
}
|
200
201
|
|
201
202
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
202
|
-
throw new
|
203
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
203
204
|
}
|
204
205
|
|
205
206
|
if (params['body'] && !isString(params['body'])) {
|
206
|
-
throw new
|
207
|
+
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(body)}`)
|
207
208
|
}
|
208
209
|
|
209
210
|
const response = await Api.sendRequest(`/message_comments`, 'POST', params, options)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
2
3
|
import Logger from '../Logger'
|
3
4
|
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
5
|
|
@@ -46,23 +47,23 @@ class MessageCommentReaction {
|
|
46
47
|
|
47
48
|
delete = async (params = {}) => {
|
48
49
|
if (!this.attributes.id) {
|
49
|
-
throw new
|
50
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
50
51
|
}
|
51
52
|
|
52
53
|
if (!isObject(params)) {
|
53
|
-
throw new
|
54
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
54
55
|
}
|
55
56
|
|
56
57
|
params.id = this.attributes.id
|
57
58
|
if (params['id'] && !isInt(params['id'])) {
|
58
|
-
throw new
|
59
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
59
60
|
}
|
60
61
|
|
61
62
|
if (!params['id']) {
|
62
63
|
if (this.attributes.id) {
|
63
64
|
params['id'] = this.id
|
64
65
|
} else {
|
65
|
-
throw new
|
66
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
66
67
|
}
|
67
68
|
}
|
68
69
|
|
@@ -76,7 +77,7 @@ class MessageCommentReaction {
|
|
76
77
|
|
77
78
|
save = () => {
|
78
79
|
if (this.attributes['id']) {
|
79
|
-
throw new
|
80
|
+
throw new errors.NotImplementedError('The MessageCommentReaction object doesn\'t support updates.')
|
80
81
|
} else {
|
81
82
|
const newObject = MessageCommentReaction.create(this.attributes, this.options)
|
82
83
|
this.attributes = { ...newObject.attributes }
|
@@ -91,23 +92,23 @@ class MessageCommentReaction {
|
|
91
92
|
// message_comment_id (required) - int64 - Message comment to return reactions for.
|
92
93
|
static list = async (params = {}, options = {}) => {
|
93
94
|
if (!params['message_comment_id']) {
|
94
|
-
throw new
|
95
|
+
throw new errors.MissingParameterError('Parameter missing: message_comment_id')
|
95
96
|
}
|
96
97
|
|
97
98
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
98
|
-
throw new
|
99
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
99
100
|
}
|
100
101
|
|
101
102
|
if (params['cursor'] && !isString(params['cursor'])) {
|
102
|
-
throw new
|
103
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
103
104
|
}
|
104
105
|
|
105
106
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
106
|
-
throw new
|
107
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
107
108
|
}
|
108
109
|
|
109
110
|
if (params['message_comment_id'] && !isInt(params['message_comment_id'])) {
|
110
|
-
throw new
|
111
|
+
throw new errors.InvalidParameterError(`Bad parameter: message_comment_id must be of type Int, received ${getType(message_comment_id)}`)
|
111
112
|
}
|
112
113
|
|
113
114
|
const response = await Api.sendRequest(`/message_comment_reactions`, 'GET', params, options)
|
@@ -122,17 +123,17 @@ class MessageCommentReaction {
|
|
122
123
|
// id (required) - int64 - Message Comment Reaction ID.
|
123
124
|
static find = async (id, params = {}, options = {}) => {
|
124
125
|
if (!isObject(params)) {
|
125
|
-
throw new
|
126
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
126
127
|
}
|
127
128
|
|
128
129
|
params['id'] = id
|
129
130
|
|
130
131
|
if (!params['id']) {
|
131
|
-
throw new
|
132
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
132
133
|
}
|
133
134
|
|
134
135
|
if (params['id'] && !isInt(params['id'])) {
|
135
|
-
throw new
|
136
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
136
137
|
}
|
137
138
|
|
138
139
|
const response = await Api.sendRequest(`/message_comment_reactions/${params['id']}`, 'GET', params, options)
|
@@ -148,15 +149,15 @@ class MessageCommentReaction {
|
|
148
149
|
// emoji (required) - string - Emoji to react with.
|
149
150
|
static create = async (params = {}, options = {}) => {
|
150
151
|
if (!params['emoji']) {
|
151
|
-
throw new
|
152
|
+
throw new errors.MissingParameterError('Parameter missing: emoji')
|
152
153
|
}
|
153
154
|
|
154
155
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
155
|
-
throw new
|
156
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
156
157
|
}
|
157
158
|
|
158
159
|
if (params['emoji'] && !isString(params['emoji'])) {
|
159
|
-
throw new
|
160
|
+
throw new errors.InvalidParameterError(`Bad parameter: emoji must be of type String, received ${getType(emoji)}`)
|
160
161
|
}
|
161
162
|
|
162
163
|
const response = await Api.sendRequest(`/message_comment_reactions`, 'POST', params, options)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import Api from '../Api'
|
2
|
+
import * as errors from '../Errors'
|
2
3
|
import Logger from '../Logger'
|
3
4
|
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
5
|
|
@@ -46,23 +47,23 @@ class MessageReaction {
|
|
46
47
|
|
47
48
|
delete = async (params = {}) => {
|
48
49
|
if (!this.attributes.id) {
|
49
|
-
throw new
|
50
|
+
throw new errors.EmptyPropertyError('Current object has no id')
|
50
51
|
}
|
51
52
|
|
52
53
|
if (!isObject(params)) {
|
53
|
-
throw new
|
54
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
54
55
|
}
|
55
56
|
|
56
57
|
params.id = this.attributes.id
|
57
58
|
if (params['id'] && !isInt(params['id'])) {
|
58
|
-
throw new
|
59
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
59
60
|
}
|
60
61
|
|
61
62
|
if (!params['id']) {
|
62
63
|
if (this.attributes.id) {
|
63
64
|
params['id'] = this.id
|
64
65
|
} else {
|
65
|
-
throw new
|
66
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
66
67
|
}
|
67
68
|
}
|
68
69
|
|
@@ -76,7 +77,7 @@ class MessageReaction {
|
|
76
77
|
|
77
78
|
save = () => {
|
78
79
|
if (this.attributes['id']) {
|
79
|
-
throw new
|
80
|
+
throw new errors.NotImplementedError('The MessageReaction object doesn\'t support updates.')
|
80
81
|
} else {
|
81
82
|
const newObject = MessageReaction.create(this.attributes, this.options)
|
82
83
|
this.attributes = { ...newObject.attributes }
|
@@ -91,23 +92,23 @@ class MessageReaction {
|
|
91
92
|
// message_id (required) - int64 - Message to return reactions for.
|
92
93
|
static list = async (params = {}, options = {}) => {
|
93
94
|
if (!params['message_id']) {
|
94
|
-
throw new
|
95
|
+
throw new errors.MissingParameterError('Parameter missing: message_id')
|
95
96
|
}
|
96
97
|
|
97
98
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
98
|
-
throw new
|
99
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
99
100
|
}
|
100
101
|
|
101
102
|
if (params['cursor'] && !isString(params['cursor'])) {
|
102
|
-
throw new
|
103
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
103
104
|
}
|
104
105
|
|
105
106
|
if (params['per_page'] && !isInt(params['per_page'])) {
|
106
|
-
throw new
|
107
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
107
108
|
}
|
108
109
|
|
109
110
|
if (params['message_id'] && !isInt(params['message_id'])) {
|
110
|
-
throw new
|
111
|
+
throw new errors.InvalidParameterError(`Bad parameter: message_id must be of type Int, received ${getType(message_id)}`)
|
111
112
|
}
|
112
113
|
|
113
114
|
const response = await Api.sendRequest(`/message_reactions`, 'GET', params, options)
|
@@ -122,17 +123,17 @@ class MessageReaction {
|
|
122
123
|
// id (required) - int64 - Message Reaction ID.
|
123
124
|
static find = async (id, params = {}, options = {}) => {
|
124
125
|
if (!isObject(params)) {
|
125
|
-
throw new
|
126
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
126
127
|
}
|
127
128
|
|
128
129
|
params['id'] = id
|
129
130
|
|
130
131
|
if (!params['id']) {
|
131
|
-
throw new
|
132
|
+
throw new errors.MissingParameterError('Parameter missing: id')
|
132
133
|
}
|
133
134
|
|
134
135
|
if (params['id'] && !isInt(params['id'])) {
|
135
|
-
throw new
|
136
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
136
137
|
}
|
137
138
|
|
138
139
|
const response = await Api.sendRequest(`/message_reactions/${params['id']}`, 'GET', params, options)
|
@@ -148,15 +149,15 @@ class MessageReaction {
|
|
148
149
|
// emoji (required) - string - Emoji to react with.
|
149
150
|
static create = async (params = {}, options = {}) => {
|
150
151
|
if (!params['emoji']) {
|
151
|
-
throw new
|
152
|
+
throw new errors.MissingParameterError('Parameter missing: emoji')
|
152
153
|
}
|
153
154
|
|
154
155
|
if (params['user_id'] && !isInt(params['user_id'])) {
|
155
|
-
throw new
|
156
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
156
157
|
}
|
157
158
|
|
158
159
|
if (params['emoji'] && !isString(params['emoji'])) {
|
159
|
-
throw new
|
160
|
+
throw new errors.InvalidParameterError(`Bad parameter: emoji must be of type String, received ${getType(emoji)}`)
|
160
161
|
}
|
161
162
|
|
162
163
|
const response = await Api.sendRequest(`/message_reactions`, 'POST', params, options)
|