files.com 1.1.18 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.js +0 -3
- package/_VERSION +1 -1
- package/docs/Errors.md +1 -0
- package/lib/Api.js +1 -1
- package/lib/Errors.js +957 -933
- package/lib/Files.js +1 -1
- package/lib/models/ActionNotificationExport.js +25 -25
- package/lib/models/ActionNotificationExportResult.js +10 -10
- package/lib/models/ActionWebhookFailure.js +5 -9
- package/lib/models/ApiKey.js +62 -70
- package/lib/models/App.js +5 -5
- package/lib/models/As2IncomingMessage.js +7 -7
- package/lib/models/As2OutgoingMessage.js +7 -7
- package/lib/models/As2Partner.js +54 -58
- package/lib/models/As2Station.js +51 -55
- package/lib/models/Automation.js +102 -110
- package/lib/models/AutomationRun.js +13 -13
- package/lib/models/BandwidthSnapshot.js +5 -5
- package/lib/models/Behavior.js +77 -85
- package/lib/models/Bundle.js +102 -110
- package/lib/models/BundleDownload.js +9 -9
- package/lib/models/BundleNotification.js +37 -41
- package/lib/models/BundleRecipient.js +22 -22
- package/lib/models/BundleRegistration.js +7 -7
- package/lib/models/Clickwrap.js +52 -56
- package/lib/models/DnsRecord.js +5 -5
- package/lib/models/EmailIncomingMessage.js +5 -5
- package/lib/models/ExternalEvent.js +18 -18
- package/lib/models/File.js +89 -93
- package/lib/models/FileComment.js +41 -45
- package/lib/models/FileCommentReaction.js +15 -19
- package/lib/models/FileMigration.js +5 -5
- package/lib/models/Folder.js +24 -24
- package/lib/models/FormFieldSet.js +44 -48
- package/lib/models/GpgKey.js +53 -57
- package/lib/models/Group.js +51 -55
- package/lib/models/GroupUser.js +53 -57
- package/lib/models/History.js +72 -72
- package/lib/models/HistoryExport.js +51 -51
- package/lib/models/HistoryExportResult.js +10 -10
- package/lib/models/InboxRecipient.js +22 -22
- package/lib/models/InboxRegistration.js +7 -7
- package/lib/models/InboxUpload.js +9 -9
- package/lib/models/Invoice.js +12 -12
- package/lib/models/IpAddress.js +17 -17
- package/lib/models/Lock.js +27 -31
- package/lib/models/Message.js +60 -64
- package/lib/models/MessageComment.js +46 -50
- package/lib/models/MessageCommentReaction.js +27 -31
- package/lib/models/MessageReaction.js +27 -31
- package/lib/models/Notification.js +66 -70
- package/lib/models/Payment.js +12 -12
- package/lib/models/Permission.js +28 -32
- package/lib/models/Priority.js +9 -9
- package/lib/models/Project.js +39 -43
- package/lib/models/PublicKey.js +46 -50
- package/lib/models/RemoteBandwidthSnapshot.js +5 -5
- package/lib/models/RemoteServer.js +306 -310
- package/lib/models/Request.js +33 -37
- package/lib/models/Session.js +11 -15
- package/lib/models/SettingsChange.js +5 -5
- package/lib/models/SftpHostKey.js +40 -44
- package/lib/models/ShareGroup.js +50 -54
- package/lib/models/Site.js +138 -138
- package/lib/models/Snapshot.js +44 -48
- package/lib/models/SsoStrategy.js +15 -19
- package/lib/models/Style.js +17 -21
- package/lib/models/UsageDailySnapshot.js +5 -5
- package/lib/models/UsageSnapshot.js +5 -5
- package/lib/models/User.js +156 -172
- package/lib/models/UserCipherUse.js +7 -7
- package/lib/models/UserRequest.js +26 -30
- package/lib/models/WebhookTest.js +15 -15
- package/package.json +6 -2
- package/src/Api.js +2 -1
- package/src/Errors.js +189 -177
- package/src/Files.js +1 -1
- package/src/models/AccountLineItem.js +5 -2
- package/src/models/Action.js +5 -2
- package/src/models/ActionNotificationExport.js +36 -35
- package/src/models/ActionNotificationExportResult.js +15 -13
- package/src/models/ActionWebhookFailure.js +9 -8
- package/src/models/ApiKey.js +69 -72
- package/src/models/App.js +10 -8
- package/src/models/As2IncomingMessage.js +12 -10
- package/src/models/As2OutgoingMessage.js +12 -10
- package/src/models/As2Partner.js +61 -60
- package/src/models/As2Station.js +58 -57
- package/src/models/Auto.js +5 -2
- package/src/models/Automation.js +121 -110
- package/src/models/AutomationRun.js +18 -17
- package/src/models/BandwidthSnapshot.js +10 -8
- package/src/models/Behavior.js +85 -86
- package/src/models/Bundle.js +121 -110
- package/src/models/BundleDownload.js +14 -12
- package/src/models/BundleNotification.js +40 -43
- package/src/models/BundleRecipient.js +33 -32
- package/src/models/BundleRegistration.js +12 -10
- package/src/models/Clickwrap.js +60 -58
- package/src/models/DnsRecord.js +10 -8
- package/src/models/EmailIncomingMessage.js +10 -8
- package/src/models/Errors.js +5 -2
- package/src/models/ExternalEvent.js +29 -29
- package/src/models/File.js +116 -108
- package/src/models/FileAction.js +5 -2
- package/src/models/FileComment.js +45 -46
- package/src/models/FileCommentReaction.js +26 -26
- package/src/models/FileMigration.js +10 -8
- package/src/models/FileUploadPart.js +5 -2
- package/src/models/Folder.js +32 -29
- package/src/models/FormField.js +5 -2
- package/src/models/FormFieldSet.js +49 -50
- package/src/models/GpgKey.js +60 -59
- package/src/models/Group.js +58 -57
- package/src/models/GroupUser.js +60 -58
- package/src/models/History.js +77 -74
- package/src/models/HistoryExport.js +62 -61
- package/src/models/HistoryExportResult.js +15 -13
- package/src/models/Image.js +5 -2
- package/src/models/InboxRecipient.js +33 -32
- package/src/models/InboxRegistration.js +12 -10
- package/src/models/InboxUpload.js +14 -12
- package/src/models/Invoice.js +17 -14
- package/src/models/InvoiceLineItem.js +5 -2
- package/src/models/IpAddress.js +22 -20
- package/src/models/Lock.js +36 -36
- package/src/models/Message.js +66 -66
- package/src/models/MessageComment.js +50 -52
- package/src/models/MessageCommentReaction.js +38 -40
- package/src/models/MessageReaction.js +38 -40
- package/src/models/Notification.js +74 -72
- package/src/models/Payment.js +17 -14
- package/src/models/PaymentLineItem.js +5 -2
- package/src/models/Permission.js +39 -40
- package/src/models/Preview.js +5 -2
- package/src/models/Priority.js +14 -12
- package/src/models/Project.js +43 -45
- package/src/models/PublicIpAddress.js +5 -2
- package/src/models/PublicKey.js +50 -52
- package/src/models/RemoteBandwidthSnapshot.js +10 -8
- package/src/models/RemoteServer.js +380 -312
- package/src/models/RemoteServerConfigurationFile.js +5 -2
- package/src/models/Request.js +44 -46
- package/src/models/Session.js +22 -22
- package/src/models/SettingsChange.js +10 -8
- package/src/models/SftpHostKey.js +45 -46
- package/src/models/ShareGroup.js +56 -56
- package/src/models/ShareGroupMember.js +5 -2
- package/src/models/Site.js +143 -142
- package/src/models/Snapshot.js +50 -50
- package/src/models/SsoStrategy.js +20 -21
- package/src/models/Status.js +5 -2
- package/src/models/Style.js +22 -23
- package/src/models/UsageDailySnapshot.js +10 -8
- package/src/models/UsageSnapshot.js +10 -8
- package/src/models/User.js +185 -168
- package/src/models/UserCipherUse.js +12 -10
- package/src/models/UserRequest.js +37 -39
- package/src/models/WebhookTest.js +26 -24
- package/test/Api.test.js +163 -0
- package/test/{package.json → integration/package.json} +1 -1
- package/test/{src → integration/src}/index.js +1 -1
- package/test.sh +2 -1
- /package/test/{.babelrc → integration/.babelrc} +0 -0
- /package/test/{index.js → integration/index.js} +0 -0
package/src/models/DnsRecord.js
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
2
2
|
import Api from '../Api'
|
3
3
|
import * as errors from '../Errors'
|
4
|
-
import {
|
4
|
+
import {
|
5
|
+
getType, isArray, isInt, isObject, isString,
|
6
|
+
} from '../utils'
|
5
7
|
/* eslint-enable no-unused-vars */
|
6
8
|
|
7
9
|
/**
|
@@ -9,6 +11,7 @@ import { getType, isArray, isInt, isObject, isString } from '../utils'
|
|
9
11
|
*/
|
10
12
|
class DnsRecord {
|
11
13
|
attributes = {}
|
14
|
+
|
12
15
|
options = {}
|
13
16
|
|
14
17
|
constructor(attributes = {}, options = {}) {
|
@@ -24,6 +27,7 @@ class DnsRecord {
|
|
24
27
|
}
|
25
28
|
|
26
29
|
isLoaded = () => !!this.attributes.id
|
30
|
+
|
27
31
|
// string # Unique label for DNS record; used by Zapier and other integrations.
|
28
32
|
getId = () => this.attributes.id
|
29
33
|
|
@@ -36,22 +40,20 @@ class DnsRecord {
|
|
36
40
|
// string # DNS record value
|
37
41
|
getValue = () => this.attributes.value
|
38
42
|
|
39
|
-
|
40
43
|
// Parameters:
|
41
44
|
// cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
|
42
45
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
43
46
|
static list = async (params = {}, options = {}) => {
|
44
|
-
if (params
|
45
|
-
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params
|
47
|
+
if (params.cursor && !isString(params.cursor)) {
|
48
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|
46
49
|
}
|
47
50
|
|
48
|
-
if (params
|
49
|
-
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params
|
51
|
+
if (params.per_page && !isInt(params.per_page)) {
|
52
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`)
|
50
53
|
}
|
51
54
|
|
52
|
-
const response = await Api.sendRequest(
|
55
|
+
const response = await Api.sendRequest('/dns_records', 'GET', params, options)
|
53
56
|
|
54
|
-
|
55
57
|
return response?.data?.map(obj => new DnsRecord(obj, options)) || []
|
56
58
|
}
|
57
59
|
|
@@ -1,7 +1,9 @@
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
2
2
|
import Api from '../Api'
|
3
3
|
import * as errors from '../Errors'
|
4
|
-
import {
|
4
|
+
import {
|
5
|
+
getType, isArray, isInt, isObject, isString,
|
6
|
+
} from '../utils'
|
5
7
|
/* eslint-enable no-unused-vars */
|
6
8
|
|
7
9
|
/**
|
@@ -9,6 +11,7 @@ import { getType, isArray, isInt, isObject, isString } from '../utils'
|
|
9
11
|
*/
|
10
12
|
class EmailIncomingMessage {
|
11
13
|
attributes = {}
|
14
|
+
|
12
15
|
options = {}
|
13
16
|
|
14
17
|
constructor(attributes = {}, options = {}) {
|
@@ -24,6 +27,7 @@ class EmailIncomingMessage {
|
|
24
27
|
}
|
25
28
|
|
26
29
|
isLoaded = () => !!this.attributes.id
|
30
|
+
|
27
31
|
// int64 # Id of the Email Incoming Message
|
28
32
|
getId = () => this.attributes.id
|
29
33
|
|
@@ -51,7 +55,6 @@ class EmailIncomingMessage {
|
|
51
55
|
// string # Title of the Inbox associated with this message
|
52
56
|
getInboxTitle = () => this.attributes.inbox_title
|
53
57
|
|
54
|
-
|
55
58
|
// Parameters:
|
56
59
|
// cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
|
57
60
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
@@ -63,17 +66,16 @@ class EmailIncomingMessage {
|
|
63
66
|
// filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
|
64
67
|
// filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
|
65
68
|
static list = async (params = {}, options = {}) => {
|
66
|
-
if (params
|
67
|
-
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params
|
69
|
+
if (params.cursor && !isString(params.cursor)) {
|
70
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|
68
71
|
}
|
69
72
|
|
70
|
-
if (params
|
71
|
-
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params
|
73
|
+
if (params.per_page && !isInt(params.per_page)) {
|
74
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`)
|
72
75
|
}
|
73
76
|
|
74
|
-
const response = await Api.sendRequest(
|
77
|
+
const response = await Api.sendRequest('/email_incoming_messages', 'GET', params, options)
|
75
78
|
|
76
|
-
|
77
79
|
return response?.data?.map(obj => new EmailIncomingMessage(obj, options)) || []
|
78
80
|
}
|
79
81
|
|
package/src/models/Errors.js
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
2
2
|
import Api from '../Api'
|
3
3
|
import * as errors from '../Errors'
|
4
|
-
import {
|
4
|
+
import {
|
5
|
+
getType, isArray, isInt, isObject, isString,
|
6
|
+
} from '../utils'
|
5
7
|
/* eslint-enable no-unused-vars */
|
6
8
|
|
7
9
|
/**
|
@@ -9,6 +11,7 @@ import { getType, isArray, isInt, isObject, isString } from '../utils'
|
|
9
11
|
*/
|
10
12
|
class Errors {
|
11
13
|
attributes = {}
|
14
|
+
|
12
15
|
options = {}
|
13
16
|
|
14
17
|
constructor(attributes = {}, options = {}) {
|
@@ -24,12 +27,12 @@ class Errors {
|
|
24
27
|
}
|
25
28
|
|
26
29
|
isLoaded = () => !!this.attributes.id
|
30
|
+
|
27
31
|
// array # A list of fields where errors occur
|
28
32
|
getFields = () => this.attributes.fields
|
29
33
|
|
30
34
|
// array # A list of error messages
|
31
35
|
getMessages = () => this.attributes.messages
|
32
|
-
|
33
36
|
}
|
34
37
|
|
35
38
|
export default Errors
|
@@ -1,7 +1,9 @@
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
2
2
|
import Api from '../Api'
|
3
3
|
import * as errors from '../Errors'
|
4
|
-
import {
|
4
|
+
import {
|
5
|
+
getType, isArray, isInt, isObject, isString,
|
6
|
+
} from '../utils'
|
5
7
|
/* eslint-enable no-unused-vars */
|
6
8
|
|
7
9
|
/**
|
@@ -9,6 +11,7 @@ import { getType, isArray, isInt, isObject, isString } from '../utils'
|
|
9
11
|
*/
|
10
12
|
class ExternalEvent {
|
11
13
|
attributes = {}
|
14
|
+
|
12
15
|
options = {}
|
13
16
|
|
14
17
|
constructor(attributes = {}, options = {}) {
|
@@ -24,6 +27,7 @@ class ExternalEvent {
|
|
24
27
|
}
|
25
28
|
|
26
29
|
isLoaded = () => !!this.attributes.id
|
30
|
+
|
27
31
|
// int64 # Event ID
|
28
32
|
getId = () => this.attributes.id
|
29
33
|
|
@@ -97,15 +101,14 @@ class ExternalEvent {
|
|
97
101
|
this.attributes.remote_server_type = value
|
98
102
|
}
|
99
103
|
|
100
|
-
|
101
104
|
save = async () => {
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
105
|
+
if (this.attributes.id) {
|
106
|
+
throw new errors.NotImplementedError('The ExternalEvent object doesn\'t support updates.')
|
107
|
+
} else {
|
108
|
+
const newObject = await ExternalEvent.create(this.attributes, this.options)
|
109
|
+
this.attributes = { ...newObject.attributes }
|
110
|
+
return true
|
111
|
+
}
|
109
112
|
}
|
110
113
|
|
111
114
|
// Parameters:
|
@@ -119,17 +122,16 @@ class ExternalEvent {
|
|
119
122
|
// filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`.
|
120
123
|
// filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`.
|
121
124
|
static list = async (params = {}, options = {}) => {
|
122
|
-
if (params
|
123
|
-
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params
|
125
|
+
if (params.cursor && !isString(params.cursor)) {
|
126
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|
124
127
|
}
|
125
128
|
|
126
|
-
if (params
|
127
|
-
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params
|
129
|
+
if (params.per_page && !isInt(params.per_page)) {
|
130
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`)
|
128
131
|
}
|
129
132
|
|
130
|
-
const response = await Api.sendRequest(
|
133
|
+
const response = await Api.sendRequest('/external_events', 'GET', params, options)
|
131
134
|
|
132
|
-
|
133
135
|
return response?.data?.map(obj => new ExternalEvent(obj, options)) || []
|
134
136
|
}
|
135
137
|
|
@@ -143,19 +145,18 @@ class ExternalEvent {
|
|
143
145
|
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
144
146
|
}
|
145
147
|
|
146
|
-
params
|
148
|
+
params.id = id
|
147
149
|
|
148
|
-
if (!params
|
150
|
+
if (!params.id) {
|
149
151
|
throw new errors.MissingParameterError('Parameter missing: id')
|
150
152
|
}
|
151
153
|
|
152
|
-
if (params
|
153
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params
|
154
|
+
if (params.id && !isInt(params.id)) {
|
155
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`)
|
154
156
|
}
|
155
157
|
|
156
|
-
const response = await Api.sendRequest(`/external_events/${encodeURIComponent(params
|
158
|
+
const response = await Api.sendRequest(`/external_events/${encodeURIComponent(params.id)}`, 'GET', params, options)
|
157
159
|
|
158
|
-
|
159
160
|
return new ExternalEvent(response?.data, options)
|
160
161
|
}
|
161
162
|
|
@@ -166,25 +167,24 @@ class ExternalEvent {
|
|
166
167
|
// status (required) - string - Status of event.
|
167
168
|
// body (required) - string - Event body
|
168
169
|
static create = async (params = {}, options = {}) => {
|
169
|
-
if (!params
|
170
|
+
if (!params.status) {
|
170
171
|
throw new errors.MissingParameterError('Parameter missing: status')
|
171
172
|
}
|
172
173
|
|
173
|
-
if (!params
|
174
|
+
if (!params.body) {
|
174
175
|
throw new errors.MissingParameterError('Parameter missing: body')
|
175
176
|
}
|
176
177
|
|
177
|
-
if (params
|
178
|
-
throw new errors.InvalidParameterError(`Bad parameter: status must be of type String, received ${getType(params
|
178
|
+
if (params.status && !isString(params.status)) {
|
179
|
+
throw new errors.InvalidParameterError(`Bad parameter: status must be of type String, received ${getType(params.status)}`)
|
179
180
|
}
|
180
181
|
|
181
|
-
if (params
|
182
|
-
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(params
|
182
|
+
if (params.body && !isString(params.body)) {
|
183
|
+
throw new errors.InvalidParameterError(`Bad parameter: body must be of type String, received ${getType(params.body)}`)
|
183
184
|
}
|
184
185
|
|
185
|
-
const response = await Api.sendRequest(
|
186
|
+
const response = await Api.sendRequest('/external_events', 'POST', params, options)
|
186
187
|
|
187
|
-
|
188
188
|
return new ExternalEvent(response?.data, options)
|
189
189
|
}
|
190
190
|
}
|