files.com 1.0.149 → 1.0.153
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_VERSION +1 -1
- package/lib/models/As2IncomingMessage.js +160 -0
- package/lib/models/As2OutgoingMessage.js +151 -0
- package/lib/models/{As2Key.js → As2Partner.js} +104 -87
- package/lib/models/As2Station.js +504 -0
- package/lib/models/Automation.js +14 -36
- package/package.json +1 -1
- package/src/models/As2IncomingMessage.js +94 -0
- package/src/models/As2OutgoingMessage.js +85 -0
- package/src/models/As2Partner.js +233 -0
- package/src/models/As2Station.js +264 -0
- package/src/models/Automation.js +0 -16
- package/src/models/HistoryExport.js +2 -2
- package/src/models/HistoryExportResult.js +1 -1
- package/src/models/As2Key.js +0 -221
package/src/models/Automation.js
CHANGED
@@ -141,13 +141,6 @@ class Automation {
|
|
141
141
|
this.attributes.trigger_actions = value
|
142
142
|
}
|
143
143
|
|
144
|
-
// string # If trigger is `action`, this is the path to watch for the specified trigger actions.
|
145
|
-
getTriggerActionPath = () => this.attributes.trigger_action_path
|
146
|
-
|
147
|
-
setTriggerActionPath = value => {
|
148
|
-
this.attributes.trigger_action_path = value
|
149
|
-
}
|
150
|
-
|
151
144
|
// object # A Hash of attributes specific to the automation type.
|
152
145
|
getValue = () => this.attributes.value
|
153
146
|
|
@@ -179,7 +172,6 @@ class Automation {
|
|
179
172
|
// name - string - Name for this automation.
|
180
173
|
// trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
181
174
|
// trigger_actions - array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
|
182
|
-
// trigger_action_path - string - If trigger is `action`, this is the path to watch for the specified trigger actions.
|
183
175
|
// value - object - A Hash of attributes specific to the automation type.
|
184
176
|
update = async (params = {}) => {
|
185
177
|
if (!this.attributes.id) {
|
@@ -236,9 +228,6 @@ class Automation {
|
|
236
228
|
if (params['trigger_actions'] && !isArray(params['trigger_actions'])) {
|
237
229
|
throw new Error(`Bad parameter: trigger_actions must be of type Array, received ${getType(trigger_actions)}`)
|
238
230
|
}
|
239
|
-
if (params['trigger_action_path'] && !isString(params['trigger_action_path'])) {
|
240
|
-
throw new Error(`Bad parameter: trigger_action_path must be of type String, received ${getType(trigger_action_path)}`)
|
241
|
-
}
|
242
231
|
|
243
232
|
if (!params['id']) {
|
244
233
|
if (this.attributes.id) {
|
@@ -370,7 +359,6 @@ class Automation {
|
|
370
359
|
// name - string - Name for this automation.
|
371
360
|
// trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
|
372
361
|
// trigger_actions - array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
|
373
|
-
// trigger_action_path - string - If trigger is `action`, this is the path to watch for the specified trigger actions.
|
374
362
|
// value - object - A Hash of attributes specific to the automation type.
|
375
363
|
static create = async (params = {}, options = {}) => {
|
376
364
|
if (!params['automation']) {
|
@@ -433,10 +421,6 @@ class Automation {
|
|
433
421
|
throw new Error(`Bad parameter: trigger_actions must be of type Array, received ${getType(trigger_actions)}`)
|
434
422
|
}
|
435
423
|
|
436
|
-
if (params['trigger_action_path'] && !isString(params['trigger_action_path'])) {
|
437
|
-
throw new Error(`Bad parameter: trigger_action_path must be of type String, received ${getType(trigger_action_path)}`)
|
438
|
-
}
|
439
|
-
|
440
424
|
const response = await Api.sendRequest(`/automations`, 'POST', params, options)
|
441
425
|
|
442
426
|
return new Automation(response?.data, options)
|
@@ -64,7 +64,7 @@ class HistoryExport {
|
|
64
64
|
this.attributes.query_action = value
|
65
65
|
}
|
66
66
|
|
67
|
-
// string # Filter results by this this interface type. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`
|
67
|
+
// string # Filter results by this this interface type. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`, `as2`
|
68
68
|
getQueryInterface = () => this.attributes.query_interface
|
69
69
|
|
70
70
|
setQueryInterface = value => {
|
@@ -245,7 +245,7 @@ class HistoryExport {
|
|
245
245
|
// start_at - string - Start date/time of export range.
|
246
246
|
// end_at - string - End date/time of export range.
|
247
247
|
// query_action - string - Filter results by this this action type. Valid values: `create`, `read`, `update`, `destroy`, `move`, `login`, `failedlogin`, `copy`, `user_create`, `user_update`, `user_destroy`, `group_create`, `group_update`, `group_destroy`, `permission_create`, `permission_destroy`, `api_key_create`, `api_key_update`, `api_key_destroy`
|
248
|
-
// query_interface - string - Filter results by this this interface type. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`
|
248
|
+
// query_interface - string - Filter results by this this interface type. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`, `as2`
|
249
249
|
// query_user_id - string - Return results that are actions performed by the user indiciated by this User ID
|
250
250
|
// query_file_id - string - Return results that are file actions related to the file indicated by this File ID
|
251
251
|
// query_parent_id - string - Return results that are file actions inside the parent folder specified by this folder ID
|
@@ -61,7 +61,7 @@ class HistoryExportResult {
|
|
61
61
|
// string # The type of login failure, if applicable. Valid values: `expired_trial`, `account_overdue`, `locked_out`, `ip_mismatch`, `password_mismatch`, `site_mismatch`, `username_not_found`, `none`, `no_ftp_permission`, `no_web_permission`, `no_directory`, `errno_enoent`, `no_sftp_permission`, `no_dav_permission`, `no_restapi_permission`, `key_mismatch`, `region_mismatch`, `expired_access`, `desktop_ip_mismatch`, `desktop_api_key_not_used_quickly_enough`, `disabled`, `country_mismatch`
|
62
62
|
getFailureType = () => this.attributes.failure_type
|
63
63
|
|
64
|
-
// string # Inteface through which the action was taken. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`
|
64
|
+
// string # Inteface through which the action was taken. Valid values: `web`, `ftp`, `robot`, `jsapi`, `webdesktopapi`, `sftp`, `dav`, `desktop`, `restapi`, `scim`, `office`, `mobile`, `as2`
|
65
65
|
getInterface = () => this.attributes.interface
|
66
66
|
|
67
67
|
// int64 # ID of the object (such as Users, or API Keys) on which the action was taken
|
package/src/models/As2Key.js
DELETED
@@ -1,221 +0,0 @@
|
|
1
|
-
import Api from '../Api'
|
2
|
-
import Logger from '../Logger'
|
3
|
-
import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Class As2Key
|
7
|
-
*/
|
8
|
-
class As2Key {
|
9
|
-
attributes = {}
|
10
|
-
options = {}
|
11
|
-
|
12
|
-
constructor(attributes = {}, options = {}) {
|
13
|
-
Object.entries(attributes).forEach(([key, value]) => {
|
14
|
-
const normalizedKey = key.replace('?', '')
|
15
|
-
|
16
|
-
this.attributes[normalizedKey] = value
|
17
|
-
|
18
|
-
Object.defineProperty(this, normalizedKey, { value, writable: false })
|
19
|
-
})
|
20
|
-
|
21
|
-
this.options = { ...options }
|
22
|
-
}
|
23
|
-
|
24
|
-
isLoaded = () => !!this.attributes.id
|
25
|
-
// int64 # AS2 Key ID
|
26
|
-
getId = () => this.attributes.id
|
27
|
-
|
28
|
-
setId = value => {
|
29
|
-
this.attributes.id = value
|
30
|
-
}
|
31
|
-
|
32
|
-
// string # AS2 Partnership Name
|
33
|
-
getAs2PartnershipName = () => this.attributes.as2_partnership_name
|
34
|
-
|
35
|
-
setAs2PartnershipName = value => {
|
36
|
-
this.attributes.as2_partnership_name = value
|
37
|
-
}
|
38
|
-
|
39
|
-
// date-time # AS2 Key created at date/time
|
40
|
-
getCreatedAt = () => this.attributes.created_at
|
41
|
-
|
42
|
-
// string # Public key fingerprint
|
43
|
-
getFingerprint = () => this.attributes.fingerprint
|
44
|
-
|
45
|
-
setFingerprint = value => {
|
46
|
-
this.attributes.fingerprint = value
|
47
|
-
}
|
48
|
-
|
49
|
-
// int64 # User ID. Provide a value of `0` to operate the current session's user.
|
50
|
-
getUserId = () => this.attributes.user_id
|
51
|
-
|
52
|
-
setUserId = value => {
|
53
|
-
this.attributes.user_id = value
|
54
|
-
}
|
55
|
-
|
56
|
-
// string # Actual contents of Public key.
|
57
|
-
getPublicKey = () => this.attributes.public_key
|
58
|
-
|
59
|
-
setPublicKey = value => {
|
60
|
-
this.attributes.public_key = value
|
61
|
-
}
|
62
|
-
|
63
|
-
|
64
|
-
// Parameters:
|
65
|
-
// as2_partnership_name (required) - string - AS2 Partnership Name
|
66
|
-
update = async (params = {}) => {
|
67
|
-
if (!this.attributes.id) {
|
68
|
-
throw new Error('Current object has no id')
|
69
|
-
}
|
70
|
-
|
71
|
-
if (!isObject(params)) {
|
72
|
-
throw new Error(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
73
|
-
}
|
74
|
-
|
75
|
-
params.id = this.attributes.id
|
76
|
-
if (params['id'] && !isInt(params['id'])) {
|
77
|
-
throw new Error(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
78
|
-
}
|
79
|
-
if (params['as2_partnership_name'] && !isString(params['as2_partnership_name'])) {
|
80
|
-
throw new Error(`Bad parameter: as2_partnership_name must be of type String, received ${getType(as2_partnership_name)}`)
|
81
|
-
}
|
82
|
-
|
83
|
-
if (!params['id']) {
|
84
|
-
if (this.attributes.id) {
|
85
|
-
params['id'] = this.id
|
86
|
-
} else {
|
87
|
-
throw new Error('Parameter missing: id')
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
if (!params['as2_partnership_name']) {
|
92
|
-
if (this.attributes.as2_partnership_name) {
|
93
|
-
params['as2_partnership_name'] = this.as2_partnership_name
|
94
|
-
} else {
|
95
|
-
throw new Error('Parameter missing: as2_partnership_name')
|
96
|
-
}
|
97
|
-
}
|
98
|
-
|
99
|
-
return Api.sendRequest(`/as2_keys/${params['id']}`, 'PATCH', params, this.options)
|
100
|
-
}
|
101
|
-
|
102
|
-
delete = async (params = {}) => {
|
103
|
-
if (!this.attributes.id) {
|
104
|
-
throw new Error('Current object has no id')
|
105
|
-
}
|
106
|
-
|
107
|
-
if (!isObject(params)) {
|
108
|
-
throw new Error(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
109
|
-
}
|
110
|
-
|
111
|
-
params.id = this.attributes.id
|
112
|
-
if (params['id'] && !isInt(params['id'])) {
|
113
|
-
throw new Error(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
114
|
-
}
|
115
|
-
|
116
|
-
if (!params['id']) {
|
117
|
-
if (this.attributes.id) {
|
118
|
-
params['id'] = this.id
|
119
|
-
} else {
|
120
|
-
throw new Error('Parameter missing: id')
|
121
|
-
}
|
122
|
-
}
|
123
|
-
|
124
|
-
return Api.sendRequest(`/as2_keys/${params['id']}`, 'DELETE', params, this.options)
|
125
|
-
}
|
126
|
-
|
127
|
-
destroy = (params = {}) =>
|
128
|
-
this.delete(params)
|
129
|
-
|
130
|
-
save = () => {
|
131
|
-
if (this.attributes['id']) {
|
132
|
-
return this.update(this.attributes)
|
133
|
-
} else {
|
134
|
-
const newObject = As2Key.create(this.attributes, this.options)
|
135
|
-
this.attributes = { ...newObject.attributes }
|
136
|
-
return true
|
137
|
-
}
|
138
|
-
}
|
139
|
-
|
140
|
-
// Parameters:
|
141
|
-
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
142
|
-
// cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
|
143
|
-
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
144
|
-
static list = async (params = {}, options = {}) => {
|
145
|
-
if (params['user_id'] && !isInt(params['user_id'])) {
|
146
|
-
throw new Error(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
147
|
-
}
|
148
|
-
|
149
|
-
if (params['cursor'] && !isString(params['cursor'])) {
|
150
|
-
throw new Error(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
|
151
|
-
}
|
152
|
-
|
153
|
-
if (params['per_page'] && !isInt(params['per_page'])) {
|
154
|
-
throw new Error(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
|
155
|
-
}
|
156
|
-
|
157
|
-
const response = await Api.sendRequest(`/as2_keys`, 'GET', params, options)
|
158
|
-
|
159
|
-
return response?.data?.map(obj => new As2Key(obj, options)) || []
|
160
|
-
}
|
161
|
-
|
162
|
-
static all = (params = {}, options = {}) =>
|
163
|
-
As2Key.list(params, options)
|
164
|
-
|
165
|
-
// Parameters:
|
166
|
-
// id (required) - int64 - As2 Key ID.
|
167
|
-
static find = async (id, params = {}, options = {}) => {
|
168
|
-
if (!isObject(params)) {
|
169
|
-
throw new Error(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
170
|
-
}
|
171
|
-
|
172
|
-
params['id'] = id
|
173
|
-
|
174
|
-
if (!params['id']) {
|
175
|
-
throw new Error('Parameter missing: id')
|
176
|
-
}
|
177
|
-
|
178
|
-
if (params['id'] && !isInt(params['id'])) {
|
179
|
-
throw new Error(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
180
|
-
}
|
181
|
-
|
182
|
-
const response = await Api.sendRequest(`/as2_keys/${params['id']}`, 'GET', params, options)
|
183
|
-
|
184
|
-
return new As2Key(response?.data, options)
|
185
|
-
}
|
186
|
-
|
187
|
-
static get = (id, params = {}, options = {}) =>
|
188
|
-
As2Key.find(id, params, options)
|
189
|
-
|
190
|
-
// Parameters:
|
191
|
-
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
192
|
-
// as2_partnership_name (required) - string - AS2 Partnership Name
|
193
|
-
// public_key (required) - string - Actual contents of Public key.
|
194
|
-
static create = async (params = {}, options = {}) => {
|
195
|
-
if (!params['as2_partnership_name']) {
|
196
|
-
throw new Error('Parameter missing: as2_partnership_name')
|
197
|
-
}
|
198
|
-
|
199
|
-
if (!params['public_key']) {
|
200
|
-
throw new Error('Parameter missing: public_key')
|
201
|
-
}
|
202
|
-
|
203
|
-
if (params['user_id'] && !isInt(params['user_id'])) {
|
204
|
-
throw new Error(`Bad parameter: user_id must be of type Int, received ${getType(user_id)}`)
|
205
|
-
}
|
206
|
-
|
207
|
-
if (params['as2_partnership_name'] && !isString(params['as2_partnership_name'])) {
|
208
|
-
throw new Error(`Bad parameter: as2_partnership_name must be of type String, received ${getType(as2_partnership_name)}`)
|
209
|
-
}
|
210
|
-
|
211
|
-
if (params['public_key'] && !isString(params['public_key'])) {
|
212
|
-
throw new Error(`Bad parameter: public_key must be of type String, received ${getType(public_key)}`)
|
213
|
-
}
|
214
|
-
|
215
|
-
const response = await Api.sendRequest(`/as2_keys`, 'POST', params, options)
|
216
|
-
|
217
|
-
return new As2Key(response?.data, options)
|
218
|
-
}
|
219
|
-
}
|
220
|
-
|
221
|
-
export default As2Key
|