files.com 1.0.166 → 1.0.169

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. package/README.md +9 -5
  2. package/_VERSION +1 -1
  3. package/lib/models/ActionWebhookFailure.js +8 -2
  4. package/lib/models/ApiKey.js +16 -4
  5. package/lib/models/As2Partner.js +48 -14
  6. package/lib/models/As2Station.js +52 -12
  7. package/lib/models/Automation.js +16 -4
  8. package/lib/models/Behavior.js +16 -4
  9. package/lib/models/Bundle.js +24 -6
  10. package/lib/models/Clickwrap.js +16 -4
  11. package/lib/models/File.js +309 -311
  12. package/lib/models/FileComment.js +16 -4
  13. package/lib/models/FileCommentReaction.js +8 -2
  14. package/lib/models/FormFieldSet.js +16 -4
  15. package/lib/models/Group.js +16 -4
  16. package/lib/models/GroupUser.js +16 -4
  17. package/lib/models/Lock.js +8 -2
  18. package/lib/models/Message.js +16 -4
  19. package/lib/models/MessageComment.js +16 -4
  20. package/lib/models/MessageCommentReaction.js +8 -2
  21. package/lib/models/MessageReaction.js +8 -2
  22. package/lib/models/Notification.js +16 -4
  23. package/lib/models/Permission.js +8 -2
  24. package/lib/models/Project.js +16 -4
  25. package/lib/models/PublicKey.js +16 -4
  26. package/lib/models/RemoteServer.js +16 -4
  27. package/lib/models/Request.js +8 -2
  28. package/lib/models/SsoStrategy.js +8 -2
  29. package/lib/models/Style.js +16 -4
  30. package/lib/models/User.js +40 -10
  31. package/lib/models/UserRequest.js +8 -2
  32. package/package.json +1 -1
  33. package/src/models/ActionWebhookFailure.js +3 -1
  34. package/src/models/ApiKey.js +6 -2
  35. package/src/models/As2OutgoingMessage.js +1 -1
  36. package/src/models/As2Partner.js +22 -2
  37. package/src/models/As2Station.js +29 -2
  38. package/src/models/Automation.js +6 -2
  39. package/src/models/Behavior.js +6 -2
  40. package/src/models/Bundle.js +9 -3
  41. package/src/models/Clickwrap.js +6 -2
  42. package/src/models/File.js +26 -19
  43. package/src/models/FileComment.js +6 -2
  44. package/src/models/FileCommentReaction.js +3 -1
  45. package/src/models/FormFieldSet.js +6 -2
  46. package/src/models/Group.js +6 -2
  47. package/src/models/GroupUser.js +6 -2
  48. package/src/models/Lock.js +3 -1
  49. package/src/models/Message.js +6 -2
  50. package/src/models/MessageComment.js +6 -2
  51. package/src/models/MessageCommentReaction.js +3 -1
  52. package/src/models/MessageReaction.js +3 -1
  53. package/src/models/Notification.js +6 -2
  54. package/src/models/Permission.js +3 -1
  55. package/src/models/Project.js +6 -2
  56. package/src/models/PublicKey.js +6 -2
  57. package/src/models/RemoteServer.js +6 -2
  58. package/src/models/Request.js +3 -1
  59. package/src/models/SsoStrategy.js +3 -1
  60. package/src/models/Style.js +6 -2
  61. package/src/models/User.js +15 -5
  62. package/src/models/UserRequest.js +3 -1
  63. package/test/src/index.js +7 -3
@@ -73,7 +73,9 @@ class FileCommentReaction {
73
73
  }
74
74
  }
75
75
 
76
- return Api.sendRequest(`/file_comment_reactions/${params['id']}`, 'DELETE', params, this.options)
76
+ const response = await Api.sendRequest(`/file_comment_reactions/${params['id']}`, 'DELETE', params, this.options)
77
+
78
+ return response?.data
77
79
  }
78
80
 
79
81
  destroy = (params = {}) =>
@@ -113,7 +113,9 @@ class FormFieldSet {
113
113
  }
114
114
  }
115
115
 
116
- return Api.sendRequest(`/form_field_sets/${params['id']}`, 'PATCH', params, this.options)
116
+ const response = await Api.sendRequest(`/form_field_sets/${params['id']}`, 'PATCH', params, this.options)
117
+
118
+ return new FormFieldSet(response?.data, this.options)
117
119
  }
118
120
 
119
121
  delete = async (params = {}) => {
@@ -138,7 +140,9 @@ class FormFieldSet {
138
140
  }
139
141
  }
140
142
 
141
- return Api.sendRequest(`/form_field_sets/${params['id']}`, 'DELETE', params, this.options)
143
+ const response = await Api.sendRequest(`/form_field_sets/${params['id']}`, 'DELETE', params, this.options)
144
+
145
+ return response?.data
142
146
  }
143
147
 
144
148
  destroy = (params = {}) =>
@@ -104,7 +104,9 @@ class Group {
104
104
  }
105
105
  }
106
106
 
107
- return Api.sendRequest(`/groups/${params['id']}`, 'PATCH', params, this.options)
107
+ const response = await Api.sendRequest(`/groups/${params['id']}`, 'PATCH', params, this.options)
108
+
109
+ return new Group(response?.data, this.options)
108
110
  }
109
111
 
110
112
  delete = async (params = {}) => {
@@ -129,7 +131,9 @@ class Group {
129
131
  }
130
132
  }
131
133
 
132
- return Api.sendRequest(`/groups/${params['id']}`, 'DELETE', params, this.options)
134
+ const response = await Api.sendRequest(`/groups/${params['id']}`, 'DELETE', params, this.options)
135
+
136
+ return response?.data
133
137
  }
134
138
 
135
139
  destroy = (params = {}) =>
@@ -113,7 +113,9 @@ class GroupUser {
113
113
  }
114
114
  }
115
115
 
116
- return Api.sendRequest(`/group_users/${params['id']}`, 'PATCH', params, this.options)
116
+ const response = await Api.sendRequest(`/group_users/${params['id']}`, 'PATCH', params, this.options)
117
+
118
+ return new GroupUser(response?.data, this.options)
117
119
  }
118
120
 
119
121
  // Parameters:
@@ -163,7 +165,9 @@ class GroupUser {
163
165
  }
164
166
  }
165
167
 
166
- return Api.sendRequest(`/group_users/${params['id']}`, 'DELETE', params, this.options)
168
+ const response = await Api.sendRequest(`/group_users/${params['id']}`, 'DELETE', params, this.options)
169
+
170
+ return response?.data
167
171
  }
168
172
 
169
173
  destroy = (params = {}) =>
@@ -142,7 +142,9 @@ class Lock {
142
142
  }
143
143
  }
144
144
 
145
- return Api.sendRequest(`/locks/${params['path']}`, 'DELETE', params, this.options)
145
+ const response = await Api.sendRequest(`/locks/${params['path']}`, 'DELETE', params, this.options)
146
+
147
+ return response?.data
146
148
  }
147
149
 
148
150
  destroy = (params = {}) =>
@@ -124,7 +124,9 @@ class Message {
124
124
  }
125
125
  }
126
126
 
127
- return Api.sendRequest(`/messages/${params['id']}`, 'PATCH', params, this.options)
127
+ const response = await Api.sendRequest(`/messages/${params['id']}`, 'PATCH', params, this.options)
128
+
129
+ return new Message(response?.data, this.options)
128
130
  }
129
131
 
130
132
  delete = async (params = {}) => {
@@ -149,7 +151,9 @@ class Message {
149
151
  }
150
152
  }
151
153
 
152
- return Api.sendRequest(`/messages/${params['id']}`, 'DELETE', params, this.options)
154
+ const response = await Api.sendRequest(`/messages/${params['id']}`, 'DELETE', params, this.options)
155
+
156
+ return response?.data
153
157
  }
154
158
 
155
159
  destroy = (params = {}) =>
@@ -86,7 +86,9 @@ class MessageComment {
86
86
  }
87
87
  }
88
88
 
89
- return Api.sendRequest(`/message_comments/${params['id']}`, 'PATCH', params, this.options)
89
+ const response = await Api.sendRequest(`/message_comments/${params['id']}`, 'PATCH', params, this.options)
90
+
91
+ return new MessageComment(response?.data, this.options)
90
92
  }
91
93
 
92
94
  delete = async (params = {}) => {
@@ -111,7 +113,9 @@ class MessageComment {
111
113
  }
112
114
  }
113
115
 
114
- return Api.sendRequest(`/message_comments/${params['id']}`, 'DELETE', params, this.options)
116
+ const response = await Api.sendRequest(`/message_comments/${params['id']}`, 'DELETE', params, this.options)
117
+
118
+ return response?.data
115
119
  }
116
120
 
117
121
  destroy = (params = {}) =>
@@ -66,7 +66,9 @@ class MessageCommentReaction {
66
66
  }
67
67
  }
68
68
 
69
- return Api.sendRequest(`/message_comment_reactions/${params['id']}`, 'DELETE', params, this.options)
69
+ const response = await Api.sendRequest(`/message_comment_reactions/${params['id']}`, 'DELETE', params, this.options)
70
+
71
+ return response?.data
70
72
  }
71
73
 
72
74
  destroy = (params = {}) =>
@@ -66,7 +66,9 @@ class MessageReaction {
66
66
  }
67
67
  }
68
68
 
69
- return Api.sendRequest(`/message_reactions/${params['id']}`, 'DELETE', params, this.options)
69
+ const response = await Api.sendRequest(`/message_reactions/${params['id']}`, 'DELETE', params, this.options)
70
+
71
+ return response?.data
70
72
  }
71
73
 
72
74
  destroy = (params = {}) =>
@@ -144,7 +144,9 @@ class Notification {
144
144
  }
145
145
  }
146
146
 
147
- return Api.sendRequest(`/notifications/${params['id']}`, 'PATCH', params, this.options)
147
+ const response = await Api.sendRequest(`/notifications/${params['id']}`, 'PATCH', params, this.options)
148
+
149
+ return new Notification(response?.data, this.options)
148
150
  }
149
151
 
150
152
  delete = async (params = {}) => {
@@ -169,7 +171,9 @@ class Notification {
169
171
  }
170
172
  }
171
173
 
172
- return Api.sendRequest(`/notifications/${params['id']}`, 'DELETE', params, this.options)
174
+ const response = await Api.sendRequest(`/notifications/${params['id']}`, 'DELETE', params, this.options)
175
+
176
+ return response?.data
173
177
  }
174
178
 
175
179
  destroy = (params = {}) =>
@@ -101,7 +101,9 @@ class Permission {
101
101
  }
102
102
  }
103
103
 
104
- return Api.sendRequest(`/permissions/${params['id']}`, 'DELETE', params, this.options)
104
+ const response = await Api.sendRequest(`/permissions/${params['id']}`, 'DELETE', params, this.options)
105
+
106
+ return response?.data
105
107
  }
106
108
 
107
109
  destroy = (params = {}) =>
@@ -72,7 +72,9 @@ class Project {
72
72
  }
73
73
  }
74
74
 
75
- return Api.sendRequest(`/projects/${params['id']}`, 'PATCH', params, this.options)
75
+ const response = await Api.sendRequest(`/projects/${params['id']}`, 'PATCH', params, this.options)
76
+
77
+ return new Project(response?.data, this.options)
76
78
  }
77
79
 
78
80
  delete = async (params = {}) => {
@@ -97,7 +99,9 @@ class Project {
97
99
  }
98
100
  }
99
101
 
100
- return Api.sendRequest(`/projects/${params['id']}`, 'DELETE', params, this.options)
102
+ const response = await Api.sendRequest(`/projects/${params['id']}`, 'DELETE', params, this.options)
103
+
104
+ return response?.data
101
105
  }
102
106
 
103
107
  destroy = (params = {}) =>
@@ -96,7 +96,9 @@ class PublicKey {
96
96
  }
97
97
  }
98
98
 
99
- return Api.sendRequest(`/public_keys/${params['id']}`, 'PATCH', params, this.options)
99
+ const response = await Api.sendRequest(`/public_keys/${params['id']}`, 'PATCH', params, this.options)
100
+
101
+ return new PublicKey(response?.data, this.options)
100
102
  }
101
103
 
102
104
  delete = async (params = {}) => {
@@ -121,7 +123,9 @@ class PublicKey {
121
123
  }
122
124
  }
123
125
 
124
- return Api.sendRequest(`/public_keys/${params['id']}`, 'DELETE', params, this.options)
126
+ const response = await Api.sendRequest(`/public_keys/${params['id']}`, 'DELETE', params, this.options)
127
+
128
+ return response?.data
125
129
  }
126
130
 
127
131
  destroy = (params = {}) =>
@@ -551,7 +551,9 @@ class RemoteServer {
551
551
  }
552
552
  }
553
553
 
554
- return Api.sendRequest(`/remote_servers/${params['id']}`, 'PATCH', params, this.options)
554
+ const response = await Api.sendRequest(`/remote_servers/${params['id']}`, 'PATCH', params, this.options)
555
+
556
+ return new RemoteServer(response?.data, this.options)
555
557
  }
556
558
 
557
559
  delete = async (params = {}) => {
@@ -576,7 +578,9 @@ class RemoteServer {
576
578
  }
577
579
  }
578
580
 
579
- return Api.sendRequest(`/remote_servers/${params['id']}`, 'DELETE', params, this.options)
581
+ const response = await Api.sendRequest(`/remote_servers/${params['id']}`, 'DELETE', params, this.options)
582
+
583
+ return response?.data
580
584
  }
581
585
 
582
586
  destroy = (params = {}) =>
@@ -101,7 +101,9 @@ class Request {
101
101
  }
102
102
  }
103
103
 
104
- return Api.sendRequest(`/requests/${params['id']}`, 'DELETE', params, this.options)
104
+ const response = await Api.sendRequest(`/requests/${params['id']}`, 'DELETE', params, this.options)
105
+
106
+ return response?.data
105
107
  }
106
108
 
107
109
  destroy = (params = {}) =>
@@ -175,7 +175,9 @@ class SsoStrategy {
175
175
  }
176
176
  }
177
177
 
178
- return Api.sendRequest(`/sso_strategies/${params['id']}/sync`, 'POST', params, this.options)
178
+ const response = await Api.sendRequest(`/sso_strategies/${params['id']}/sync`, 'POST', params, this.options)
179
+
180
+ return response?.data
179
181
  }
180
182
 
181
183
  // Parameters:
@@ -90,7 +90,9 @@ class Style {
90
90
  }
91
91
  }
92
92
 
93
- return Api.sendRequest(`/styles/${params['path']}`, 'PATCH', params, this.options)
93
+ const response = await Api.sendRequest(`/styles/${params['path']}`, 'PATCH', params, this.options)
94
+
95
+ return new Style(response?.data, this.options)
94
96
  }
95
97
 
96
98
  delete = async (params = {}) => {
@@ -115,7 +117,9 @@ class Style {
115
117
  }
116
118
  }
117
119
 
118
- return Api.sendRequest(`/styles/${params['path']}`, 'DELETE', params, this.options)
120
+ const response = await Api.sendRequest(`/styles/${params['path']}`, 'DELETE', params, this.options)
121
+
122
+ return response?.data
119
123
  }
120
124
 
121
125
  destroy = (params = {}) =>
@@ -448,7 +448,9 @@ class User {
448
448
  }
449
449
  }
450
450
 
451
- return Api.sendRequest(`/users/${params['id']}/unlock`, 'POST', params, this.options)
451
+ const response = await Api.sendRequest(`/users/${params['id']}/unlock`, 'POST', params, this.options)
452
+
453
+ return response?.data
452
454
  }
453
455
 
454
456
  // Resend user welcome email
@@ -474,7 +476,9 @@ class User {
474
476
  }
475
477
  }
476
478
 
477
- return Api.sendRequest(`/users/${params['id']}/resend_welcome_email`, 'POST', params, this.options)
479
+ const response = await Api.sendRequest(`/users/${params['id']}/resend_welcome_email`, 'POST', params, this.options)
480
+
481
+ return response?.data
478
482
  }
479
483
 
480
484
  // Trigger 2FA Reset process for user who has lost access to their existing 2FA methods
@@ -500,7 +504,9 @@ class User {
500
504
  }
501
505
  }
502
506
 
503
- return Api.sendRequest(`/users/${params['id']}/2fa/reset`, 'POST', params, this.options)
507
+ const response = await Api.sendRequest(`/users/${params['id']}/2fa/reset`, 'POST', params, this.options)
508
+
509
+ return response?.data
504
510
  }
505
511
 
506
512
  // Parameters:
@@ -645,7 +651,9 @@ class User {
645
651
  }
646
652
  }
647
653
 
648
- return Api.sendRequest(`/users/${params['id']}`, 'PATCH', params, this.options)
654
+ const response = await Api.sendRequest(`/users/${params['id']}`, 'PATCH', params, this.options)
655
+
656
+ return new User(response?.data, this.options)
649
657
  }
650
658
 
651
659
  delete = async (params = {}) => {
@@ -670,7 +678,9 @@ class User {
670
678
  }
671
679
  }
672
680
 
673
- return Api.sendRequest(`/users/${params['id']}`, 'DELETE', params, this.options)
681
+ const response = await Api.sendRequest(`/users/${params['id']}`, 'DELETE', params, this.options)
682
+
683
+ return response?.data
674
684
  }
675
685
 
676
686
  destroy = (params = {}) =>
@@ -73,7 +73,9 @@ class UserRequest {
73
73
  }
74
74
  }
75
75
 
76
- return Api.sendRequest(`/user_requests/${params['id']}`, 'DELETE', params, this.options)
76
+ const response = await Api.sendRequest(`/user_requests/${params['id']}`, 'DELETE', params, this.options)
77
+
78
+ return response?.data
77
79
  }
78
80
 
79
81
  destroy = (params = {}) =>
package/test/src/index.js CHANGED
@@ -70,14 +70,18 @@ const testSuite = async () => {
70
70
  assert(!!file.path)
71
71
  assert(file.display_name === displayName)
72
72
 
73
- const foundFile = await File.findDownload(destinationPath)
74
-
73
+ const foundFile = await File.find(destinationPath)
74
+
75
75
  assert(foundFile.path === destinationPath)
76
76
  assert(foundFile.display_name === displayName)
77
+ assert(typeof foundFile.getDownloadUri() === 'undefined')
77
78
 
78
79
  if (!isBrowser()) {
80
+ const downloadableFile = await foundFile.download()
81
+ assert(typeof downloadableFile.getDownloadUri() !== 'undefined')
82
+
79
83
  const downloadPath = `./${displayName}`
80
- await foundFile.downloadToFile(downloadPath)
84
+ await downloadableFile.downloadToFile(downloadPath)
81
85
 
82
86
  const fs = require('fs')
83
87
  const originalBuffer = fs.readFileSync(sourceFilePath)