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/File.js
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
import Readable from 'readable-stream'
|
2
2
|
import { Buffer } from 'safe-buffer'
|
3
3
|
|
4
|
+
/* eslint-disable no-unused-vars */
|
4
5
|
import Api from '../Api'
|
5
6
|
import * as errors from '../Errors'
|
6
|
-
import
|
7
|
-
|
8
|
-
import FileAction from './FileAction'
|
9
|
-
import FileUploadPart from './FileUploadPart'
|
7
|
+
import { isBrowser, getType, isArray, isInt, isObject, isString } from '../utils'
|
8
|
+
/* eslint-enable no-unused-vars */
|
10
9
|
|
11
10
|
/**
|
12
11
|
* Class File
|
@@ -42,6 +41,7 @@ class File {
|
|
42
41
|
parameters: params,
|
43
42
|
}
|
44
43
|
|
44
|
+
const FileUploadPart = require('./FileUploadPart.js').default
|
45
45
|
return new FileUploadPart(partData)
|
46
46
|
}
|
47
47
|
|
@@ -64,6 +64,7 @@ class File {
|
|
64
64
|
parameters: params,
|
65
65
|
}
|
66
66
|
|
67
|
+
const FileUploadPart = require('./FileUploadPart.js').default
|
67
68
|
return new FileUploadPart(partData)
|
68
69
|
}
|
69
70
|
|
@@ -85,7 +86,7 @@ class File {
|
|
85
86
|
const firstFileUploadPart = await File._openUpload(destinationPath, params, options)
|
86
87
|
|
87
88
|
if (!firstFileUploadPart) {
|
88
|
-
return
|
89
|
+
return null
|
89
90
|
}
|
90
91
|
|
91
92
|
const determinePartUploadUri = determinePartUploadUriRaw || (fileUploadPart => fileUploadPart.upload_uri)
|
@@ -110,12 +111,12 @@ class File {
|
|
110
111
|
const buffer = Buffer.concat(chunks)
|
111
112
|
const nextFileUploadPart = await File._continueUpload(destinationPath, ++part, firstFileUploadPart, options)
|
112
113
|
|
113
|
-
const
|
114
|
+
const uploadUri = determinePartUploadUri(nextFileUploadPart)
|
114
115
|
|
115
116
|
// instantiate an httpsAgent dynamically if needed
|
116
|
-
const agent = options.getAgentForUrl?.(
|
117
|
+
const agent = options.getAgentForUrl?.(uploadUri) || options?.agent
|
117
118
|
|
118
|
-
concurrentUploads.push(Api.sendFilePart(
|
119
|
+
concurrentUploads.push(Api.sendFilePart(uploadUri, 'PUT', buffer, { agent }))
|
119
120
|
}
|
120
121
|
|
121
122
|
await Promise.all(concurrentUploads)
|
@@ -153,18 +154,20 @@ class File {
|
|
153
154
|
chunks.push(lastChunkForCurrentPart)
|
154
155
|
|
155
156
|
const buffer = Buffer.concat(chunks)
|
157
|
+
/* eslint-disable-next-line no-await-in-loop */
|
156
158
|
const nextFileUploadPart = await File._continueUpload(destinationPath, ++part, firstFileUploadPart, options)
|
157
159
|
|
158
|
-
const
|
160
|
+
const uploadUri = determinePartUploadUri(nextFileUploadPart)
|
159
161
|
|
160
162
|
// instantiate an httpsAgent dynamically if needed
|
161
|
-
const agent = options.getAgentForUrl?.(
|
163
|
+
const agent = options.getAgentForUrl?.(uploadUri) || options?.agent
|
162
164
|
|
163
|
-
const uploadPromise = Api.sendFilePart(
|
165
|
+
const uploadPromise = Api.sendFilePart(uploadUri, 'PUT', buffer, { agent })
|
164
166
|
|
165
167
|
if (firstFileUploadPart.parallel_parts) {
|
166
168
|
concurrentUploads.push(uploadPromise)
|
167
169
|
} else {
|
170
|
+
/* eslint-disable-next-line no-await-in-loop */
|
168
171
|
await uploadPromise
|
169
172
|
}
|
170
173
|
|
@@ -217,6 +220,7 @@ class File {
|
|
217
220
|
return file
|
218
221
|
} catch (error) {
|
219
222
|
errors.handleErrorResponse(error)
|
223
|
+
return null
|
220
224
|
}
|
221
225
|
}
|
222
226
|
|
@@ -505,13 +509,13 @@ class File {
|
|
505
509
|
|
506
510
|
params.path = this.attributes.path
|
507
511
|
if (params['path'] && !isString(params['path'])) {
|
508
|
-
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
512
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params['path'])}`)
|
509
513
|
}
|
510
514
|
if (params['action'] && !isString(params['action'])) {
|
511
|
-
throw new errors.InvalidParameterError(`Bad parameter: action must be of type String, received ${getType(action)}`)
|
515
|
+
throw new errors.InvalidParameterError(`Bad parameter: action must be of type String, received ${getType(params['action'])}`)
|
512
516
|
}
|
513
517
|
if (params['preview_size'] && !isString(params['preview_size'])) {
|
514
|
-
throw new errors.InvalidParameterError(`Bad parameter: preview_size must be of type String, received ${getType(preview_size)}`)
|
518
|
+
throw new errors.InvalidParameterError(`Bad parameter: preview_size must be of type String, received ${getType(params['preview_size'])}`)
|
515
519
|
}
|
516
520
|
|
517
521
|
if (!params['path']) {
|
@@ -524,6 +528,7 @@ class File {
|
|
524
528
|
|
525
529
|
const response = await Api.sendRequest(`/files/${encodeURIComponent(params['path'])}`, 'GET', params, this.options)
|
526
530
|
|
531
|
+
|
527
532
|
return new File(response?.data, this.options)
|
528
533
|
}
|
529
534
|
|
@@ -541,13 +546,13 @@ class File {
|
|
541
546
|
|
542
547
|
params.path = this.attributes.path
|
543
548
|
if (params['path'] && !isString(params['path'])) {
|
544
|
-
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
549
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params['path'])}`)
|
545
550
|
}
|
546
551
|
if (params['provided_mtime'] && !isString(params['provided_mtime'])) {
|
547
|
-
throw new errors.InvalidParameterError(`Bad parameter: provided_mtime must be of type String, received ${getType(provided_mtime)}`)
|
552
|
+
throw new errors.InvalidParameterError(`Bad parameter: provided_mtime must be of type String, received ${getType(params['provided_mtime'])}`)
|
548
553
|
}
|
549
554
|
if (params['priority_color'] && !isString(params['priority_color'])) {
|
550
|
-
throw new errors.InvalidParameterError(`Bad parameter: priority_color must be of type String, received ${getType(priority_color)}`)
|
555
|
+
throw new errors.InvalidParameterError(`Bad parameter: priority_color must be of type String, received ${getType(params['priority_color'])}`)
|
551
556
|
}
|
552
557
|
|
553
558
|
if (!params['path']) {
|
@@ -560,6 +565,7 @@ class File {
|
|
560
565
|
|
561
566
|
const response = await Api.sendRequest(`/files/${encodeURIComponent(params['path'])}`, 'PATCH', params, this.options)
|
562
567
|
|
568
|
+
|
563
569
|
return new File(response?.data, this.options)
|
564
570
|
}
|
565
571
|
|
@@ -576,7 +582,7 @@ class File {
|
|
576
582
|
|
577
583
|
params.path = this.attributes.path
|
578
584
|
if (params['path'] && !isString(params['path'])) {
|
579
|
-
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
585
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params['path'])}`)
|
580
586
|
}
|
581
587
|
|
582
588
|
if (!params['path']) {
|
@@ -611,10 +617,10 @@ class File {
|
|
611
617
|
|
612
618
|
params.path = this.attributes.path
|
613
619
|
if (params['path'] && !isString(params['path'])) {
|
614
|
-
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
620
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params['path'])}`)
|
615
621
|
}
|
616
622
|
if (params['destination'] && !isString(params['destination'])) {
|
617
|
-
throw new errors.InvalidParameterError(`Bad parameter: destination must be of type String, received ${getType(destination)}`)
|
623
|
+
throw new errors.InvalidParameterError(`Bad parameter: destination must be of type String, received ${getType(params['destination'])}`)
|
618
624
|
}
|
619
625
|
|
620
626
|
if (!params['path']) {
|
@@ -635,6 +641,7 @@ class File {
|
|
635
641
|
|
636
642
|
const response = await Api.sendRequest(`/file_actions/copy/${encodeURIComponent(params['path'])}`, 'POST', params, this.options)
|
637
643
|
|
644
|
+
const FileAction = require("./FileAction.js").default
|
638
645
|
return new FileAction(response?.data, this.options)
|
639
646
|
}
|
640
647
|
|
@@ -653,10 +660,10 @@ class File {
|
|
653
660
|
|
654
661
|
params.path = this.attributes.path
|
655
662
|
if (params['path'] && !isString(params['path'])) {
|
656
|
-
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
663
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params['path'])}`)
|
657
664
|
}
|
658
665
|
if (params['destination'] && !isString(params['destination'])) {
|
659
|
-
throw new errors.InvalidParameterError(`Bad parameter: destination must be of type String, received ${getType(destination)}`)
|
666
|
+
throw new errors.InvalidParameterError(`Bad parameter: destination must be of type String, received ${getType(params['destination'])}`)
|
660
667
|
}
|
661
668
|
|
662
669
|
if (!params['path']) {
|
@@ -677,6 +684,7 @@ class File {
|
|
677
684
|
|
678
685
|
const response = await Api.sendRequest(`/file_actions/move/${encodeURIComponent(params['path'])}`, 'POST', params, this.options)
|
679
686
|
|
687
|
+
const FileAction = require("./FileAction.js").default
|
680
688
|
return new FileAction(response?.data, this.options)
|
681
689
|
}
|
682
690
|
|
@@ -701,22 +709,22 @@ class File {
|
|
701
709
|
|
702
710
|
params.path = this.attributes.path
|
703
711
|
if (params['path'] && !isString(params['path'])) {
|
704
|
-
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(path)}`)
|
712
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params['path'])}`)
|
705
713
|
}
|
706
714
|
if (params['part'] && !isInt(params['part'])) {
|
707
|
-
throw new errors.InvalidParameterError(`Bad parameter: part must be of type Int, received ${getType(part)}`)
|
715
|
+
throw new errors.InvalidParameterError(`Bad parameter: part must be of type Int, received ${getType(params['part'])}`)
|
708
716
|
}
|
709
717
|
if (params['parts'] && !isInt(params['parts'])) {
|
710
|
-
throw new errors.InvalidParameterError(`Bad parameter: parts must be of type Int, received ${getType(parts)}`)
|
718
|
+
throw new errors.InvalidParameterError(`Bad parameter: parts must be of type Int, received ${getType(params['parts'])}`)
|
711
719
|
}
|
712
720
|
if (params['ref'] && !isString(params['ref'])) {
|
713
|
-
throw new errors.InvalidParameterError(`Bad parameter: ref must be of type String, received ${getType(ref)}`)
|
721
|
+
throw new errors.InvalidParameterError(`Bad parameter: ref must be of type String, received ${getType(params['ref'])}`)
|
714
722
|
}
|
715
723
|
if (params['restart'] && !isInt(params['restart'])) {
|
716
|
-
throw new errors.InvalidParameterError(`Bad parameter: restart must be of type Int, received ${getType(restart)}`)
|
724
|
+
throw new errors.InvalidParameterError(`Bad parameter: restart must be of type Int, received ${getType(params['restart'])}`)
|
717
725
|
}
|
718
726
|
if (params['size'] && !isInt(params['size'])) {
|
719
|
-
throw new errors.InvalidParameterError(`Bad parameter: size must be of type Int, received ${getType(size)}`)
|
727
|
+
throw new errors.InvalidParameterError(`Bad parameter: size must be of type Int, received ${getType(params['size'])}`)
|
720
728
|
}
|
721
729
|
|
722
730
|
if (!params['path']) {
|
@@ -729,6 +737,7 @@ class File {
|
|
729
737
|
|
730
738
|
const response = await Api.sendRequest(`/file_actions/begin_upload/${encodeURIComponent(params['path'])}`, 'POST', params, this.options)
|
731
739
|
|
740
|
+
const FileUploadPart = require("./FileUploadPart.js").default
|
732
741
|
return response?.data?.map(obj => new FileUploadPart(obj, this.options)) || []
|
733
742
|
}
|
734
743
|
|
@@ -806,6 +815,7 @@ class File {
|
|
806
815
|
|
807
816
|
const response = await Api.sendRequest(`/files/${encodeURIComponent(params['path'])}`, 'POST', params, options)
|
808
817
|
|
818
|
+
|
809
819
|
return new File(response?.data, options)
|
810
820
|
}
|
811
821
|
|
@@ -835,6 +845,7 @@ class File {
|
|
835
845
|
|
836
846
|
const response = await Api.sendRequest(`/file_actions/metadata/${encodeURIComponent(params['path'])}`, 'GET', params, options)
|
837
847
|
|
848
|
+
|
838
849
|
return new File(response?.data, options)
|
839
850
|
}
|
840
851
|
|
package/src/models/FileAction.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 FileAction
|
@@ -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 FileComment
|
@@ -65,10 +66,10 @@ class FileComment {
|
|
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 FileComment {
|
|
89
90
|
|
90
91
|
const response = await Api.sendRequest(`/file_comments/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
91
92
|
|
93
|
+
|
92
94
|
return new FileComment(response?.data, this.options)
|
93
95
|
}
|
94
96
|
|
@@ -103,7 +105,7 @@ class FileComment {
|
|
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']) {
|
@@ -161,6 +163,7 @@ class FileComment {
|
|
161
163
|
|
162
164
|
const response = await Api.sendRequest(`/file_comments/files/${encodeURIComponent(params['path'])}`, 'GET', params, options)
|
163
165
|
|
166
|
+
|
164
167
|
return response?.data?.map(obj => new FileComment(obj, options)) || []
|
165
168
|
}
|
166
169
|
|
@@ -186,6 +189,7 @@ class FileComment {
|
|
186
189
|
|
187
190
|
const response = await Api.sendRequest(`/file_comments`, 'POST', params, options)
|
188
191
|
|
192
|
+
|
189
193
|
return new FileComment(response?.data, options)
|
190
194
|
}
|
191
195
|
}
|
@@ -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 FileCommentReaction
|
@@ -63,7 +64,7 @@ class FileCommentReaction {
|
|
63
64
|
|
64
65
|
params.id = this.attributes.id
|
65
66
|
if (params['id'] && !isInt(params['id'])) {
|
66
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
67
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
67
68
|
}
|
68
69
|
|
69
70
|
if (!params['id']) {
|
@@ -119,6 +120,7 @@ class FileCommentReaction {
|
|
119
120
|
|
120
121
|
const response = await Api.sendRequest(`/file_comment_reactions`, 'POST', params, options)
|
121
122
|
|
123
|
+
|
122
124
|
return new FileCommentReaction(response?.data, options)
|
123
125
|
}
|
124
126
|
}
|
@@ -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 FileMigration
|
@@ -70,6 +71,7 @@ class FileMigration {
|
|
70
71
|
|
71
72
|
const response = await Api.sendRequest(`/file_migrations/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
72
73
|
|
74
|
+
|
73
75
|
return new FileMigration(response?.data, options)
|
74
76
|
}
|
75
77
|
|
@@ -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 FileUploadPart
|
package/src/models/Folder.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
1
2
|
import Api from '../Api'
|
2
3
|
import * as errors from '../Errors'
|
3
|
-
import
|
4
|
-
|
5
|
-
import File from './File'
|
4
|
+
import { getType, isArray, isInt, isObject, isString } from '../utils'
|
5
|
+
/* eslint-enable no-unused-vars */
|
6
6
|
|
7
7
|
/**
|
8
8
|
* Class Folder
|
@@ -208,6 +208,7 @@ class Folder {
|
|
208
208
|
|
209
209
|
const response = await Api.sendRequest(`/folders/${encodeURIComponent(params['path'])}`, 'GET', params, options)
|
210
210
|
|
211
|
+
const File = require("./File.js").default
|
211
212
|
return response?.data?.map(obj => new File(obj, options)) || []
|
212
213
|
}
|
213
214
|
|
@@ -236,6 +237,7 @@ class Folder {
|
|
236
237
|
|
237
238
|
const response = await Api.sendRequest(`/folders/${encodeURIComponent(params['path'])}`, 'POST', params, options)
|
238
239
|
|
240
|
+
const File = require("./File.js").default
|
239
241
|
return new File(response?.data, options)
|
240
242
|
}
|
241
243
|
}
|
package/src/models/FormField.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 FormField
|
@@ -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 FormFieldSet
|
@@ -97,13 +98,13 @@ class FormFieldSet {
|
|
97
98
|
|
98
99
|
params.id = this.attributes.id
|
99
100
|
if (params['id'] && !isInt(params['id'])) {
|
100
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
101
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
101
102
|
}
|
102
103
|
if (params['title'] && !isString(params['title'])) {
|
103
|
-
throw new errors.InvalidParameterError(`Bad parameter: title must be of type String, received ${getType(title)}`)
|
104
|
+
throw new errors.InvalidParameterError(`Bad parameter: title must be of type String, received ${getType(params['title'])}`)
|
104
105
|
}
|
105
106
|
if (params['form_fields'] && !isArray(params['form_fields'])) {
|
106
|
-
throw new errors.InvalidParameterError(`Bad parameter: form_fields must be of type Array, received ${getType(form_fields)}`)
|
107
|
+
throw new errors.InvalidParameterError(`Bad parameter: form_fields must be of type Array, received ${getType(params['form_fields'])}`)
|
107
108
|
}
|
108
109
|
|
109
110
|
if (!params['id']) {
|
@@ -116,6 +117,7 @@ class FormFieldSet {
|
|
116
117
|
|
117
118
|
const response = await Api.sendRequest(`/form_field_sets/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
118
119
|
|
120
|
+
|
119
121
|
return new FormFieldSet(response?.data, this.options)
|
120
122
|
}
|
121
123
|
|
@@ -130,7 +132,7 @@ class FormFieldSet {
|
|
130
132
|
|
131
133
|
params.id = this.attributes.id
|
132
134
|
if (params['id'] && !isInt(params['id'])) {
|
133
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
135
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
134
136
|
}
|
135
137
|
|
136
138
|
if (!params['id']) {
|
@@ -178,6 +180,7 @@ class FormFieldSet {
|
|
178
180
|
|
179
181
|
const response = await Api.sendRequest(`/form_field_sets`, 'GET', params, options)
|
180
182
|
|
183
|
+
|
181
184
|
return response?.data?.map(obj => new FormFieldSet(obj, options)) || []
|
182
185
|
}
|
183
186
|
|
@@ -203,6 +206,7 @@ class FormFieldSet {
|
|
203
206
|
|
204
207
|
const response = await Api.sendRequest(`/form_field_sets/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
205
208
|
|
209
|
+
|
206
210
|
return new FormFieldSet(response?.data, options)
|
207
211
|
}
|
208
212
|
|
@@ -231,6 +235,7 @@ class FormFieldSet {
|
|
231
235
|
|
232
236
|
const response = await Api.sendRequest(`/form_field_sets`, 'POST', params, options)
|
233
237
|
|
238
|
+
|
234
239
|
return new FormFieldSet(response?.data, options)
|
235
240
|
}
|
236
241
|
}
|
package/src/models/GpgKey.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 GpgKey
|
@@ -89,19 +90,19 @@ class GpgKey {
|
|
89
90
|
|
90
91
|
params.id = this.attributes.id
|
91
92
|
if (params['id'] && !isInt(params['id'])) {
|
92
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
93
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
93
94
|
}
|
94
95
|
if (params['public_key'] && !isString(params['public_key'])) {
|
95
|
-
throw new errors.InvalidParameterError(`Bad parameter: public_key must be of type String, received ${getType(public_key)}`)
|
96
|
+
throw new errors.InvalidParameterError(`Bad parameter: public_key must be of type String, received ${getType(params['public_key'])}`)
|
96
97
|
}
|
97
98
|
if (params['private_key'] && !isString(params['private_key'])) {
|
98
|
-
throw new errors.InvalidParameterError(`Bad parameter: private_key must be of type String, received ${getType(private_key)}`)
|
99
|
+
throw new errors.InvalidParameterError(`Bad parameter: private_key must be of type String, received ${getType(params['private_key'])}`)
|
99
100
|
}
|
100
101
|
if (params['private_key_password'] && !isString(params['private_key_password'])) {
|
101
|
-
throw new errors.InvalidParameterError(`Bad parameter: private_key_password must be of type String, received ${getType(private_key_password)}`)
|
102
|
+
throw new errors.InvalidParameterError(`Bad parameter: private_key_password must be of type String, received ${getType(params['private_key_password'])}`)
|
102
103
|
}
|
103
104
|
if (params['name'] && !isString(params['name'])) {
|
104
|
-
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(name)}`)
|
105
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
|
105
106
|
}
|
106
107
|
|
107
108
|
if (!params['id']) {
|
@@ -114,6 +115,7 @@ class GpgKey {
|
|
114
115
|
|
115
116
|
const response = await Api.sendRequest(`/gpg_keys/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
116
117
|
|
118
|
+
|
117
119
|
return new GpgKey(response?.data, this.options)
|
118
120
|
}
|
119
121
|
|
@@ -128,7 +130,7 @@ class GpgKey {
|
|
128
130
|
|
129
131
|
params.id = this.attributes.id
|
130
132
|
if (params['id'] && !isInt(params['id'])) {
|
131
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
133
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
132
134
|
}
|
133
135
|
|
134
136
|
if (!params['id']) {
|
@@ -177,6 +179,7 @@ class GpgKey {
|
|
177
179
|
|
178
180
|
const response = await Api.sendRequest(`/gpg_keys`, 'GET', params, options)
|
179
181
|
|
182
|
+
|
180
183
|
return response?.data?.map(obj => new GpgKey(obj, options)) || []
|
181
184
|
}
|
182
185
|
|
@@ -202,6 +205,7 @@ class GpgKey {
|
|
202
205
|
|
203
206
|
const response = await Api.sendRequest(`/gpg_keys/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
204
207
|
|
208
|
+
|
205
209
|
return new GpgKey(response?.data, options)
|
206
210
|
}
|
207
211
|
|
@@ -241,6 +245,7 @@ class GpgKey {
|
|
241
245
|
|
242
246
|
const response = await Api.sendRequest(`/gpg_keys`, 'POST', params, options)
|
243
247
|
|
248
|
+
|
244
249
|
return new GpgKey(response?.data, options)
|
245
250
|
}
|
246
251
|
}
|
package/src/models/Group.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 Group
|
@@ -82,19 +83,19 @@ class Group {
|
|
82
83
|
|
83
84
|
params.id = this.attributes.id
|
84
85
|
if (params['id'] && !isInt(params['id'])) {
|
85
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
86
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
86
87
|
}
|
87
88
|
if (params['name'] && !isString(params['name'])) {
|
88
|
-
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(name)}`)
|
89
|
+
throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
|
89
90
|
}
|
90
91
|
if (params['notes'] && !isString(params['notes'])) {
|
91
|
-
throw new errors.InvalidParameterError(`Bad parameter: notes must be of type String, received ${getType(notes)}`)
|
92
|
+
throw new errors.InvalidParameterError(`Bad parameter: notes must be of type String, received ${getType(params['notes'])}`)
|
92
93
|
}
|
93
94
|
if (params['user_ids'] && !isString(params['user_ids'])) {
|
94
|
-
throw new errors.InvalidParameterError(`Bad parameter: user_ids must be of type String, received ${getType(user_ids)}`)
|
95
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_ids must be of type String, received ${getType(params['user_ids'])}`)
|
95
96
|
}
|
96
97
|
if (params['admin_ids'] && !isString(params['admin_ids'])) {
|
97
|
-
throw new errors.InvalidParameterError(`Bad parameter: admin_ids must be of type String, received ${getType(admin_ids)}`)
|
98
|
+
throw new errors.InvalidParameterError(`Bad parameter: admin_ids must be of type String, received ${getType(params['admin_ids'])}`)
|
98
99
|
}
|
99
100
|
|
100
101
|
if (!params['id']) {
|
@@ -107,6 +108,7 @@ class Group {
|
|
107
108
|
|
108
109
|
const response = await Api.sendRequest(`/groups/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
|
109
110
|
|
111
|
+
|
110
112
|
return new Group(response?.data, this.options)
|
111
113
|
}
|
112
114
|
|
@@ -121,7 +123,7 @@ class Group {
|
|
121
123
|
|
122
124
|
params.id = this.attributes.id
|
123
125
|
if (params['id'] && !isInt(params['id'])) {
|
124
|
-
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(id)}`)
|
126
|
+
throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
|
125
127
|
}
|
126
128
|
|
127
129
|
if (!params['id']) {
|
@@ -172,6 +174,7 @@ class Group {
|
|
172
174
|
|
173
175
|
const response = await Api.sendRequest(`/groups`, 'GET', params, options)
|
174
176
|
|
177
|
+
|
175
178
|
return response?.data?.map(obj => new Group(obj, options)) || []
|
176
179
|
}
|
177
180
|
|
@@ -197,6 +200,7 @@ class Group {
|
|
197
200
|
|
198
201
|
const response = await Api.sendRequest(`/groups/${encodeURIComponent(params['id'])}`, 'GET', params, options)
|
199
202
|
|
203
|
+
|
200
204
|
return new Group(response?.data, options)
|
201
205
|
}
|
202
206
|
|
@@ -227,6 +231,7 @@ class Group {
|
|
227
231
|
|
228
232
|
const response = await Api.sendRequest(`/groups`, 'POST', params, options)
|
229
233
|
|
234
|
+
|
230
235
|
return new Group(response?.data, options)
|
231
236
|
}
|
232
237
|
}
|