├── .babelrc ├── .eslintrc.js ├── .gitignore ├── CONTRIBUTORS ├── LICENSE ├── README.md ├── SECURITY.md ├── _VERSION ├── build.sh ├── docs ├── Errors.md └── models │ ├── AccountLineItem.md │ ├── Action.md │ ├── ActionNotificationExport.md │ ├── ActionNotificationExportResult.md │ ├── ApiKey.md │ ├── ApiRequestLog.md │ ├── App.md │ ├── As2IncomingMessage.md │ ├── As2OutgoingMessage.md │ ├── As2Partner.md │ ├── As2Station.md │ ├── Auto.md │ ├── Automation.md │ ├── AutomationLog.md │ ├── AutomationRun.md │ ├── BandwidthSnapshot.md │ ├── Behavior.md │ ├── Bundle.md │ ├── BundleAction.md │ ├── BundleDownload.md │ ├── BundleNotification.md │ ├── BundlePath.md │ ├── BundleRecipient.md │ ├── BundleRegistration.md │ ├── Clickwrap.md │ ├── DnsRecord.md │ ├── EmailIncomingMessage.md │ ├── EmailLog.md │ ├── Errors.md │ ├── ExavaultApiRequestLog.md │ ├── ExternalEvent.md │ ├── File.md │ ├── FileAction.md │ ├── FileComment.md │ ├── FileCommentReaction.md │ ├── FileMigration.md │ ├── FileMigrationLog.md │ ├── FileUploadPart.md │ ├── Folder.md │ ├── FormField.md │ ├── FormFieldSet.md │ ├── FtpActionLog.md │ ├── GpgKey.md │ ├── Group.md │ ├── GroupUser.md │ ├── History.md │ ├── HistoryExport.md │ ├── HistoryExportResult.md │ ├── Image.md │ ├── InboxRecipient.md │ ├── InboxRegistration.md │ ├── InboxUpload.md │ ├── Invoice.md │ ├── InvoiceLineItem.md │ ├── IpAddress.md │ ├── Lock.md │ ├── Message.md │ ├── MessageComment.md │ ├── MessageCommentReaction.md │ ├── MessageReaction.md │ ├── Notification.md │ ├── OutboundConnectionLog.md │ ├── Payment.md │ ├── PaymentLineItem.md │ ├── Permission.md │ ├── Preview.md │ ├── Priority.md │ ├── Project.md │ ├── PublicHostingRequestLog.md │ ├── PublicIpAddress.md │ ├── PublicKey.md │ ├── RemoteBandwidthSnapshot.md │ ├── RemoteServer.md │ ├── RemoteServerConfigurationFile.md │ ├── Request.md │ ├── Restore.md │ ├── Session.md │ ├── SettingsChange.md │ ├── SftpActionLog.md │ ├── SftpHostKey.md │ ├── ShareGroup.md │ ├── ShareGroupMember.md │ ├── SiemHttpDestination.md │ ├── Site.md │ ├── Snapshot.md │ ├── SsoStrategy.md │ ├── Status.md │ ├── Style.md │ ├── SyncLog.md │ ├── UsageByTopLevelDir.md │ ├── UsageDailySnapshot.md │ ├── UsageSnapshot.md │ ├── User.md │ ├── UserCipherUse.md │ ├── UserLifecycleRule.md │ ├── UserRequest.md │ ├── UserSftpClientUse.md │ ├── WebDavActionLog.md │ └── WebhookTest.md ├── files.com-logo.png ├── index.js ├── lib ├── Api.js ├── Errors.js ├── Files.js ├── Logger.js ├── index.js ├── isomorphic │ └── File.node.js ├── models │ ├── AccountLineItem.js │ ├── Action.js │ ├── ActionNotificationExport.js │ ├── ActionNotificationExportResult.js │ ├── ApiKey.js │ ├── ApiRequestLog.js │ ├── App.js │ ├── As2IncomingMessage.js │ ├── As2OutgoingMessage.js │ ├── As2Partner.js │ ├── As2Station.js │ ├── Auto.js │ ├── Automation.js │ ├── AutomationLog.js │ ├── AutomationRun.js │ ├── BandwidthSnapshot.js │ ├── Behavior.js │ ├── Bundle.js │ ├── BundleAction.js │ ├── BundleDownload.js │ ├── BundleNotification.js │ ├── BundlePath.js │ ├── BundleRecipient.js │ ├── BundleRegistration.js │ ├── Clickwrap.js │ ├── DnsRecord.js │ ├── EmailIncomingMessage.js │ ├── EmailLog.js │ ├── Errors.js │ ├── ExavaultApiRequestLog.js │ ├── ExternalEvent.js │ ├── File.js │ ├── FileAction.js │ ├── FileComment.js │ ├── FileCommentReaction.js │ ├── FileMigration.js │ ├── FileMigrationLog.js │ ├── FileUploadPart.js │ ├── Folder.js │ ├── FormField.js │ ├── FormFieldSet.js │ ├── FtpActionLog.js │ ├── GpgKey.js │ ├── Group.js │ ├── GroupUser.js │ ├── History.js │ ├── HistoryExport.js │ ├── HistoryExportResult.js │ ├── Image.js │ ├── InboxRecipient.js │ ├── InboxRegistration.js │ ├── InboxUpload.js │ ├── Invoice.js │ ├── InvoiceLineItem.js │ ├── IpAddress.js │ ├── Lock.js │ ├── Message.js │ ├── MessageComment.js │ ├── MessageCommentReaction.js │ ├── MessageReaction.js │ ├── Notification.js │ ├── OutboundConnectionLog.js │ ├── Payment.js │ ├── PaymentLineItem.js │ ├── Permission.js │ ├── Preview.js │ ├── Priority.js │ ├── Project.js │ ├── PublicHostingRequestLog.js │ ├── PublicIpAddress.js │ ├── PublicKey.js │ ├── RemoteBandwidthSnapshot.js │ ├── RemoteServer.js │ ├── RemoteServerConfigurationFile.js │ ├── Request.js │ ├── Restore.js │ ├── Session.js │ ├── SettingsChange.js │ ├── SftpActionLog.js │ ├── SftpHostKey.js │ ├── ShareGroup.js │ ├── ShareGroupMember.js │ ├── SiemHttpDestination.js │ ├── Site.js │ ├── Snapshot.js │ ├── SsoStrategy.js │ ├── Status.js │ ├── Style.js │ ├── SyncLog.js │ ├── UsageByTopLevelDir.js │ ├── UsageDailySnapshot.js │ ├── UsageSnapshot.js │ ├── User.js │ ├── UserCipherUse.js │ ├── UserLifecycleRule.js │ ├── UserRequest.js │ ├── UserSftpClientUse.js │ ├── WebDavActionLog.js │ └── WebhookTest.js ├── utils.js └── utils │ ├── pathNormalizer.js │ └── pathNormalizer.test.js ├── package.json ├── shared ├── header_test_data.json ├── normalization_for_comparison_test_data.json └── url_test_data.json ├── src ├── Api.js ├── Errors.js ├── Files.js ├── Logger.js ├── index.js ├── isomorphic │ └── File.node.js ├── models │ ├── AccountLineItem.js │ ├── Action.js │ ├── ActionNotificationExport.js │ ├── ActionNotificationExportResult.js │ ├── ApiKey.js │ ├── ApiRequestLog.js │ ├── App.js │ ├── As2IncomingMessage.js │ ├── As2OutgoingMessage.js │ ├── As2Partner.js │ ├── As2Station.js │ ├── Auto.js │ ├── Automation.js │ ├── AutomationLog.js │ ├── AutomationRun.js │ ├── BandwidthSnapshot.js │ ├── Behavior.js │ ├── Bundle.js │ ├── BundleAction.js │ ├── BundleDownload.js │ ├── BundleNotification.js │ ├── BundlePath.js │ ├── BundleRecipient.js │ ├── BundleRegistration.js │ ├── Clickwrap.js │ ├── DnsRecord.js │ ├── EmailIncomingMessage.js │ ├── EmailLog.js │ ├── Errors.js │ ├── ExavaultApiRequestLog.js │ ├── ExternalEvent.js │ ├── File.js │ ├── FileAction.js │ ├── FileComment.js │ ├── FileCommentReaction.js │ ├── FileMigration.js │ ├── FileMigrationLog.js │ ├── FileUploadPart.js │ ├── Folder.js │ ├── FormField.js │ ├── FormFieldSet.js │ ├── FtpActionLog.js │ ├── GpgKey.js │ ├── Group.js │ ├── GroupUser.js │ ├── History.js │ ├── HistoryExport.js │ ├── HistoryExportResult.js │ ├── Image.js │ ├── InboxRecipient.js │ ├── InboxRegistration.js │ ├── InboxUpload.js │ ├── Invoice.js │ ├── InvoiceLineItem.js │ ├── IpAddress.js │ ├── Lock.js │ ├── Message.js │ ├── MessageComment.js │ ├── MessageCommentReaction.js │ ├── MessageReaction.js │ ├── Notification.js │ ├── OutboundConnectionLog.js │ ├── Payment.js │ ├── PaymentLineItem.js │ ├── Permission.js │ ├── Preview.js │ ├── Priority.js │ ├── Project.js │ ├── PublicHostingRequestLog.js │ ├── PublicIpAddress.js │ ├── PublicKey.js │ ├── RemoteBandwidthSnapshot.js │ ├── RemoteServer.js │ ├── RemoteServerConfigurationFile.js │ ├── Request.js │ ├── Restore.js │ ├── Session.js │ ├── SettingsChange.js │ ├── SftpActionLog.js │ ├── SftpHostKey.js │ ├── ShareGroup.js │ ├── ShareGroupMember.js │ ├── SiemHttpDestination.js │ ├── Site.js │ ├── Snapshot.js │ ├── SsoStrategy.js │ ├── Status.js │ ├── Style.js │ ├── SyncLog.js │ ├── UsageByTopLevelDir.js │ ├── UsageDailySnapshot.js │ ├── UsageSnapshot.js │ ├── User.js │ ├── UserCipherUse.js │ ├── UserLifecycleRule.js │ ├── UserRequest.js │ ├── UserSftpClientUse.js │ ├── WebDavActionLog.js │ └── WebhookTest.js ├── utils.js └── utils │ ├── pathNormalizer.js │ └── pathNormalizer.test.js ├── test.sh └── test ├── Api.test.js └── integration ├── .babelrc ├── index.js ├── package.json └── src └── index.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", 5 | { 6 | "targets": { 7 | "ie": "11" 8 | } 9 | } 10 | ] 11 | ], 12 | "plugins": [ 13 | "@babel/plugin-proposal-class-properties", 14 | ["@babel/plugin-transform-modules-commonjs", { 15 | "loose": true 16 | }], 17 | "@babel/plugin-transform-runtime" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | yarn.lock 2 | package-lock.json 3 | node_modules/ 4 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | Daniel Cowgill 2 | Dustin Zeisler 3 | Jesse Harris 4 | Kevin Bombino 5 | Kevin Killingsworth 6 | Martyn Garcia 7 | Rommel Santor 8 | Sam Harrison 9 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019- Action Verb, LLC (https://www.files.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | Thank you for your interest in Files.com security. We recognize that your data is very personal and sensitive and we work hard to keep it protected. 4 | 5 | 6 | ## Supported Versions 7 | 8 | Only the latest version will be supported with security updates. 9 | 10 | 11 | ## Reporting a Vulnerability 12 | 13 | Here at Files.com, we celebrate security and we encourage independent security researchers to help us keep our products secure. 14 | 15 | We offer a Security Bug Bounty Program to create an incentive and reward structure so that researchers are able to devote resources to working on Files.com. 16 | 17 | We offer our Bug Bounty Program on HackerOne at https://hackerone.com/files 18 | 19 | We prefer to receive reports of vulnerabilities there. 20 | 21 | If you do not wish to use HackerOne, alternate submission instructions are available at: 22 | https://www.files.com/legal/security-bounty/ 23 | 24 | Thank you for helping keep the Files.com community secure! 25 | -------------------------------------------------------------------------------- /_VERSION: -------------------------------------------------------------------------------- 1 | 1.2.257 2 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | rm -f ~/.npmrc && rm -f ~/.yarnrc 4 | yarn && yarn build -------------------------------------------------------------------------------- /docs/models/AccountLineItem.md: -------------------------------------------------------------------------------- 1 | # AccountLineItem 2 | 3 | ## Example AccountLineItem Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "amount": 1.0, 9 | "balance": 1.0, 10 | "created_at": "2000-01-01T01:00:00Z", 11 | "currency": "USD", 12 | "download_uri": "https://url...", 13 | "invoice_line_items": [ 14 | { 15 | "amount": 1.0, 16 | "created_at": "2000-01-01T01:00:00Z", 17 | "description": "Service from 2019-01-01 through 2019-12-31", 18 | "type": "invoice", 19 | "service_end_at": "2000-01-01T01:00:00Z", 20 | "service_start_at": "2000-01-01T01:00:00Z", 21 | "plan": "Premier", 22 | "site": "My site" 23 | } 24 | ], 25 | "method": "paypal", 26 | "payment_line_items": [ 27 | { 28 | "amount": 1.0, 29 | "created_at": "2000-01-01T01:00:00Z", 30 | "invoice_id": 1, 31 | "payment_id": 1 32 | } 33 | ], 34 | "payment_reversed_at": "2000-01-01T01:00:00Z", 35 | "payment_type": "example", 36 | "site_name": "My Site", 37 | "type": "invoice" 38 | } 39 | ``` 40 | 41 | * `id` (int64): Line item Id 42 | * `amount` (double): Line item amount 43 | * `balance` (double): Line item balance 44 | * `created_at` (date-time): Line item created at 45 | * `currency` (string): Line item currency 46 | * `download_uri` (string): Line item download uri 47 | * `invoice_line_items` (array(object)): Associated invoice line items 48 | * `method` (string): Line item payment method 49 | * `payment_line_items` (array(object)): Associated payment line items 50 | * `payment_reversed_at` (date-time): Date/time payment was reversed if applicable 51 | * `payment_type` (string): Type of payment if applicable 52 | * `site_name` (string): Site name this line item is for 53 | * `type` (string): Type of line item, either payment or invoice 54 | -------------------------------------------------------------------------------- /docs/models/Action.md: -------------------------------------------------------------------------------- 1 | # Action 2 | 3 | ## Example Action Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "path": "", 9 | "when": "2000-01-01T01:00:00Z", 10 | "destination": "/to_path", 11 | "display": "Actual text of the action here.", 12 | "ip": "192.283.128.182", 13 | "source": "/from_path", 14 | "targets": null, 15 | "user_id": 1, 16 | "username": "user", 17 | "user_is_from_parent_site": true, 18 | "action": "create", 19 | "failure_type": "none", 20 | "interface": "web" 21 | } 22 | ``` 23 | 24 | * `id` (int64): Action ID 25 | * `path` (string): Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 26 | * `when` (date-time): Action occurrence date/time 27 | * `destination` (string): The destination path for this action, if applicable 28 | * `display` (string): Friendly displayed output 29 | * `ip` (string): IP Address that performed this action 30 | * `source` (string): The source path for this action, if applicable 31 | * `targets` (object): Targets 32 | * `user_id` (int64): User ID 33 | * `username` (string): Username 34 | * `user_is_from_parent_site` (boolean): true if this change was performed by a user on a parent site. 35 | * `action` (string): Type of action 36 | * `failure_type` (string): Failure type. If action was a user login or session failure, why did it fail? 37 | * `interface` (string): Interface on which this action occurred. 38 | -------------------------------------------------------------------------------- /docs/models/ActionNotificationExport.md: -------------------------------------------------------------------------------- 1 | # ActionNotificationExport 2 | 3 | ## Example ActionNotificationExport Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "export_version": "20201213.2", 9 | "start_at": "2000-01-01T01:00:00Z", 10 | "end_at": "2000-01-01T01:00:00Z", 11 | "status": "ready", 12 | "query_path": "MyFile.txt", 13 | "query_folder": "MyFolder", 14 | "query_message": "Connection Refused", 15 | "query_request_method": "GET", 16 | "query_request_url": "http://example.com/webhook", 17 | "query_status": "200", 18 | "query_success": true, 19 | "results_url": "https://files.com/action_notification_results.csv" 20 | } 21 | ``` 22 | 23 | * `id` (int64): History Export ID 24 | * `export_version` (string): Version of the underlying records for the export. 25 | * `start_at` (date-time): Start date/time of export range. 26 | * `end_at` (date-time): End date/time of export range. 27 | * `status` (string): Status of export. Valid values: `building`, `ready`, or `failed` 28 | * `query_path` (string): Return notifications that were triggered by actions on this specific path. 29 | * `query_folder` (string): Return notifications that were triggered by actions in this folder. 30 | * `query_message` (string): Error message associated with the request, if any. 31 | * `query_request_method` (string): The HTTP request method used by the webhook. 32 | * `query_request_url` (string): The target webhook URL. 33 | * `query_status` (string): The HTTP status returned from the server in response to the webhook request. 34 | * `query_success` (boolean): true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise. 35 | * `results_url` (string): If `status` is `ready`, this will be a URL where all the results can be downloaded at once as a CSV. 36 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 37 | 38 | --- 39 | 40 | ## Show Action Notification Export 41 | 42 | ``` 43 | await ActionNotificationExport.find(id) 44 | ``` 45 | 46 | 47 | ### Parameters 48 | 49 | * `id` (int64): Required - Action Notification Export ID. 50 | 51 | --- 52 | 53 | ## Create Action Notification Export 54 | 55 | ``` 56 | await ActionNotificationExport.create({ 57 | 'user_id': 1, 58 | 'start_at': "2000-01-01T01:00:00Z", 59 | 'end_at': "2000-01-01T01:00:00Z", 60 | 'query_message': "Connection Refused", 61 | 'query_request_method': "GET", 62 | 'query_request_url': "http://example.com/webhook", 63 | 'query_status': "200", 64 | 'query_success': true, 65 | 'query_path': "MyFile.txt", 66 | 'query_folder': "MyFolder", 67 | }) 68 | ``` 69 | 70 | 71 | ### Parameters 72 | 73 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 74 | * `start_at` (string): Start date/time of export range. 75 | * `end_at` (string): End date/time of export range. 76 | * `query_message` (string): Error message associated with the request, if any. 77 | * `query_request_method` (string): The HTTP request method used by the webhook. 78 | * `query_request_url` (string): The target webhook URL. 79 | * `query_status` (string): The HTTP status returned from the server in response to the webhook request. 80 | * `query_success` (boolean): true if the webhook request succeeded (i.e. returned a 200 or 204 response status). false otherwise. 81 | * `query_path` (string): Return notifications that were triggered by actions on this specific path. 82 | * `query_folder` (string): Return notifications that were triggered by actions in this folder. 83 | -------------------------------------------------------------------------------- /docs/models/ActionNotificationExportResult.md: -------------------------------------------------------------------------------- 1 | # ActionNotificationExportResult 2 | 3 | ## Example ActionNotificationExportResult Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "created_at": 1, 9 | "status": 200, 10 | "message": "Success", 11 | "success": true, 12 | "request_headers": "{\"User-Agent\":\"Files.com Webhook\"}", 13 | "request_method": "GET", 14 | "request_url": "www.example.com/webhook_receiver", 15 | "path": "MyFolder/MyFile.txt", 16 | "folder": "MyFolder" 17 | } 18 | ``` 19 | 20 | * `id` (int64): Notification ID 21 | * `created_at` (int64): When the notification was sent. 22 | * `status` (int64): HTTP status code returned in the webhook response. 23 | * `message` (string): A message indicating the overall status of the webhook notification. 24 | * `success` (boolean): `true` if the webhook succeeded by receiving a 200 or 204 response. 25 | * `request_headers` (string): A JSON-encoded string with headers that were sent with the webhook. 26 | * `request_method` (string): The HTTP verb used to perform the webhook. 27 | * `request_url` (string): The webhook request URL. 28 | * `path` (string): The path to the actual file that triggered this notification. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 29 | * `folder` (string): The folder associated with the triggering action for this notification. 30 | 31 | --- 32 | 33 | ## List Action Notification Export Results 34 | 35 | ``` 36 | await ActionNotificationExportResult.list({ 37 | 'user_id': 1, 38 | 'action_notification_export_id': 1, 39 | }) 40 | ``` 41 | 42 | 43 | ### Parameters 44 | 45 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 46 | * `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. 47 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 48 | * `action_notification_export_id` (int64): Required - ID of the associated action notification export. 49 | -------------------------------------------------------------------------------- /docs/models/App.md: -------------------------------------------------------------------------------- 1 | # App 2 | 3 | ## Example App Object 4 | 5 | ``` 6 | { 7 | "app_type": "example", 8 | "documentation_links": { 9 | "Important Info": "http://files.test/learn-more" 10 | }, 11 | "extended_description": "example", 12 | "extended_description_for_marketing_site": "example", 13 | "external_homepage_url": "example", 14 | "featured": true, 15 | "folder_behavior_type": "example", 16 | "icon_url": "example", 17 | "logo_thumbnail_url": "example", 18 | "logo_url": "example", 19 | "marketing_intro": "example", 20 | "marketing_youtube_url": "example", 21 | "name": "example", 22 | "package_manager_install_command": "example", 23 | "remote_server_type": "example", 24 | "screenshot_list_urls": [ 25 | "example" 26 | ], 27 | "sdk_installation_instructions_link": "example", 28 | "short_description": "example", 29 | "sso_strategy_type": "example", 30 | "siem_type": "example", 31 | "tutorial_youtube_url": "example" 32 | } 33 | ``` 34 | 35 | * `app_type` (string): The type of the App 36 | * `documentation_links` (object): Collection of named links to documentation 37 | * `extended_description` (string): Long description for the in-App landing page 38 | * `extended_description_for_marketing_site` (string): Long form description of the App 39 | * `external_homepage_url` (string): Link to external homepage 40 | * `featured` (boolean): Is featured on the App listing? 41 | * `folder_behavior_type` (string): Associated Folder Behavior type, if any 42 | * `icon_url` (string): App icon 43 | * `logo_thumbnail_url` (string): Logo thumbnail for the App 44 | * `logo_url` (string): Full size logo for the App 45 | * `marketing_intro` (string): Marketing introdution of the App 46 | * `marketing_youtube_url` (string): Marketing video page 47 | * `name` (string): Name of the App 48 | * `package_manager_install_command` (string): Package manager install command 49 | * `remote_server_type` (string): Associated Remote Server type, if any 50 | * `screenshot_list_urls` (array(string)): Screenshots of the App 51 | * `sdk_installation_instructions_link` (string): Link to SDK installation instructions 52 | * `short_description` (string): Short description of the App 53 | * `sso_strategy_type` (string): Associated SSO Strategy type, if any 54 | * `siem_type` (string): Associated SIEM type, if any 55 | * `tutorial_youtube_url` (string): Tutorial video page 56 | 57 | --- 58 | 59 | ## List Apps 60 | 61 | ``` 62 | await App.list 63 | ``` 64 | 65 | 66 | ### Parameters 67 | 68 | * `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. 69 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 70 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `name` and `app_type`. 71 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `name` and `app_type`. Valid field combinations are `[ name, app_type ]`. 72 | * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `name`. 73 | -------------------------------------------------------------------------------- /docs/models/Auto.md: -------------------------------------------------------------------------------- 1 | # Auto 2 | 3 | ## Example Auto Object 4 | 5 | ``` 6 | { 7 | "dynamic": null 8 | } 9 | ``` 10 | 11 | * `dynamic` (object): 12 | -------------------------------------------------------------------------------- /docs/models/AutomationRun.md: -------------------------------------------------------------------------------- 1 | # AutomationRun 2 | 3 | ## Example AutomationRun Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "automation_id": 1, 9 | "completed_at": "2000-01-01T01:00:00Z", 10 | "created_at": "2000-01-01T01:00:00Z", 11 | "retry_at": "2000-01-01T01:00:00Z", 12 | "retried_at": "2000-01-01T01:00:00Z", 13 | "retried_in_run_id": 1, 14 | "retry_of_run_id": 1, 15 | "runtime": 1.0, 16 | "status": "success", 17 | "successful_operations": 1, 18 | "failed_operations": 1, 19 | "status_messages_url": "https://www.example.com/log_file.txt" 20 | } 21 | ``` 22 | 23 | * `id` (int64): ID. 24 | * `automation_id` (int64): ID of the associated Automation. 25 | * `completed_at` (date-time): Automation run completion/failure date/time. 26 | * `created_at` (date-time): Automation run start date/time. 27 | * `retry_at` (date-time): If set, this automation will be retried at this date/time due to `failure` or `partial_failure`. 28 | * `retried_at` (date-time): If set, this Automation run was retried due to `failure` or `partial_failure`. 29 | * `retried_in_run_id` (int64): ID of the run that is or will be retrying this run. 30 | * `retry_of_run_id` (int64): ID of the original run that this run is retrying. 31 | * `runtime` (double): Automation run runtime. 32 | * `status` (string): The success status of the AutomationRun. One of `running`, `success`, `partial_failure`, or `failure`. 33 | * `successful_operations` (int64): Count of successful operations. 34 | * `failed_operations` (int64): Count of failed operations. 35 | * `status_messages_url` (string): Link to status messages log file. 36 | 37 | --- 38 | 39 | ## List Automation Runs 40 | 41 | ``` 42 | await AutomationRun.list({ 43 | 'user_id': 1, 44 | 'automation_id': 1, 45 | }) 46 | ``` 47 | 48 | 49 | ### Parameters 50 | 51 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 52 | * `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. 53 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 54 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `automation_id`, `created_at` or `status`. 55 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `status` and `automation_id`. Valid field combinations are `[ automation_id, status ]`. 56 | * `automation_id` (int64): Required - ID of the associated Automation. 57 | 58 | --- 59 | 60 | ## Show Automation Run 61 | 62 | ``` 63 | await AutomationRun.find(id) 64 | ``` 65 | 66 | 67 | ### Parameters 68 | 69 | * `id` (int64): Required - Automation Run ID. 70 | -------------------------------------------------------------------------------- /docs/models/BandwidthSnapshot.md: -------------------------------------------------------------------------------- 1 | # BandwidthSnapshot 2 | 3 | ## Example BandwidthSnapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "bytes_received": 1.0, 9 | "bytes_sent": 1.0, 10 | "sync_bytes_received": 1.0, 11 | "sync_bytes_sent": 1.0, 12 | "requests_get": 1.0, 13 | "requests_put": 1.0, 14 | "requests_other": 1.0, 15 | "logged_at": "2000-01-01T01:00:00Z" 16 | } 17 | ``` 18 | 19 | * `id` (int64): Site bandwidth ID 20 | * `bytes_received` (double): Site bandwidth report bytes received 21 | * `bytes_sent` (double): Site bandwidth report bytes sent 22 | * `sync_bytes_received` (double): Site sync bandwidth report bytes received 23 | * `sync_bytes_sent` (double): Site sync bandwidth report bytes sent 24 | * `requests_get` (double): Site bandwidth report get requests 25 | * `requests_put` (double): Site bandwidth report put requests 26 | * `requests_other` (double): Site bandwidth report other requests 27 | * `logged_at` (date-time): Time the site bandwidth report was logged 28 | 29 | --- 30 | 31 | ## List Bandwidth Snapshots 32 | 33 | ``` 34 | await BandwidthSnapshot.list 35 | ``` 36 | 37 | 38 | ### Parameters 39 | 40 | * `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. 41 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 42 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `logged_at`. 43 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `logged_at`. 44 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `logged_at`. 45 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `logged_at`. 46 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `logged_at`. 47 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `logged_at`. 48 | -------------------------------------------------------------------------------- /docs/models/BundleAction.md: -------------------------------------------------------------------------------- 1 | # BundleAction 2 | 3 | ## Example BundleAction Object 4 | 5 | ``` 6 | { 7 | "action": "create", 8 | "bundle_registration": { 9 | "code": "abc123", 10 | "name": "account", 11 | "company": "Action Verb", 12 | "email": "john.doe@files.com", 13 | "ip": "10.1.1.1", 14 | "inbox_code": "abc123", 15 | "clickwrap_body": "example", 16 | "form_field_set_id": 1, 17 | "form_field_data": { 18 | "key": "example value" 19 | }, 20 | "bundle_code": "example", 21 | "bundle_id": 1, 22 | "bundle_recipient_id": 1, 23 | "created_at": "2000-01-01T01:00:00Z" 24 | }, 25 | "created_at": "2000-01-01T01:00:00Z", 26 | "destination": "/to_path", 27 | "path": "", 28 | "source": "/from_path" 29 | } 30 | ``` 31 | 32 | * `action` (string): Type of action 33 | * `bundle_registration` (BundleRegistration): Object that contains bundle registration information 34 | * `created_at` (date-time): Action occurrence date/time 35 | * `destination` (string): The destination path for this bundle action, if applicable 36 | * `path` (string): Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 37 | * `source` (string): The source path for this bundle action, if applicable 38 | 39 | --- 40 | 41 | ## List Bundle Actions 42 | 43 | ``` 44 | await BundleAction.list({ 45 | 'user_id': 1, 46 | }) 47 | ``` 48 | 49 | 50 | ### Parameters 51 | 52 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 53 | * `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. 54 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 55 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`. 56 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `bundle_id` or `bundle_registration_id`. Valid field combinations are `[ bundle_id, created_at ]`, `[ bundle_registration_id, created_at ]`, `[ bundle_id, bundle_registration_id ]` or `[ bundle_id, bundle_registration_id, created_at ]`. 57 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 58 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 59 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 60 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 61 | -------------------------------------------------------------------------------- /docs/models/BundleDownload.md: -------------------------------------------------------------------------------- 1 | # BundleDownload 2 | 3 | ## Example BundleDownload Object 4 | 5 | ``` 6 | { 7 | "bundle_registration": { 8 | "code": "abc123", 9 | "name": "account", 10 | "company": "Action Verb", 11 | "email": "john.doe@files.com", 12 | "ip": "10.1.1.1", 13 | "inbox_code": "abc123", 14 | "clickwrap_body": "example", 15 | "form_field_set_id": 1, 16 | "form_field_data": { 17 | "key": "example value" 18 | }, 19 | "bundle_code": "example", 20 | "bundle_id": 1, 21 | "bundle_recipient_id": 1, 22 | "created_at": "2000-01-01T01:00:00Z" 23 | }, 24 | "download_method": "file", 25 | "path": "a/b/test.txt", 26 | "created_at": "2000-01-01T01:00:00Z" 27 | } 28 | ``` 29 | 30 | * `bundle_registration` (BundleRegistration): 31 | * `download_method` (string): Download method (file or full_zip) 32 | * `path` (string): Download path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 33 | * `created_at` (date-time): Download date/time 34 | 35 | --- 36 | 37 | ## List Bundle Downloads 38 | 39 | ``` 40 | await BundleDownload.list({ 41 | 'bundle_id': 1, 42 | 'bundle_registration_id': 1, 43 | }) 44 | ``` 45 | 46 | 47 | ### Parameters 48 | 49 | * `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. 50 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 51 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`. 52 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`. 53 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 54 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 55 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 56 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 57 | * `bundle_id` (int64): Bundle ID 58 | * `bundle_registration_id` (int64): BundleRegistration ID 59 | -------------------------------------------------------------------------------- /docs/models/BundlePath.md: -------------------------------------------------------------------------------- 1 | # BundlePath 2 | 3 | ## Example BundlePath Object 4 | 5 | ``` 6 | { 7 | "recursive": true, 8 | "path": "example" 9 | } 10 | ``` 11 | 12 | * `recursive` (boolean): Allow access to subfolders content? 13 | * `path` (string): The path to the resource relative to filesystem. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 14 | -------------------------------------------------------------------------------- /docs/models/BundleRecipient.md: -------------------------------------------------------------------------------- 1 | # BundleRecipient 2 | 3 | ## Example BundleRecipient Object 4 | 5 | ``` 6 | { 7 | "company": "Acme Inc.", 8 | "name": "John Doe", 9 | "note": "Some note.", 10 | "recipient": "john.doe@example.com", 11 | "sent_at": "2000-01-01T01:00:00Z" 12 | } 13 | ``` 14 | 15 | * `company` (string): The recipient's company. 16 | * `name` (string): The recipient's name. 17 | * `note` (string): A note sent to the recipient with the bundle. 18 | * `recipient` (string): The recipient's email address. 19 | * `sent_at` (date-time): When the Bundle was shared with this recipient. 20 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 21 | * `bundle_id` (int64): Bundle to share. 22 | * `share_after_create` (boolean): Set to true to share the link with the recipient upon creation. 23 | 24 | --- 25 | 26 | ## List Bundle Recipients 27 | 28 | ``` 29 | await BundleRecipient.list({ 30 | 'user_id': 1, 31 | 'bundle_id': 1, 32 | }) 33 | ``` 34 | 35 | 36 | ### Parameters 37 | 38 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 39 | * `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. 40 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 41 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 42 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `has_registrations`. 43 | * `bundle_id` (int64): Required - List recipients for the bundle with this ID. 44 | 45 | --- 46 | 47 | ## Create Bundle Recipient 48 | 49 | ``` 50 | await BundleRecipient.create({ 51 | 'user_id': 1, 52 | 'bundle_id': 1, 53 | 'recipient': "johndoe@gmail.com", 54 | 'name': "John Smith", 55 | 'company': "Acme Ltd", 56 | 'note': "Just a note.", 57 | 'share_after_create': false, 58 | }) 59 | ``` 60 | 61 | 62 | ### Parameters 63 | 64 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 65 | * `bundle_id` (int64): Required - Bundle to share. 66 | * `recipient` (string): Required - Email addresses to share this bundle with. 67 | * `name` (string): Name of recipient. 68 | * `company` (string): Company of recipient. 69 | * `note` (string): Note to include in email. 70 | * `share_after_create` (boolean): Set to true to share the link with the recipient upon creation. 71 | -------------------------------------------------------------------------------- /docs/models/BundleRegistration.md: -------------------------------------------------------------------------------- 1 | # BundleRegistration 2 | 3 | ## Example BundleRegistration Object 4 | 5 | ``` 6 | { 7 | "code": "abc123", 8 | "name": "account", 9 | "company": "Action Verb", 10 | "email": "john.doe@files.com", 11 | "ip": "10.1.1.1", 12 | "inbox_code": "abc123", 13 | "clickwrap_body": "example", 14 | "form_field_set_id": 1, 15 | "form_field_data": { 16 | "key": "example value" 17 | }, 18 | "bundle_code": "example", 19 | "bundle_id": 1, 20 | "bundle_recipient_id": 1, 21 | "created_at": "2000-01-01T01:00:00Z" 22 | } 23 | ``` 24 | 25 | * `code` (string): Registration cookie code 26 | * `name` (string): Registrant name 27 | * `company` (string): Registrant company name 28 | * `email` (string): Registrant email address 29 | * `ip` (string): Registrant IP Address 30 | * `inbox_code` (string): InboxRegistration cookie code, if there is an associated InboxRegistration 31 | * `clickwrap_body` (string): Clickwrap text that was shown to the registrant 32 | * `form_field_set_id` (int64): Id of associated form field set 33 | * `form_field_data` (object): Data for form field set with form field ids as keys and user data as values 34 | * `bundle_code` (string): Bundle URL code 35 | * `bundle_id` (int64): Id of associated bundle 36 | * `bundle_recipient_id` (int64): Id of associated bundle recipient 37 | * `created_at` (date-time): Registration creation date/time 38 | 39 | --- 40 | 41 | ## List Bundle Registrations 42 | 43 | ``` 44 | await BundleRegistration.list({ 45 | 'user_id': 1, 46 | 'bundle_id': 1, 47 | }) 48 | ``` 49 | 50 | 51 | ### Parameters 52 | 53 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 54 | * `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. 55 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 56 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id`. 57 | * `bundle_id` (int64): ID of the associated Bundle 58 | -------------------------------------------------------------------------------- /docs/models/DnsRecord.md: -------------------------------------------------------------------------------- 1 | # DnsRecord 2 | 3 | ## Example DnsRecord Object 4 | 5 | ``` 6 | { 7 | "id": "customdomain.com-CNAME-site.files.com", 8 | "domain": "my-custom-domain.com", 9 | "rrtype": "CNAME", 10 | "value": "mysite.files.com" 11 | } 12 | ``` 13 | 14 | * `id` (string): Unique label for DNS record; used by Zapier and other integrations. 15 | * `domain` (string): DNS record domain name 16 | * `rrtype` (string): DNS record type 17 | * `value` (string): DNS record value 18 | 19 | --- 20 | 21 | ## Show Site DNS Configuration 22 | 23 | ``` 24 | await DnsRecord.list 25 | ``` 26 | 27 | 28 | ### Parameters 29 | 30 | * `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. 31 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 32 | -------------------------------------------------------------------------------- /docs/models/EmailIncomingMessage.md: -------------------------------------------------------------------------------- 1 | # EmailIncomingMessage 2 | 3 | ## Example EmailIncomingMessage Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "inbox_id": 1, 9 | "sender": "example", 10 | "sender_name": "example", 11 | "status": "success", 12 | "body": "example", 13 | "message": "example", 14 | "created_at": "2000-01-01T01:00:00Z", 15 | "inbox_title": "Inbox Title" 16 | } 17 | ``` 18 | 19 | * `id` (int64): Id of the Email Incoming Message 20 | * `inbox_id` (int64): Id of the Inbox associated with this message 21 | * `sender` (string): Sender of the email 22 | * `sender_name` (string): Sender name 23 | * `status` (string): Status of the message 24 | * `body` (string): Body of the email 25 | * `message` (string): Message describing the failure 26 | * `created_at` (date-time): Message creation date/time 27 | * `inbox_title` (string): Title of the Inbox associated with this message 28 | 29 | --- 30 | 31 | ## List Email Incoming Messages 32 | 33 | ``` 34 | await EmailIncomingMessage.list 35 | ``` 36 | 37 | 38 | ### Parameters 39 | 40 | * `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. 41 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 42 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `sender`, `status` or `inbox_id`. 43 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `inbox_id`, `sender` or `status`. Valid field combinations are `[ inbox_id, created_at ]`, `[ sender, created_at ]`, `[ status, created_at ]`, `[ inbox_id, status ]`, `[ status, sender ]`, `[ inbox_id, status, created_at ]`, `[ status, sender, created_at ]`, `[ inbox_id, status, sender ]` or `[ inbox_id, status, sender, created_at ]`. 44 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 45 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 46 | * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `sender`. 47 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 48 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 49 | -------------------------------------------------------------------------------- /docs/models/EmailLog.md: -------------------------------------------------------------------------------- 1 | # EmailLog 2 | 3 | ## Example EmailLog Object 4 | 5 | ``` 6 | { 7 | "timestamp": "2000-01-01T01:00:00Z", 8 | "message": "example", 9 | "status": "example", 10 | "subject": "example", 11 | "to": "example", 12 | "cc": "example", 13 | "delivery_method": "example", 14 | "smtp_hostname": "example", 15 | "smtp_ip": "example" 16 | } 17 | ``` 18 | 19 | * `timestamp` (date-time): Start Time of Action 20 | * `message` (string): Log Message 21 | * `status` (string): Status of E-Mail delivery 22 | * `subject` (string): Subject line of E-Mail 23 | * `to` (string): To field of E-Mail 24 | * `cc` (string): CC field of E-Mail 25 | * `delivery_method` (string): How was the email delivered? `customer_smtp` or `files.com` 26 | * `smtp_hostname` (string): Customer SMTP Hostname used. 27 | * `smtp_ip` (string): Customer SMTP IP address as resolved for use (useful for troubleshooting DNS issues with customer SMTP). 28 | 29 | --- 30 | 31 | ## List Email Logs 32 | 33 | ``` 34 | await EmailLog.list 35 | ``` 36 | 37 | 38 | ### Parameters 39 | 40 | * `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. 41 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 42 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `start_date`, `end_date` or `status`. Valid field combinations are `[ start_date ]`, `[ end_date ]`, `[ status ]`, `[ start_date, end_date ]`, `[ start_date, status ]` or `[ end_date, status ]`. 43 | * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `status`. Valid field combinations are `[ start_date ]`, `[ end_date ]`, `[ status ]`, `[ start_date, end_date ]`, `[ start_date, status ]` or `[ end_date, status ]`. 44 | -------------------------------------------------------------------------------- /docs/models/Errors.md: -------------------------------------------------------------------------------- 1 | # Errors 2 | 3 | ## Example Errors Object 4 | 5 | ``` 6 | { 7 | "fields": [ 8 | 9 | ], 10 | "messages": [ 11 | 12 | ] 13 | } 14 | ``` 15 | 16 | * `fields` (array(string)): A list of fields where errors occur 17 | * `messages` (array(string)): A list of error messages 18 | -------------------------------------------------------------------------------- /docs/models/FileAction.md: -------------------------------------------------------------------------------- 1 | # FileAction 2 | 3 | ## Example FileAction Object 4 | 5 | ``` 6 | { 7 | "status": "pending", 8 | "file_migration_id": 1 9 | } 10 | ``` 11 | 12 | * `status` (string): Status of file operation. 13 | * `file_migration_id` (int64): If status is pending, this is the id of the File Migration to check for status updates. 14 | -------------------------------------------------------------------------------- /docs/models/FileComment.md: -------------------------------------------------------------------------------- 1 | # FileComment 2 | 3 | ## Example FileComment Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "body": "What a great file!", 9 | "reactions": [ 10 | { 11 | "id": 1, 12 | "emoji": "👍" 13 | } 14 | ] 15 | } 16 | ``` 17 | 18 | * `id` (int64): File Comment ID 19 | * `body` (string): Comment body. 20 | * `reactions` (array(object)): Reactions to this comment. 21 | * `path` (string): File path. 22 | 23 | --- 24 | 25 | ## List File Comments by Path 26 | 27 | ``` 28 | await FileComment.listFor(path) 29 | ``` 30 | 31 | 32 | ### Parameters 33 | 34 | * `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. 35 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 36 | * `path` (string): Required - Path to operate on. 37 | 38 | --- 39 | 40 | ## Create File Comment 41 | 42 | ``` 43 | await FileComment.create({ 44 | 'body': "body", 45 | 'path': "path", 46 | }) 47 | ``` 48 | 49 | 50 | ### Parameters 51 | 52 | * `body` (string): Required - Comment body. 53 | * `path` (string): Required - File path. 54 | 55 | --- 56 | 57 | ## Update File Comment 58 | 59 | ``` 60 | const [file_comment] = await FileComment.list() 61 | 62 | await file_comment.update({ 63 | 'body': "body", 64 | }) 65 | ``` 66 | 67 | ### Parameters 68 | 69 | * `id` (int64): Required - File Comment ID. 70 | * `body` (string): Required - Comment body. 71 | 72 | ### Example Response 73 | 74 | ```json 75 | { 76 | "id": 1, 77 | "body": "What a great file!", 78 | "reactions": [ 79 | { 80 | "id": 1, 81 | "emoji": "👍" 82 | } 83 | ] 84 | } 85 | ``` 86 | 87 | --- 88 | 89 | ## Delete File Comment 90 | 91 | ``` 92 | const [file_comment] = await FileComment.list() 93 | 94 | await file_comment.delete() 95 | ``` 96 | 97 | ### Parameters 98 | 99 | * `id` (int64): Required - File Comment ID. 100 | 101 | -------------------------------------------------------------------------------- /docs/models/FileCommentReaction.md: -------------------------------------------------------------------------------- 1 | # FileCommentReaction 2 | 3 | ## Example FileCommentReaction Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "emoji": "👍" 9 | } 10 | ``` 11 | 12 | * `id` (int64): Reaction ID 13 | * `emoji` (string): Emoji used in the reaction. 14 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 15 | * `file_comment_id` (int64): ID of file comment to attach reaction to. 16 | 17 | --- 18 | 19 | ## Create File Comment Reaction 20 | 21 | ``` 22 | await FileCommentReaction.create({ 23 | 'user_id': 1, 24 | 'file_comment_id': 1, 25 | 'emoji': "emoji", 26 | }) 27 | ``` 28 | 29 | 30 | ### Parameters 31 | 32 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 33 | * `file_comment_id` (int64): Required - ID of file comment to attach reaction to. 34 | * `emoji` (string): Required - Emoji to react with. 35 | 36 | --- 37 | 38 | ## Delete File Comment Reaction 39 | 40 | ``` 41 | const file_comment_reaction = new FileCommentReaction() 42 | file_comment_reaction.path = myFilePath 43 | 44 | await file_comment_reaction.delete() 45 | ``` 46 | 47 | ### Parameters 48 | 49 | * `id` (int64): Required - File Comment Reaction ID. 50 | 51 | -------------------------------------------------------------------------------- /docs/models/FileMigration.md: -------------------------------------------------------------------------------- 1 | # FileMigration 2 | 3 | ## Example FileMigration Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "path": "MyFolder", 9 | "dest_path": "MyFolder", 10 | "files_moved": 1, 11 | "files_total": 1, 12 | "operation": "move", 13 | "region": "USA", 14 | "status": "complete", 15 | "log_url": "https://www.example.com/log_file" 16 | } 17 | ``` 18 | 19 | * `id` (int64): File migration ID 20 | * `path` (string): Source path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 21 | * `dest_path` (string): Destination path 22 | * `files_moved` (int64): Number of files processed 23 | * `files_total` (int64): 24 | * `operation` (string): The type of operation 25 | * `region` (string): Region 26 | * `status` (string): Status 27 | * `log_url` (string): Link to download the log file for this migration. 28 | 29 | --- 30 | 31 | ## Show File Migration 32 | 33 | ``` 34 | await FileMigration.find(id) 35 | ``` 36 | 37 | 38 | ### Parameters 39 | 40 | * `id` (int64): Required - File Migration ID. 41 | -------------------------------------------------------------------------------- /docs/models/FileUploadPart.md: -------------------------------------------------------------------------------- 1 | # FileUploadPart 2 | 3 | ## Example FileUploadPart Object 4 | 5 | ``` 6 | { 7 | "send": { 8 | "key": "example value" 9 | }, 10 | "action": "multipart", 11 | "ask_about_overwrites": true, 12 | "available_parts": 1, 13 | "expires": "example", 14 | "headers": { 15 | "key": "example value" 16 | }, 17 | "http_method": "PUT", 18 | "next_partsize": 1, 19 | "parallel_parts": true, 20 | "retry_parts": true, 21 | "parameters": { 22 | "key": "example value" 23 | }, 24 | "part_number": 1, 25 | "partsize": 1, 26 | "path": "", 27 | "ref": "upload-1", 28 | "upload_uri": "example" 29 | } 30 | ``` 31 | 32 | * `send` (object): Content-Type and File to send 33 | * `action` (string): Type of upload 34 | * `ask_about_overwrites` (boolean): If `true`, this file exists and you may wish to ask the user for overwrite confirmation 35 | * `available_parts` (int64): Number of parts in the upload 36 | * `expires` (string): Date/time of when this Upload part expires and the URL cannot be used any more 37 | * `headers` (object): Additional upload headers to provide as part of the upload 38 | * `http_method` (string): HTTP Method to use for uploading the part, usually `PUT` 39 | * `next_partsize` (int64): Size in bytes for this part 40 | * `parallel_parts` (boolean): If `true`, multiple parts may be uploaded in parallel. If `false`, be sure to only upload one part at a time, in order. 41 | * `retry_parts` (boolean): If `true`, parts may be retried. If `false`, a part cannot be retried and the upload should be restarted. 42 | * `parameters` (object): Additional HTTP parameters to send with the upload 43 | * `part_number` (int64): Number of this upload part 44 | * `partsize` (int64): Size in bytes for the next upload part 45 | * `path` (string): New file path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 46 | * `ref` (string): Reference name for this upload part 47 | * `upload_uri` (string): URI to upload this part to 48 | -------------------------------------------------------------------------------- /docs/models/FormField.md: -------------------------------------------------------------------------------- 1 | # FormField 2 | 3 | ## Example FormField Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "label": "Sample Label", 9 | "required": true, 10 | "help_text": "Help Text", 11 | "field_type": "text", 12 | "options_for_select": [ 13 | "red", 14 | "green", 15 | "blue" 16 | ], 17 | "default_option": "red", 18 | "form_field_set_id": 1 19 | } 20 | ``` 21 | 22 | * `id` (int64): Form field id 23 | * `label` (string): Label to be displayed 24 | * `required` (boolean): Is this a required field? 25 | * `help_text` (string): Help text to be displayed 26 | * `field_type` (string): Type of Field 27 | * `options_for_select` (array(string)): Options to display for radio and dropdown 28 | * `default_option` (string): Default option for radio and dropdown 29 | * `form_field_set_id` (int64): Form field set id 30 | -------------------------------------------------------------------------------- /docs/models/GroupUser.md: -------------------------------------------------------------------------------- 1 | # GroupUser 2 | 3 | ## Example GroupUser Object 4 | 5 | ``` 6 | { 7 | "group_name": "My Group", 8 | "group_id": 1, 9 | "user_id": 1, 10 | "admin": true, 11 | "usernames": "user" 12 | } 13 | ``` 14 | 15 | * `group_name` (string): Group name 16 | * `group_id` (int64): Group ID 17 | * `user_id` (int64): User ID 18 | * `admin` (boolean): Is this user an administrator of this group? 19 | * `usernames` (string): Comma-delimited list of usernames who belong to this group (separated by commas). 20 | * `id` (int64): Group User ID. 21 | 22 | --- 23 | 24 | ## List Group Users 25 | 26 | ``` 27 | await GroupUser.list({ 28 | 'user_id': 1, 29 | 'group_id': 1, 30 | }) 31 | ``` 32 | 33 | 34 | ### Parameters 35 | 36 | * `user_id` (int64): User ID. If provided, will return group_users of this user. 37 | * `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. 38 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 39 | * `group_id` (int64): Group ID. If provided, will return group_users of this group. 40 | 41 | --- 42 | 43 | ## Create Group User 44 | 45 | ``` 46 | await GroupUser.create({ 47 | 'group_id': 1, 48 | 'user_id': 1, 49 | 'admin': false, 50 | }) 51 | ``` 52 | 53 | 54 | ### Parameters 55 | 56 | * `group_id` (int64): Required - Group ID to add user to. 57 | * `user_id` (int64): Required - User ID to add to group. 58 | * `admin` (boolean): Is the user a group administrator? 59 | 60 | --- 61 | 62 | ## Update Group User 63 | 64 | ``` 65 | const [group_user] = await GroupUser.list() 66 | 67 | await group_user.update({ 68 | 'group_id': 1, 69 | 'user_id': 1, 70 | 'admin': false, 71 | }) 72 | ``` 73 | 74 | ### Parameters 75 | 76 | * `id` (int64): Required - Group User ID. 77 | * `group_id` (int64): Required - Group ID to add user to. 78 | * `user_id` (int64): Required - User ID to add to group. 79 | * `admin` (boolean): Is the user a group administrator? 80 | 81 | ### Example Response 82 | 83 | ```json 84 | { 85 | "group_name": "My Group", 86 | "group_id": 1, 87 | "user_id": 1, 88 | "admin": true, 89 | "usernames": "user" 90 | } 91 | ``` 92 | 93 | --- 94 | 95 | ## Delete Group User 96 | 97 | ``` 98 | const [group_user] = await GroupUser.list() 99 | 100 | await group_user.delete({ 101 | 'group_id': 1, 102 | 'user_id': 1, 103 | }) 104 | ``` 105 | 106 | ### Parameters 107 | 108 | * `id` (int64): Required - Group User ID. 109 | * `group_id` (int64): Required - Group ID from which to remove user. 110 | * `user_id` (int64): Required - User ID to remove from group. 111 | 112 | -------------------------------------------------------------------------------- /docs/models/Image.md: -------------------------------------------------------------------------------- 1 | # Image 2 | 3 | ## Example Image Object 4 | 5 | ``` 6 | { 7 | "name": "My logo", 8 | "uri": "https://mysite.files.com/.../my_image.png" 9 | } 10 | ``` 11 | 12 | * `name` (string): Image name 13 | * `uri` (string): Image URI 14 | -------------------------------------------------------------------------------- /docs/models/InboxRecipient.md: -------------------------------------------------------------------------------- 1 | # InboxRecipient 2 | 3 | ## Example InboxRecipient Object 4 | 5 | ``` 6 | { 7 | "company": "Acme Inc.", 8 | "name": "John Doe", 9 | "note": "Some note.", 10 | "recipient": "john.doe@example.com", 11 | "sent_at": "2000-01-01T01:00:00Z" 12 | } 13 | ``` 14 | 15 | * `company` (string): The recipient's company. 16 | * `name` (string): The recipient's name. 17 | * `note` (string): A note sent to the recipient with the inbox. 18 | * `recipient` (string): The recipient's email address. 19 | * `sent_at` (date-time): When the Inbox was shared with this recipient. 20 | * `inbox_id` (int64): Inbox to share. 21 | * `share_after_create` (boolean): Set to true to share the link with the recipient upon creation. 22 | 23 | --- 24 | 25 | ## List Inbox Recipients 26 | 27 | ``` 28 | await InboxRecipient.list({ 29 | 'inbox_id': 1, 30 | }) 31 | ``` 32 | 33 | 34 | ### Parameters 35 | 36 | * `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. 37 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 38 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 39 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `has_registrations`. 40 | * `inbox_id` (int64): Required - List recipients for the inbox with this ID. 41 | 42 | --- 43 | 44 | ## Create Inbox Recipient 45 | 46 | ``` 47 | await InboxRecipient.create({ 48 | 'inbox_id': 1, 49 | 'recipient': "johndoe@gmail.com", 50 | 'name': "John Smith", 51 | 'company': "Acme Ltd", 52 | 'note': "Just a note.", 53 | 'share_after_create': false, 54 | }) 55 | ``` 56 | 57 | 58 | ### Parameters 59 | 60 | * `inbox_id` (int64): Required - Inbox to share. 61 | * `recipient` (string): Required - Email address to share this inbox with. 62 | * `name` (string): Name of recipient. 63 | * `company` (string): Company of recipient. 64 | * `note` (string): Note to include in email. 65 | * `share_after_create` (boolean): Set to true to share the link with the recipient upon creation. 66 | -------------------------------------------------------------------------------- /docs/models/InboxRegistration.md: -------------------------------------------------------------------------------- 1 | # InboxRegistration 2 | 3 | ## Example InboxRegistration Object 4 | 5 | ``` 6 | { 7 | "code": "abc123", 8 | "name": "account", 9 | "company": "Action Verb", 10 | "email": "john.doe@files.com", 11 | "ip": "10.1.1.1", 12 | "clickwrap_body": "example", 13 | "form_field_set_id": 1, 14 | "form_field_data": { 15 | "key": "example value" 16 | }, 17 | "inbox_id": 1, 18 | "inbox_recipient_id": 1, 19 | "inbox_title": "example", 20 | "created_at": "2000-01-01T01:00:00Z" 21 | } 22 | ``` 23 | 24 | * `code` (string): Registration cookie code 25 | * `name` (string): Registrant name 26 | * `company` (string): Registrant company name 27 | * `email` (string): Registrant email address 28 | * `ip` (string): Registrant IP Address 29 | * `clickwrap_body` (string): Clickwrap text that was shown to the registrant 30 | * `form_field_set_id` (int64): Id of associated form field set 31 | * `form_field_data` (object): Data for form field set with form field ids as keys and user data as values 32 | * `inbox_id` (int64): Id of associated inbox 33 | * `inbox_recipient_id` (int64): Id of associated inbox recipient 34 | * `inbox_title` (string): Title of associated inbox 35 | * `created_at` (date-time): Registration creation date/time 36 | 37 | --- 38 | 39 | ## List Inbox Registrations 40 | 41 | ``` 42 | await InboxRegistration.list({ 43 | 'folder_behavior_id': 1, 44 | }) 45 | ``` 46 | 47 | 48 | ### Parameters 49 | 50 | * `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. 51 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 52 | * `folder_behavior_id` (int64): ID of the associated Inbox. 53 | -------------------------------------------------------------------------------- /docs/models/InboxUpload.md: -------------------------------------------------------------------------------- 1 | # InboxUpload 2 | 3 | ## Example InboxUpload Object 4 | 5 | ``` 6 | { 7 | "inbox_registration": { 8 | "code": "abc123", 9 | "name": "account", 10 | "company": "Action Verb", 11 | "email": "john.doe@files.com", 12 | "ip": "10.1.1.1", 13 | "clickwrap_body": "example", 14 | "form_field_set_id": 1, 15 | "form_field_data": { 16 | "key": "example value" 17 | }, 18 | "inbox_id": 1, 19 | "inbox_recipient_id": 1, 20 | "inbox_title": "example", 21 | "created_at": "2000-01-01T01:00:00Z" 22 | }, 23 | "path": "a/b/test.txt", 24 | "created_at": "2000-01-01T01:00:00Z" 25 | } 26 | ``` 27 | 28 | * `inbox_registration` (InboxRegistration): 29 | * `path` (string): Upload path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 30 | * `created_at` (date-time): Upload date/time 31 | 32 | --- 33 | 34 | ## List Inbox Uploads 35 | 36 | ``` 37 | await InboxUpload.list 38 | ``` 39 | 40 | 41 | ### Parameters 42 | 43 | * `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. 44 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 45 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`. 46 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `folder_behavior_id` or `inbox_registration_id`. Valid field combinations are `[ folder_behavior_id, created_at ]`, `[ inbox_registration_id, created_at ]`, `[ folder_behavior_id, inbox_registration_id ]` or `[ folder_behavior_id, inbox_registration_id, created_at ]`. 47 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 48 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 49 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 50 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 51 | -------------------------------------------------------------------------------- /docs/models/Invoice.md: -------------------------------------------------------------------------------- 1 | # Invoice 2 | 3 | ## Example Invoice Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "amount": 1.0, 9 | "balance": 1.0, 10 | "created_at": "2000-01-01T01:00:00Z", 11 | "currency": "USD", 12 | "download_uri": "https://url...", 13 | "invoice_line_items": [ 14 | { 15 | "amount": 1.0, 16 | "created_at": "2000-01-01T01:00:00Z", 17 | "description": "Service from 2019-01-01 through 2019-12-31", 18 | "type": "invoice", 19 | "service_end_at": "2000-01-01T01:00:00Z", 20 | "service_start_at": "2000-01-01T01:00:00Z", 21 | "plan": "Premier", 22 | "site": "My site" 23 | } 24 | ], 25 | "method": "paypal", 26 | "payment_line_items": [ 27 | { 28 | "amount": 1.0, 29 | "created_at": "2000-01-01T01:00:00Z", 30 | "invoice_id": 1, 31 | "payment_id": 1 32 | } 33 | ], 34 | "payment_reversed_at": "2000-01-01T01:00:00Z", 35 | "payment_type": "example", 36 | "site_name": "My Site", 37 | "type": "invoice" 38 | } 39 | ``` 40 | 41 | * `id` (int64): Line item Id 42 | * `amount` (double): Line item amount 43 | * `balance` (double): Line item balance 44 | * `created_at` (date-time): Line item created at 45 | * `currency` (string): Line item currency 46 | * `download_uri` (string): Line item download uri 47 | * `invoice_line_items` (array(object)): Associated invoice line items 48 | * `method` (string): Line item payment method 49 | * `payment_line_items` (array(object)): Associated payment line items 50 | * `payment_reversed_at` (date-time): Date/time payment was reversed if applicable 51 | * `payment_type` (string): Type of payment if applicable 52 | * `site_name` (string): Site name this line item is for 53 | * `type` (string): Type of line item, either payment or invoice 54 | 55 | --- 56 | 57 | ## List Invoices 58 | 59 | ``` 60 | await Invoice.list 61 | ``` 62 | 63 | 64 | ### Parameters 65 | 66 | * `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. 67 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 68 | 69 | --- 70 | 71 | ## Show Invoice 72 | 73 | ``` 74 | await Invoice.find(id) 75 | ``` 76 | 77 | 78 | ### Parameters 79 | 80 | * `id` (int64): Required - Invoice ID. 81 | -------------------------------------------------------------------------------- /docs/models/InvoiceLineItem.md: -------------------------------------------------------------------------------- 1 | # InvoiceLineItem 2 | 3 | ## Example InvoiceLineItem Object 4 | 5 | ``` 6 | { 7 | "amount": 1.0, 8 | "created_at": "2000-01-01T01:00:00Z", 9 | "description": "Service from 2019-01-01 through 2019-12-31", 10 | "type": "invoice", 11 | "service_end_at": "2000-01-01T01:00:00Z", 12 | "service_start_at": "2000-01-01T01:00:00Z", 13 | "plan": "Premier", 14 | "site": "My site" 15 | } 16 | ``` 17 | 18 | * `amount` (double): Invoice line item amount 19 | * `created_at` (date-time): Invoice line item created at date/time 20 | * `description` (string): Invoice line item description 21 | * `type` (string): Invoice line item type 22 | * `service_end_at` (date-time): Invoice line item service end date/time 23 | * `service_start_at` (date-time): Invoice line item service start date/time 24 | * `plan` (string): Plan name 25 | * `site` (string): Site name 26 | -------------------------------------------------------------------------------- /docs/models/IpAddress.md: -------------------------------------------------------------------------------- 1 | # IpAddress 2 | 3 | ## Example IpAddress Object 4 | 5 | ``` 6 | { 7 | "id": "Site", 8 | "associated_with": "Site", 9 | "group_id": 1, 10 | "ip_addresses": [ 11 | "127.0.0.1" 12 | ] 13 | } 14 | ``` 15 | 16 | * `id` (string): Unique label for list; used by Zapier and other integrations. 17 | * `associated_with` (string): The object that this public IP address list is associated with. 18 | * `group_id` (int64): Group ID 19 | * `ip_addresses` (array(string)): A list of IP addresses. 20 | 21 | --- 22 | 23 | ## List IP Addresses associated with the current site 24 | 25 | ``` 26 | await IpAddress.list 27 | ``` 28 | 29 | 30 | ### Parameters 31 | 32 | * `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. 33 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 34 | 35 | --- 36 | 37 | ## List all possible public SmartFile IP addresses 38 | 39 | ``` 40 | await IpAddress.getSmartfileReserved 41 | ``` 42 | 43 | 44 | ### Parameters 45 | 46 | * `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. 47 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 48 | 49 | --- 50 | 51 | ## List all possible public ExaVault IP addresses 52 | 53 | ``` 54 | await IpAddress.getExavaultReserved 55 | ``` 56 | 57 | 58 | ### Parameters 59 | 60 | * `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. 61 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 62 | 63 | --- 64 | 65 | ## List all possible public IP addresses 66 | 67 | ``` 68 | await IpAddress.getReserved 69 | ``` 70 | 71 | 72 | ### Parameters 73 | 74 | * `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. 75 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 76 | -------------------------------------------------------------------------------- /docs/models/Lock.md: -------------------------------------------------------------------------------- 1 | # Lock 2 | 3 | ## Example Lock Object 4 | 5 | ``` 6 | { 7 | "path": "locked_file", 8 | "timeout": 1, 9 | "depth": "infinity", 10 | "recursive": true, 11 | "owner": "user", 12 | "scope": "shared", 13 | "exclusive": true, 14 | "token": "17c54824e9931a4688ca032d03f6663c", 15 | "type": "write", 16 | "allow_access_by_any_user": true, 17 | "user_id": 1, 18 | "username": "" 19 | } 20 | ``` 21 | 22 | * `path` (string): Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 23 | * `timeout` (int64): Lock timeout in seconds 24 | * `depth` (string): 25 | * `recursive` (boolean): Does lock apply to subfolders? 26 | * `owner` (string): Owner of the lock. This can be any arbitrary string. 27 | * `scope` (string): 28 | * `exclusive` (boolean): Is lock exclusive? 29 | * `token` (string): Lock token. Use to release lock. 30 | * `type` (string): 31 | * `allow_access_by_any_user` (boolean): Can lock be modified by users other than its creator? 32 | * `user_id` (int64): Lock creator user ID 33 | * `username` (string): Lock creator username 34 | 35 | --- 36 | 37 | ## List Locks by Path 38 | 39 | ``` 40 | await Lock.listFor(path, { 41 | 'include_children': false, 42 | }) 43 | ``` 44 | 45 | 46 | ### Parameters 47 | 48 | * `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. 49 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 50 | * `path` (string): Required - Path to operate on. 51 | * `include_children` (boolean): Include locks from children objects? 52 | 53 | --- 54 | 55 | ## Create Lock 56 | 57 | ``` 58 | await Lock.create(path, { 59 | 'allow_access_by_any_user': false, 60 | 'exclusive': false, 61 | 'recursive': true, 62 | 'timeout': 1, 63 | }) 64 | ``` 65 | 66 | 67 | ### Parameters 68 | 69 | * `path` (string): Required - Path 70 | * `allow_access_by_any_user` (boolean): Can lock be modified by users other than its creator? 71 | * `exclusive` (boolean): Is lock exclusive? 72 | * `recursive` (boolean): Does lock apply to subfolders? 73 | * `timeout` (int64): Lock timeout in seconds 74 | 75 | --- 76 | 77 | ## Delete Lock 78 | 79 | ``` 80 | const [lock] = await Lock.list() 81 | 82 | await lock.delete({ 83 | 'token': "token", 84 | }) 85 | ``` 86 | 87 | ### Parameters 88 | 89 | * `path` (string): Required - Path 90 | * `token` (string): Required - Lock token 91 | 92 | -------------------------------------------------------------------------------- /docs/models/Message.md: -------------------------------------------------------------------------------- 1 | # Message 2 | 3 | ## Example Message Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "subject": "Files.com Account Upgrade", 9 | "body": "We should upgrade our Files.com account!", 10 | "comments": [ 11 | { 12 | "id": 1, 13 | "body": "What a great idea, thank you!", 14 | "reactions": [ 15 | { 16 | "id": 1, 17 | "emoji": "👍" 18 | } 19 | ] 20 | } 21 | ] 22 | } 23 | ``` 24 | 25 | * `id` (int64): Message ID 26 | * `subject` (string): Message subject. 27 | * `body` (string): Message body. 28 | * `comments` (array(object)): Comments. 29 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 30 | * `project_id` (int64): Project to which the message should be attached. 31 | 32 | --- 33 | 34 | ## List Messages 35 | 36 | ``` 37 | await Message.list({ 38 | 'user_id': 1, 39 | 'project_id': 1, 40 | }) 41 | ``` 42 | 43 | 44 | ### Parameters 45 | 46 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 47 | * `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. 48 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 49 | * `project_id` (int64): Required - Project for which to return messages. 50 | 51 | --- 52 | 53 | ## Show Message 54 | 55 | ``` 56 | await Message.find(id) 57 | ``` 58 | 59 | 60 | ### Parameters 61 | 62 | * `id` (int64): Required - Message ID. 63 | 64 | --- 65 | 66 | ## Create Message 67 | 68 | ``` 69 | await Message.create({ 70 | 'user_id': 1, 71 | 'project_id': 1, 72 | 'subject': "Files.com Account Upgrade", 73 | 'body': "We should upgrade our Files.com account!", 74 | }) 75 | ``` 76 | 77 | 78 | ### Parameters 79 | 80 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 81 | * `project_id` (int64): Required - Project to which the message should be attached. 82 | * `subject` (string): Required - Message subject. 83 | * `body` (string): Required - Message body. 84 | 85 | --- 86 | 87 | ## Update Message 88 | 89 | ``` 90 | const message = await Message.find(id) 91 | 92 | await message.update({ 93 | 'project_id': 1, 94 | 'subject': "Files.com Account Upgrade", 95 | 'body': "We should upgrade our Files.com account!", 96 | }) 97 | ``` 98 | 99 | ### Parameters 100 | 101 | * `id` (int64): Required - Message ID. 102 | * `project_id` (int64): Required - Project to which the message should be attached. 103 | * `subject` (string): Required - Message subject. 104 | * `body` (string): Required - Message body. 105 | 106 | ### Example Response 107 | 108 | ```json 109 | { 110 | "id": 1, 111 | "subject": "Files.com Account Upgrade", 112 | "body": "We should upgrade our Files.com account!", 113 | "comments": [ 114 | { 115 | "id": 1, 116 | "body": "What a great idea, thank you!", 117 | "reactions": [ 118 | { 119 | "id": 1, 120 | "emoji": "👍" 121 | } 122 | ] 123 | } 124 | ] 125 | } 126 | ``` 127 | 128 | --- 129 | 130 | ## Delete Message 131 | 132 | ``` 133 | const message = await Message.find(id) 134 | 135 | await message.delete() 136 | ``` 137 | 138 | ### Parameters 139 | 140 | * `id` (int64): Required - Message ID. 141 | 142 | -------------------------------------------------------------------------------- /docs/models/MessageComment.md: -------------------------------------------------------------------------------- 1 | # MessageComment 2 | 3 | ## Example MessageComment Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "body": "What a great idea, thank you!", 9 | "reactions": [ 10 | { 11 | "id": 1, 12 | "emoji": "👍" 13 | } 14 | ] 15 | } 16 | ``` 17 | 18 | * `id` (int64): Message Comment ID 19 | * `body` (string): Comment body. 20 | * `reactions` (array(object)): Reactions to this comment. 21 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 22 | 23 | --- 24 | 25 | ## List Message Comments 26 | 27 | ``` 28 | await MessageComment.list({ 29 | 'user_id': 1, 30 | 'message_id': 1, 31 | }) 32 | ``` 33 | 34 | 35 | ### Parameters 36 | 37 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 38 | * `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. 39 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 40 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 41 | * `message_id` (int64): Required - Message comment to return comments for. 42 | 43 | --- 44 | 45 | ## Show Message Comment 46 | 47 | ``` 48 | await MessageComment.find(id) 49 | ``` 50 | 51 | 52 | ### Parameters 53 | 54 | * `id` (int64): Required - Message Comment ID. 55 | 56 | --- 57 | 58 | ## Create Message Comment 59 | 60 | ``` 61 | await MessageComment.create({ 62 | 'user_id': 1, 63 | 'body': "body", 64 | }) 65 | ``` 66 | 67 | 68 | ### Parameters 69 | 70 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 71 | * `body` (string): Required - Comment body. 72 | 73 | --- 74 | 75 | ## Update Message Comment 76 | 77 | ``` 78 | const message_comment = await MessageComment.find(id) 79 | 80 | await message_comment.update({ 81 | 'body': "body", 82 | }) 83 | ``` 84 | 85 | ### Parameters 86 | 87 | * `id` (int64): Required - Message Comment ID. 88 | * `body` (string): Required - Comment body. 89 | 90 | ### Example Response 91 | 92 | ```json 93 | { 94 | "id": 1, 95 | "body": "What a great idea, thank you!", 96 | "reactions": [ 97 | { 98 | "id": 1, 99 | "emoji": "👍" 100 | } 101 | ] 102 | } 103 | ``` 104 | 105 | --- 106 | 107 | ## Delete Message Comment 108 | 109 | ``` 110 | const message_comment = await MessageComment.find(id) 111 | 112 | await message_comment.delete() 113 | ``` 114 | 115 | ### Parameters 116 | 117 | * `id` (int64): Required - Message Comment ID. 118 | 119 | -------------------------------------------------------------------------------- /docs/models/MessageCommentReaction.md: -------------------------------------------------------------------------------- 1 | # MessageCommentReaction 2 | 3 | ## Example MessageCommentReaction Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "emoji": "👍" 9 | } 10 | ``` 11 | 12 | * `id` (int64): Reaction ID 13 | * `emoji` (string): Emoji used in the reaction. 14 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 15 | 16 | --- 17 | 18 | ## List Message Comment Reactions 19 | 20 | ``` 21 | await MessageCommentReaction.list({ 22 | 'user_id': 1, 23 | 'message_comment_id': 1, 24 | }) 25 | ``` 26 | 27 | 28 | ### Parameters 29 | 30 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 31 | * `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. 32 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 33 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 34 | * `message_comment_id` (int64): Required - Message comment to return reactions for. 35 | 36 | --- 37 | 38 | ## Show Message Comment Reaction 39 | 40 | ``` 41 | await MessageCommentReaction.find(id) 42 | ``` 43 | 44 | 45 | ### Parameters 46 | 47 | * `id` (int64): Required - Message Comment Reaction ID. 48 | 49 | --- 50 | 51 | ## Create Message Comment Reaction 52 | 53 | ``` 54 | await MessageCommentReaction.create({ 55 | 'user_id': 1, 56 | 'emoji': "emoji", 57 | }) 58 | ``` 59 | 60 | 61 | ### Parameters 62 | 63 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 64 | * `emoji` (string): Required - Emoji to react with. 65 | 66 | --- 67 | 68 | ## Delete Message Comment Reaction 69 | 70 | ``` 71 | const message_comment_reaction = await MessageCommentReaction.find(id) 72 | 73 | await message_comment_reaction.delete() 74 | ``` 75 | 76 | ### Parameters 77 | 78 | * `id` (int64): Required - Message Comment Reaction ID. 79 | 80 | -------------------------------------------------------------------------------- /docs/models/MessageReaction.md: -------------------------------------------------------------------------------- 1 | # MessageReaction 2 | 3 | ## Example MessageReaction Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "emoji": "👍" 9 | } 10 | ``` 11 | 12 | * `id` (int64): Reaction ID 13 | * `emoji` (string): Emoji used in the reaction. 14 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 15 | 16 | --- 17 | 18 | ## List Message Reactions 19 | 20 | ``` 21 | await MessageReaction.list({ 22 | 'user_id': 1, 23 | 'message_id': 1, 24 | }) 25 | ``` 26 | 27 | 28 | ### Parameters 29 | 30 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 31 | * `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. 32 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 33 | * `message_id` (int64): Required - Message to return reactions for. 34 | 35 | --- 36 | 37 | ## Show Message Reaction 38 | 39 | ``` 40 | await MessageReaction.find(id) 41 | ``` 42 | 43 | 44 | ### Parameters 45 | 46 | * `id` (int64): Required - Message Reaction ID. 47 | 48 | --- 49 | 50 | ## Create Message Reaction 51 | 52 | ``` 53 | await MessageReaction.create({ 54 | 'user_id': 1, 55 | 'emoji': "emoji", 56 | }) 57 | ``` 58 | 59 | 60 | ### Parameters 61 | 62 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 63 | * `emoji` (string): Required - Emoji to react with. 64 | 65 | --- 66 | 67 | ## Delete Message Reaction 68 | 69 | ``` 70 | const message_reaction = await MessageReaction.find(id) 71 | 72 | await message_reaction.delete() 73 | ``` 74 | 75 | ### Parameters 76 | 77 | * `id` (int64): Required - Message Reaction ID. 78 | 79 | -------------------------------------------------------------------------------- /docs/models/Payment.md: -------------------------------------------------------------------------------- 1 | # Payment 2 | 3 | ## Example Payment Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "amount": 1.0, 9 | "balance": 1.0, 10 | "created_at": "2000-01-01T01:00:00Z", 11 | "currency": "USD", 12 | "download_uri": "https://url...", 13 | "invoice_line_items": [ 14 | { 15 | "amount": 1.0, 16 | "created_at": "2000-01-01T01:00:00Z", 17 | "description": "Service from 2019-01-01 through 2019-12-31", 18 | "type": "invoice", 19 | "service_end_at": "2000-01-01T01:00:00Z", 20 | "service_start_at": "2000-01-01T01:00:00Z", 21 | "plan": "Premier", 22 | "site": "My site" 23 | } 24 | ], 25 | "method": "paypal", 26 | "payment_line_items": [ 27 | { 28 | "amount": 1.0, 29 | "created_at": "2000-01-01T01:00:00Z", 30 | "invoice_id": 1, 31 | "payment_id": 1 32 | } 33 | ], 34 | "payment_reversed_at": "2000-01-01T01:00:00Z", 35 | "payment_type": "example", 36 | "site_name": "My Site", 37 | "type": "invoice" 38 | } 39 | ``` 40 | 41 | * `id` (int64): Line item Id 42 | * `amount` (double): Line item amount 43 | * `balance` (double): Line item balance 44 | * `created_at` (date-time): Line item created at 45 | * `currency` (string): Line item currency 46 | * `download_uri` (string): Line item download uri 47 | * `invoice_line_items` (array(object)): Associated invoice line items 48 | * `method` (string): Line item payment method 49 | * `payment_line_items` (array(object)): Associated payment line items 50 | * `payment_reversed_at` (date-time): Date/time payment was reversed if applicable 51 | * `payment_type` (string): Type of payment if applicable 52 | * `site_name` (string): Site name this line item is for 53 | * `type` (string): Type of line item, either payment or invoice 54 | 55 | --- 56 | 57 | ## List Payments 58 | 59 | ``` 60 | await Payment.list 61 | ``` 62 | 63 | 64 | ### Parameters 65 | 66 | * `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. 67 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 68 | 69 | --- 70 | 71 | ## Show Payment 72 | 73 | ``` 74 | await Payment.find(id) 75 | ``` 76 | 77 | 78 | ### Parameters 79 | 80 | * `id` (int64): Required - Payment ID. 81 | -------------------------------------------------------------------------------- /docs/models/PaymentLineItem.md: -------------------------------------------------------------------------------- 1 | # PaymentLineItem 2 | 3 | ## Example PaymentLineItem Object 4 | 5 | ``` 6 | { 7 | "amount": 1.0, 8 | "created_at": "2000-01-01T01:00:00Z", 9 | "invoice_id": 1, 10 | "payment_id": 1 11 | } 12 | ``` 13 | 14 | * `amount` (double): Payment line item amount 15 | * `created_at` (date-time): Payment line item created at date/time 16 | * `invoice_id` (int64): Invoice ID 17 | * `payment_id` (int64): Payment ID 18 | -------------------------------------------------------------------------------- /docs/models/Permission.md: -------------------------------------------------------------------------------- 1 | # Permission 2 | 3 | ## Example Permission Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "path": "example", 9 | "user_id": 1, 10 | "username": "user", 11 | "group_id": 1, 12 | "group_name": "example", 13 | "permission": "full", 14 | "recursive": true, 15 | "site_id": 1 16 | } 17 | ``` 18 | 19 | * `id` (int64): Permission ID 20 | * `path` (string): Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 21 | * `user_id` (int64): User ID 22 | * `username` (string): Username (if applicable) 23 | * `group_id` (int64): Group ID 24 | * `group_name` (string): Group name (if applicable) 25 | * `permission` (string): Permission type. See the table referenced in the documentation for an explanation of each permission. 26 | * `recursive` (boolean): Recursive: does this permission apply to subfolders? 27 | * `site_id` (int64): Site ID 28 | 29 | --- 30 | 31 | ## List Permissions 32 | 33 | ``` 34 | await Permission.list({ 35 | 'path': "example", 36 | 'include_groups': false, 37 | 'group_id': 1, 38 | 'user_id': 1, 39 | }) 40 | ``` 41 | 42 | 43 | ### Parameters 44 | 45 | * `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. 46 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 47 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `group_id`, `path` or `user_id`. 48 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `path`, `group_id` or `user_id`. Valid field combinations are `[ group_id, path ]`, `[ user_id, path ]` or `[ user_id, group_id ]`. 49 | * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`. 50 | * `path` (string): Permission path. If provided, will scope all permissions(including upward) to this path. 51 | * `include_groups` (boolean): If searching by user or group, also include user's permissions that are inherited from its groups? 52 | * `group_id` (string): 53 | * `user_id` (string): 54 | 55 | --- 56 | 57 | ## Create Permission 58 | 59 | ``` 60 | await Permission.create({ 61 | 'path': "path", 62 | 'group_id': 1, 63 | 'permission': "full", 64 | 'recursive': false, 65 | 'user_id': 1, 66 | 'username': "user", 67 | 'group_name': "example", 68 | 'site_id': 1, 69 | }) 70 | ``` 71 | 72 | 73 | ### Parameters 74 | 75 | * `path` (string): Required - Folder path 76 | * `group_id` (int64): Group ID. Provide `group_name` or `group_id` 77 | * `permission` (string): Permission type. Can be `admin`, `full`, `readonly`, `writeonly`, `list`, or `history` 78 | * `recursive` (boolean): Apply to subfolders recursively? 79 | * `user_id` (int64): User ID. Provide `username` or `user_id` 80 | * `username` (string): User username. Provide `username` or `user_id` 81 | * `group_name` (string): Group name. Provide `group_name` or `group_id` 82 | * `site_id` (int64): Site ID. If not provided, will default to current site. Used when creating a permission for a child site. 83 | 84 | --- 85 | 86 | ## Delete Permission 87 | 88 | ``` 89 | const [permission] = await Permission.list() 90 | 91 | await permission.delete() 92 | ``` 93 | 94 | ### Parameters 95 | 96 | * `id` (int64): Required - Permission ID. 97 | 98 | -------------------------------------------------------------------------------- /docs/models/Preview.md: -------------------------------------------------------------------------------- 1 | # Preview 2 | 3 | ## Example Preview Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "status": "complete", 9 | "download_uri": "https://mysite.files.com/...", 10 | "type": "image", 11 | "size": "large" 12 | } 13 | ``` 14 | 15 | * `id` (int64): Preview ID 16 | * `status` (string): Preview status. Can be invalid, not_generated, generating, complete, or file_too_large 17 | * `download_uri` (string): Link to download preview 18 | * `type` (string): Preview type. Can be image, pdf, pdf_native, video, or audio 19 | * `size` (string): Preview size 20 | -------------------------------------------------------------------------------- /docs/models/Priority.md: -------------------------------------------------------------------------------- 1 | # Priority 2 | 3 | ## Example Priority Object 4 | 5 | ``` 6 | { 7 | "path": "foo/bar", 8 | "color": "pink" 9 | } 10 | ``` 11 | 12 | * `path` (string): The path corresponding to the priority color. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 13 | * `color` (string): The priority color 14 | 15 | --- 16 | 17 | ## List Priorities 18 | 19 | ``` 20 | await Priority.list(path) 21 | ``` 22 | 23 | 24 | ### Parameters 25 | 26 | * `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. 27 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 28 | * `path` (string): Required - The path to query for priorities 29 | -------------------------------------------------------------------------------- /docs/models/Project.md: -------------------------------------------------------------------------------- 1 | # Project 2 | 3 | ## Example Project Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "global_access": "none" 9 | } 10 | ``` 11 | 12 | * `id` (int64): Project ID 13 | * `global_access` (string): Global access settings 14 | 15 | --- 16 | 17 | ## List Projects 18 | 19 | ``` 20 | await Project.list 21 | ``` 22 | 23 | 24 | ### Parameters 25 | 26 | * `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. 27 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 28 | 29 | --- 30 | 31 | ## Show Project 32 | 33 | ``` 34 | await Project.find(id) 35 | ``` 36 | 37 | 38 | ### Parameters 39 | 40 | * `id` (int64): Required - Project ID. 41 | 42 | --- 43 | 44 | ## Create Project 45 | 46 | ``` 47 | await Project.create({ 48 | 'global_access': "global_access", 49 | }) 50 | ``` 51 | 52 | 53 | ### Parameters 54 | 55 | * `global_access` (string): Required - Global permissions. Can be: `none`, `anyone_with_read`, `anyone_with_full`. 56 | 57 | --- 58 | 59 | ## Update Project 60 | 61 | ``` 62 | const project = await Project.find(id) 63 | 64 | await project.update({ 65 | 'global_access': "global_access", 66 | }) 67 | ``` 68 | 69 | ### Parameters 70 | 71 | * `id` (int64): Required - Project ID. 72 | * `global_access` (string): Required - Global permissions. Can be: `none`, `anyone_with_read`, `anyone_with_full`. 73 | 74 | ### Example Response 75 | 76 | ```json 77 | { 78 | "id": 1, 79 | "global_access": "none" 80 | } 81 | ``` 82 | 83 | --- 84 | 85 | ## Delete Project 86 | 87 | ``` 88 | const project = await Project.find(id) 89 | 90 | await project.delete() 91 | ``` 92 | 93 | ### Parameters 94 | 95 | * `id` (int64): Required - Project ID. 96 | 97 | -------------------------------------------------------------------------------- /docs/models/PublicHostingRequestLog.md: -------------------------------------------------------------------------------- 1 | # PublicHostingRequestLog 2 | 3 | ## Example PublicHostingRequestLog Object 4 | 5 | ``` 6 | { 7 | "timestamp": "2000-01-01T01:00:00Z", 8 | "remote_ip": "example", 9 | "server_ip": "example", 10 | "hostname": "example", 11 | "path": "example", 12 | "responseCode": 1, 13 | "success": true, 14 | "duration_ms": 1 15 | } 16 | ``` 17 | 18 | * `timestamp` (date-time): Start Time of Action 19 | * `remote_ip` (string): IP Address of Public Hosting Client 20 | * `server_ip` (string): IP Address of Public Hosting Server 21 | * `hostname` (string): HTTP Request Hostname 22 | * `path` (string): HTTP Request Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 23 | * `responseCode` (int64): HTTP Response Code 24 | * `success` (boolean): Whether SFTP Action was successful. 25 | * `duration_ms` (int64): Duration (in milliseconds) 26 | 27 | --- 28 | 29 | ## List Public Hosting Request Logs 30 | 31 | ``` 32 | await PublicHostingRequestLog.list 33 | ``` 34 | 35 | 36 | ### Parameters 37 | 38 | * `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. 39 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 40 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `start_date`, `end_date`, `path`, `remote_ip` or `success`. Valid field combinations are `[ start_date ]`, `[ end_date ]`, `[ path ]`, `[ remote_ip ]`, `[ success ]`, `[ start_date, end_date ]`, `[ start_date, path ]`, `[ start_date, remote_ip ]`, `[ start_date, success ]`, `[ end_date, path ]`, `[ end_date, remote_ip ]`, `[ end_date, success ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ remote_ip, success ]`, `[ start_date, end_date, path ]`, `[ start_date, end_date, remote_ip ]`, `[ start_date, end_date, success ]`, `[ start_date, path, remote_ip ]`, `[ start_date, path, success ]`, `[ start_date, remote_ip, success ]`, `[ end_date, path, remote_ip ]`, `[ end_date, path, success ]`, `[ end_date, remote_ip, success ]`, `[ path, remote_ip, success ]`, `[ start_date, end_date, path, remote_ip ]`, `[ start_date, end_date, path, success ]`, `[ start_date, end_date, remote_ip, success ]`, `[ start_date, path, remote_ip, success ]` or `[ end_date, path, remote_ip, success ]`. 41 | * `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `path`. Valid field combinations are `[ start_date ]`, `[ end_date ]`, `[ path ]`, `[ remote_ip ]`, `[ success ]`, `[ start_date, end_date ]`, `[ start_date, path ]`, `[ start_date, remote_ip ]`, `[ start_date, success ]`, `[ end_date, path ]`, `[ end_date, remote_ip ]`, `[ end_date, success ]`, `[ path, remote_ip ]`, `[ path, success ]`, `[ remote_ip, success ]`, `[ start_date, end_date, path ]`, `[ start_date, end_date, remote_ip ]`, `[ start_date, end_date, success ]`, `[ start_date, path, remote_ip ]`, `[ start_date, path, success ]`, `[ start_date, remote_ip, success ]`, `[ end_date, path, remote_ip ]`, `[ end_date, path, success ]`, `[ end_date, remote_ip, success ]`, `[ path, remote_ip, success ]`, `[ start_date, end_date, path, remote_ip ]`, `[ start_date, end_date, path, success ]`, `[ start_date, end_date, remote_ip, success ]`, `[ start_date, path, remote_ip, success ]` or `[ end_date, path, remote_ip, success ]`. 42 | -------------------------------------------------------------------------------- /docs/models/PublicIpAddress.md: -------------------------------------------------------------------------------- 1 | # PublicIpAddress 2 | 3 | ## Example PublicIpAddress Object 4 | 5 | ``` 6 | { 7 | "ip_address": "1.1.1.1", 8 | "server_name": "server-1", 9 | "ftp_enabled": true, 10 | "sftp_enabled": true 11 | } 12 | ``` 13 | 14 | * `ip_address` (string): The public IP address. 15 | * `server_name` (string): The name of the frontend server. 16 | * `ftp_enabled` (boolean): 17 | * `sftp_enabled` (boolean): 18 | -------------------------------------------------------------------------------- /docs/models/RemoteBandwidthSnapshot.md: -------------------------------------------------------------------------------- 1 | # RemoteBandwidthSnapshot 2 | 3 | ## Example RemoteBandwidthSnapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "sync_bytes_received": 1.0, 9 | "sync_bytes_sent": 1.0, 10 | "logged_at": "2000-01-01T01:00:00Z", 11 | "remote_server_id": 1 12 | } 13 | ``` 14 | 15 | * `id` (int64): Site bandwidth ID 16 | * `sync_bytes_received` (double): Site sync bandwidth report bytes received 17 | * `sync_bytes_sent` (double): Site sync bandwidth report bytes sent 18 | * `logged_at` (date-time): Time the site bandwidth report was logged 19 | * `remote_server_id` (int64): ID of related Remote Server 20 | 21 | --- 22 | 23 | ## List Remote Bandwidth Snapshots 24 | 25 | ``` 26 | await RemoteBandwidthSnapshot.list 27 | ``` 28 | 29 | 30 | ### Parameters 31 | 32 | * `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. 33 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 34 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `logged_at`. 35 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `logged_at`. 36 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `logged_at`. 37 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `logged_at`. 38 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `logged_at`. 39 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `logged_at`. 40 | -------------------------------------------------------------------------------- /docs/models/RemoteServerConfigurationFile.md: -------------------------------------------------------------------------------- 1 | # RemoteServerConfigurationFile 2 | 3 | ## Example RemoteServerConfigurationFile Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "permission_set": "example", 9 | "private_key": "example", 10 | "subdomain": "example", 11 | "root": "C:\\Users\\", 12 | "follow_links": true, 13 | "prefer_protocol": "example", 14 | "dns": "example", 15 | "proxy_all_outbound": true, 16 | "endpoint_override": "example", 17 | "log_file": "example", 18 | "log_level": "example", 19 | "log_rotate_num": 1, 20 | "log_rotate_size": 1, 21 | "override_max_concurrent_jobs": 1, 22 | "graceful_shutdown_timeout": 1, 23 | "transfer_rate_limit": "example", 24 | "api_token": "example", 25 | "port": 1, 26 | "hostname": "example", 27 | "public_key": "example", 28 | "status": "example", 29 | "server_host_key": "example", 30 | "config_version": "example" 31 | } 32 | ``` 33 | 34 | * `id` (int64): The remote server ID of the agent 35 | * `permission_set` (string): The permission set for the agent ['read_write', 'read_only', 'write_only'] 36 | * `private_key` (string): The private key for the agent 37 | * `subdomain` (string): Files.com subdomain site name 38 | * `root` (string): The root directory for the agent 39 | * `follow_links` (boolean): Follow symlinks when traversing directories 40 | * `prefer_protocol` (string): Preferred network protocol ['udp', 'tcp'] (default udp) 41 | * `dns` (string): DNS lookup method ['auto','doh','system'] (default auto) 42 | * `proxy_all_outbound` (boolean): Proxy all outbound traffic through files.com proxy server 43 | * `endpoint_override` (string): Custom site endpoint URL 44 | * `log_file` (string): Log file name and location 45 | * `log_level` (string): Log level for the agent logs ['debug', 'info', 'warn', 'error', 'fatal'] (default info) 46 | * `log_rotate_num` (int64): Log route for agent logs. (default 5) 47 | * `log_rotate_size` (int64): Log route size in MB for agent logs. (default 20) 48 | * `override_max_concurrent_jobs` (int64): Maximum number of concurrent jobs (default 500) 49 | * `graceful_shutdown_timeout` (int64): Graceful shutdown timeout in seconds (default 15) 50 | * `transfer_rate_limit` (string): File transfer (upload/download) rate limit 51 | `-`, with the given periods: 52 | * 'S': second 53 | * 'M': minute 54 | * 'H': hour 55 | * 'D': day 56 | Examples: 57 | * 5 requests/second: '5-S' 58 | * 10 requests/minute: '10-M' 59 | * 1000 requests/hour: '1000-H' 60 | * 2000 requests/day: '2000-D' 61 | * `api_token` (string): Files Agent API Token 62 | * `port` (int64): Incoming port for files agent connections 63 | * `hostname` (string): 64 | * `public_key` (string): public key 65 | * `status` (string): either running or shutdown 66 | * `server_host_key` (string): 67 | * `config_version` (string): agent config version 68 | -------------------------------------------------------------------------------- /docs/models/Request.md: -------------------------------------------------------------------------------- 1 | # Request 2 | 3 | ## Example Request Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "path": "example", 9 | "source": "example", 10 | "destination": "example", 11 | "automation_id": 1, 12 | "user_display_name": "example" 13 | } 14 | ``` 15 | 16 | * `id` (int64): Request ID 17 | * `path` (string): Folder path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 18 | * `source` (string): Source filename, if applicable 19 | * `destination` (string): Destination filename 20 | * `automation_id` (int64): ID of automation that created request 21 | * `user_display_name` (string): User making the request (if applicable) 22 | * `user_ids` (string): A list of user IDs to request the file from. If sent as a string, it should be comma-delimited. 23 | * `group_ids` (string): A list of group IDs to request the file from. If sent as a string, it should be comma-delimited. 24 | 25 | --- 26 | 27 | ## List Requests 28 | 29 | ``` 30 | await Request.list({ 31 | 'mine': false, 32 | 'path': "example", 33 | }) 34 | ``` 35 | 36 | 37 | ### Parameters 38 | 39 | * `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. 40 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 41 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 42 | * `mine` (boolean): Only show requests of the current user? (Defaults to true if current user is not a site admin.) 43 | * `path` (string): Path to show requests for. If omitted, shows all paths. Send `/` to represent the root directory. 44 | 45 | --- 46 | 47 | ## List Requests 48 | 49 | ``` 50 | await Request.getFolder(path, { 51 | 'mine': false, 52 | }) 53 | ``` 54 | 55 | 56 | ### Parameters 57 | 58 | * `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. 59 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 60 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are . 61 | * `mine` (boolean): Only show requests of the current user? (Defaults to true if current user is not a site admin.) 62 | * `path` (string): Required - Path to show requests for. If omitted, shows all paths. Send `/` to represent the root directory. 63 | 64 | --- 65 | 66 | ## Create Request 67 | 68 | ``` 69 | await Request.create({ 70 | 'path': "path", 71 | 'destination': "destination", 72 | }) 73 | ``` 74 | 75 | 76 | ### Parameters 77 | 78 | * `path` (string): Required - Folder path on which to request the file. 79 | * `destination` (string): Required - Destination filename (without extension) to request. 80 | * `user_ids` (string): A list of user IDs to request the file from. If sent as a string, it should be comma-delimited. 81 | * `group_ids` (string): A list of group IDs to request the file from. If sent as a string, it should be comma-delimited. 82 | 83 | --- 84 | 85 | ## Delete Request 86 | 87 | ``` 88 | const [request] = await Request.list() 89 | 90 | await request.delete() 91 | ``` 92 | 93 | ### Parameters 94 | 95 | * `id` (int64): Required - Request ID. 96 | 97 | -------------------------------------------------------------------------------- /docs/models/Session.md: -------------------------------------------------------------------------------- 1 | # Session 2 | 3 | ## Example Session Object 4 | 5 | ``` 6 | { 7 | "id": "60525f92e859c4c3d74cb02fd176b1525901b525", 8 | "language": "en", 9 | "read_only": true, 10 | "sftp_insecure_ciphers": true 11 | } 12 | ``` 13 | 14 | * `id` (string): Session ID 15 | * `language` (string): Session language 16 | * `read_only` (boolean): Is this session read only? 17 | * `sftp_insecure_ciphers` (boolean): Are insecure SFTP ciphers allowed for this user? (If this is set to true, the site administrator has signaled that it is ok to use less secure SSH ciphers for this user.) 18 | * `username` (string): Username to sign in as 19 | * `password` (string): Password for sign in 20 | * `otp` (string): If this user has a 2FA device, provide its OTP or code here. 21 | * `partial_session_id` (string): Identifier for a partially-completed login 22 | 23 | --- 24 | 25 | ## Create user session (log in) 26 | 27 | ``` 28 | await Session.create({ 29 | 'username': "username", 30 | 'password': "password", 31 | 'otp': "123456", 32 | }) 33 | ``` 34 | 35 | 36 | ### Parameters 37 | 38 | * `username` (string): Username to sign in as 39 | * `password` (string): Password for sign in 40 | * `otp` (string): If this user has a 2FA device, provide its OTP or code here. 41 | * `partial_session_id` (string): Identifier for a partially-completed login 42 | 43 | --- 44 | 45 | ## Delete user session (log out) 46 | 47 | ``` 48 | await Session.delete 49 | ``` 50 | 51 | -------------------------------------------------------------------------------- /docs/models/SettingsChange.md: -------------------------------------------------------------------------------- 1 | # SettingsChange 2 | 3 | ## Example SettingsChange Object 4 | 5 | ``` 6 | { 7 | "api_key_id": 1, 8 | "changes": [ 9 | "example" 10 | ], 11 | "created_at": "2000-01-01T01:00:00Z", 12 | "user_id": 1, 13 | "user_is_files_support": true, 14 | "user_is_from_parent_site": true, 15 | "username": "some_user" 16 | } 17 | ``` 18 | 19 | * `api_key_id` (int64): The API key id responsible for this change. 20 | * `changes` (array(string)): Markdown-formatted change messages. 21 | * `created_at` (date-time): The time this change was made. 22 | * `user_id` (int64): The user id responsible for this change. 23 | * `user_is_files_support` (boolean): true if this change was performed by Files.com support. 24 | * `user_is_from_parent_site` (boolean): true if this change was performed by a user on a parent site. 25 | * `username` (string): The username of the user responsible for this change. 26 | 27 | --- 28 | 29 | ## List Settings Changes 30 | 31 | ``` 32 | await SettingsChange.list 33 | ``` 34 | 35 | 36 | ### Parameters 37 | 38 | * `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. 39 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 40 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `api_key_id` or `user_id`. 41 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `api_key_id` and `user_id`. 42 | -------------------------------------------------------------------------------- /docs/models/SftpHostKey.md: -------------------------------------------------------------------------------- 1 | # SftpHostKey 2 | 3 | ## Example SftpHostKey Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "name": "My Key", 9 | "fingerprint_md5": "12:7e:f8:61:78:a4:b2:c2:ee:12:51:92:25:a7:42:cc", 10 | "fingerprint_sha256": "SHA256:5ANRkDpXWA+PgOquzZAG9RtQ1Bt8KXYAH2hecr7LQk8" 11 | } 12 | ``` 13 | 14 | * `id` (int64): SFTP Host Key ID 15 | * `name` (string): The friendly name of this SFTP Host Key. 16 | * `fingerprint_md5` (string): MD5 Fingerprint of the public key 17 | * `fingerprint_sha256` (string): SHA256 Fingerprint of the public key 18 | * `private_key` (string): The private key data. 19 | 20 | --- 21 | 22 | ## List SFTP Host Keys 23 | 24 | ``` 25 | await SftpHostKey.list 26 | ``` 27 | 28 | 29 | ### Parameters 30 | 31 | * `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. 32 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 33 | 34 | --- 35 | 36 | ## Show SFTP Host Key 37 | 38 | ``` 39 | await SftpHostKey.find(id) 40 | ``` 41 | 42 | 43 | ### Parameters 44 | 45 | * `id` (int64): Required - Sftp Host Key ID. 46 | 47 | --- 48 | 49 | ## Create SFTP Host Key 50 | 51 | ``` 52 | await SftpHostKey.create({ 53 | 'name': "My Key", 54 | }) 55 | ``` 56 | 57 | 58 | ### Parameters 59 | 60 | * `name` (string): The friendly name of this SFTP Host Key. 61 | * `private_key` (string): The private key data. 62 | 63 | --- 64 | 65 | ## Update SFTP Host Key 66 | 67 | ``` 68 | const sftp_host_key = await SftpHostKey.find(id) 69 | 70 | await sftp_host_key.update({ 71 | 'name': "My Key", 72 | }) 73 | ``` 74 | 75 | ### Parameters 76 | 77 | * `id` (int64): Required - Sftp Host Key ID. 78 | * `name` (string): The friendly name of this SFTP Host Key. 79 | * `private_key` (string): The private key data. 80 | 81 | ### Example Response 82 | 83 | ```json 84 | { 85 | "id": 1, 86 | "name": "My Key", 87 | "fingerprint_md5": "12:7e:f8:61:78:a4:b2:c2:ee:12:51:92:25:a7:42:cc", 88 | "fingerprint_sha256": "SHA256:5ANRkDpXWA+PgOquzZAG9RtQ1Bt8KXYAH2hecr7LQk8" 89 | } 90 | ``` 91 | 92 | --- 93 | 94 | ## Delete SFTP Host Key 95 | 96 | ``` 97 | const sftp_host_key = await SftpHostKey.find(id) 98 | 99 | await sftp_host_key.delete() 100 | ``` 101 | 102 | ### Parameters 103 | 104 | * `id` (int64): Required - Sftp Host Key ID. 105 | 106 | -------------------------------------------------------------------------------- /docs/models/ShareGroup.md: -------------------------------------------------------------------------------- 1 | # ShareGroup 2 | 3 | ## Example ShareGroup Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "name": "Test group 1", 9 | "notes": "This group is defined for testing purposes", 10 | "user_id": 1, 11 | "members": [ 12 | { 13 | "name": "John Doe", 14 | "company": "Acme Ltd", 15 | "email": "johndoe@gmail.com" 16 | } 17 | ] 18 | } 19 | ``` 20 | 21 | * `id` (int64): Share Group ID 22 | * `name` (string): Name of the share group 23 | * `notes` (string): Additional notes of the share group 24 | * `user_id` (int64): Owner User ID 25 | * `members` (array(object)): A list of share group members 26 | 27 | --- 28 | 29 | ## List Share Groups 30 | 31 | ``` 32 | await ShareGroup.list({ 33 | 'user_id': 1, 34 | }) 35 | ``` 36 | 37 | 38 | ### Parameters 39 | 40 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 41 | * `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 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 43 | 44 | --- 45 | 46 | ## Show Share Group 47 | 48 | ``` 49 | await ShareGroup.find(id) 50 | ``` 51 | 52 | 53 | ### Parameters 54 | 55 | * `id` (int64): Required - Share Group ID. 56 | 57 | --- 58 | 59 | ## Create Share Group 60 | 61 | ``` 62 | await ShareGroup.create({ 63 | 'user_id': 1, 64 | 'notes': "This group is defined for testing purposes", 65 | 'name': "Test group 1", 66 | 'members': [{"name":"John Doe","company":"Acme Ltd","email":"johndoe@gmail.com"}], 67 | }) 68 | ``` 69 | 70 | 71 | ### Parameters 72 | 73 | * `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user. 74 | * `notes` (string): Additional notes of the share group 75 | * `name` (string): Required - Name of the share group 76 | * `members` (array(object)): Required - A list of share group members. 77 | 78 | --- 79 | 80 | ## Update Share Group 81 | 82 | ``` 83 | const share_group = await ShareGroup.find(id) 84 | 85 | await share_group.update({ 86 | 'notes': "This group is defined for testing purposes", 87 | 'name': "Test group 1", 88 | 'members': [{"name":"John Doe","company":"Acme Ltd","email":"johndoe@gmail.com"}], 89 | }) 90 | ``` 91 | 92 | ### Parameters 93 | 94 | * `id` (int64): Required - Share Group ID. 95 | * `notes` (string): Additional notes of the share group 96 | * `name` (string): Name of the share group 97 | * `members` (array(object)): A list of share group members. 98 | 99 | ### Example Response 100 | 101 | ```json 102 | { 103 | "id": 1, 104 | "name": "Test group 1", 105 | "notes": "This group is defined for testing purposes", 106 | "user_id": 1, 107 | "members": [ 108 | { 109 | "name": "John Doe", 110 | "company": "Acme Ltd", 111 | "email": "johndoe@gmail.com" 112 | } 113 | ] 114 | } 115 | ``` 116 | 117 | --- 118 | 119 | ## Delete Share Group 120 | 121 | ``` 122 | const share_group = await ShareGroup.find(id) 123 | 124 | await share_group.delete() 125 | ``` 126 | 127 | ### Parameters 128 | 129 | * `id` (int64): Required - Share Group ID. 130 | 131 | -------------------------------------------------------------------------------- /docs/models/ShareGroupMember.md: -------------------------------------------------------------------------------- 1 | # ShareGroupMember 2 | 3 | ## Example ShareGroupMember Object 4 | 5 | ``` 6 | { 7 | "name": "John Doe", 8 | "company": "Acme Ltd", 9 | "email": "johndoe@gmail.com" 10 | } 11 | ``` 12 | 13 | * `name` (string): Name of the share group member 14 | * `company` (string): Company of the share group member 15 | * `email` (string): Email of the share group member 16 | -------------------------------------------------------------------------------- /docs/models/Snapshot.md: -------------------------------------------------------------------------------- 1 | # Snapshot 2 | 3 | ## Example Snapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "expires_at": "2000-01-01T01:00:00Z", 9 | "finalized_at": "2000-01-01T01:00:00Z", 10 | "name": "My Snapshot", 11 | "user_id": 1, 12 | "bundle_id": 1 13 | } 14 | ``` 15 | 16 | * `id` (int64): The snapshot's unique ID. 17 | * `expires_at` (date-time): When the snapshot expires. 18 | * `finalized_at` (date-time): When the snapshot was finalized. 19 | * `name` (string): A name for the snapshot. 20 | * `user_id` (int64): The user that created this snapshot, if applicable. 21 | * `bundle_id` (int64): The bundle using this snapshot, if applicable. 22 | * `paths` (array(string)): An array of paths to add to the snapshot. 23 | 24 | --- 25 | 26 | ## List Snapshots 27 | 28 | ``` 29 | await Snapshot.list 30 | ``` 31 | 32 | 33 | ### Parameters 34 | 35 | * `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. 36 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 37 | 38 | --- 39 | 40 | ## Show Snapshot 41 | 42 | ``` 43 | await Snapshot.find(id) 44 | ``` 45 | 46 | 47 | ### Parameters 48 | 49 | * `id` (int64): Required - Snapshot ID. 50 | 51 | --- 52 | 53 | ## Create Snapshot 54 | 55 | ``` 56 | await Snapshot.create({ 57 | 'expires_at': "2000-01-01T01:00:00Z", 58 | 'name': "My Snapshot", 59 | }) 60 | ``` 61 | 62 | 63 | ### Parameters 64 | 65 | * `expires_at` (string): When the snapshot expires. 66 | * `name` (string): A name for the snapshot. 67 | * `paths` (array(string)): An array of paths to add to the snapshot. 68 | 69 | --- 70 | 71 | ## Finalize Snapshot 72 | 73 | ``` 74 | const snapshot = await Snapshot.find(id) 75 | 76 | await snapshot.finalize() 77 | ``` 78 | 79 | ### Parameters 80 | 81 | * `id` (int64): Required - Snapshot ID. 82 | 83 | 84 | --- 85 | 86 | ## Update Snapshot 87 | 88 | ``` 89 | const snapshot = await Snapshot.find(id) 90 | 91 | await snapshot.update({ 92 | 'expires_at': "2000-01-01T01:00:00Z", 93 | 'name': "My Snapshot", 94 | }) 95 | ``` 96 | 97 | ### Parameters 98 | 99 | * `id` (int64): Required - Snapshot ID. 100 | * `expires_at` (string): When the snapshot expires. 101 | * `name` (string): A name for the snapshot. 102 | * `paths` (array(string)): An array of paths to add to the snapshot. 103 | 104 | ### Example Response 105 | 106 | ```json 107 | { 108 | "id": 1, 109 | "expires_at": "2000-01-01T01:00:00Z", 110 | "finalized_at": "2000-01-01T01:00:00Z", 111 | "name": "My Snapshot", 112 | "user_id": 1, 113 | "bundle_id": 1 114 | } 115 | ``` 116 | 117 | --- 118 | 119 | ## Delete Snapshot 120 | 121 | ``` 122 | const snapshot = await Snapshot.find(id) 123 | 124 | await snapshot.delete() 125 | ``` 126 | 127 | ### Parameters 128 | 129 | * `id` (int64): Required - Snapshot ID. 130 | 131 | -------------------------------------------------------------------------------- /docs/models/Status.md: -------------------------------------------------------------------------------- 1 | # Status 2 | 3 | ## Example Status Object 4 | 5 | ``` 6 | { 7 | "code": 200, 8 | "message": "example", 9 | "status": "", 10 | "data": "example", 11 | "errors": [ 12 | { 13 | "fields": [ 14 | 15 | ], 16 | "messages": [ 17 | 18 | ] 19 | } 20 | ], 21 | "clickwrap_id": 1, 22 | "clickwrap_body": "example" 23 | } 24 | ``` 25 | 26 | * `code` (int64): Status HTTP code 27 | * `message` (string): Error message 28 | * `status` (string): Status message 29 | * `data` (Auto): Additional data 30 | * `errors` (array(object)): A list of api errors 31 | * `clickwrap_id` (int64): Required Clickwrap id 32 | * `clickwrap_body` (string): Required Clickwrap body 33 | -------------------------------------------------------------------------------- /docs/models/Style.md: -------------------------------------------------------------------------------- 1 | # Style 2 | 3 | ## Example Style Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "path": "example", 9 | "logo": "https://mysite.files.com/...", 10 | "thumbnail": { 11 | "name": "My logo", 12 | "uri": "https://mysite.files.com/.../my_image.png" 13 | } 14 | } 15 | ``` 16 | 17 | * `id` (int64): Style ID 18 | * `path` (string): Folder path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 19 | * `logo` (Image): Logo 20 | * `thumbnail` (Image): Logo thumbnail 21 | * `file` (file): Logo for custom branding. 22 | 23 | --- 24 | 25 | ## Show Style 26 | 27 | ``` 28 | await Style.find(path) 29 | ``` 30 | 31 | 32 | ### Parameters 33 | 34 | * `path` (string): Required - Style path. 35 | 36 | --- 37 | 38 | ## Update Style 39 | 40 | ``` 41 | const style = await Style.find(path) 42 | 43 | await style.update({ 44 | 'file': "file", 45 | }) 46 | ``` 47 | 48 | ### Parameters 49 | 50 | * `path` (string): Required - Style path. 51 | * `file` (file): Required - Logo for custom branding. 52 | 53 | ### Example Response 54 | 55 | ```json 56 | { 57 | "id": 1, 58 | "path": "example", 59 | "logo": "https://mysite.files.com/...", 60 | "thumbnail": { 61 | "name": "My logo", 62 | "uri": "https://mysite.files.com/.../my_image.png" 63 | } 64 | } 65 | ``` 66 | 67 | --- 68 | 69 | ## Delete Style 70 | 71 | ``` 72 | const style = await Style.find(path) 73 | 74 | await style.delete() 75 | ``` 76 | 77 | ### Parameters 78 | 79 | * `path` (string): Required - Style path. 80 | 81 | -------------------------------------------------------------------------------- /docs/models/UsageByTopLevelDir.md: -------------------------------------------------------------------------------- 1 | # UsageByTopLevelDir 2 | 3 | ## Example UsageByTopLevelDir Object 4 | 5 | ``` 6 | { 7 | "dir": "", 8 | "size": 1, 9 | "count": 1 10 | } 11 | ``` 12 | 13 | * `dir` (string): Directory name 14 | * `size` (int64): Usage 15 | * `count` (int64): File count 16 | -------------------------------------------------------------------------------- /docs/models/UsageDailySnapshot.md: -------------------------------------------------------------------------------- 1 | # UsageDailySnapshot 2 | 3 | ## Example UsageDailySnapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "date": "2000-01-01T01:00:00Z", 9 | "api_usage_available": true, 10 | "read_api_usage": 1, 11 | "write_api_usage": 1, 12 | "user_count": 1, 13 | "current_storage": 1.0, 14 | "deleted_files_storage": 1.0, 15 | "deleted_files_counted_in_minimum": 1.0, 16 | "root_storage": 1.0, 17 | "usage_by_top_level_dir": [ 18 | { 19 | "dir": "dir", 20 | "size": 100, 21 | "count": 10 22 | } 23 | ] 24 | } 25 | ``` 26 | 27 | * `id` (int64): ID of the usage record 28 | * `date` (date): The date of this usage record 29 | * `api_usage_available` (boolean): True if the API usage fields `read_api_usage` and `write_api_usage` can be relied upon. If this is false, we suggest hiding that value from any UI. 30 | * `read_api_usage` (int64): Read API Calls used on this day. Note: only updated for days before the current day. 31 | * `write_api_usage` (int64): Write API Calls used on this day. Note: only updated for days before the current day. 32 | * `user_count` (int64): Number of billable users as of this day. 33 | * `current_storage` (double): GB of Files Native Storage used on this day. 34 | * `deleted_files_storage` (double): GB of Files Native Storage used on this day for files that have been deleted and are stored as backups. 35 | * `deleted_files_counted_in_minimum` (double): GB of Files Native Storage used on this day for files that have been permanently deleted but were uploaded less than 30 days ago, and are still billable. 36 | * `root_storage` (double): GB of Files Native Storage used for the root folder. Included here because this value will not be part of `usage_by_top_level_dir` 37 | * `usage_by_top_level_dir` (array(object)): Usage broken down by each top-level folder 38 | 39 | --- 40 | 41 | ## List Usage Daily Snapshots 42 | 43 | ``` 44 | await UsageDailySnapshot.list 45 | ``` 46 | 47 | 48 | ### Parameters 49 | 50 | * `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. 51 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 52 | * `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `date`. 53 | * `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `date` and `usage_snapshot_id`. Valid field combinations are `[ usage_snapshot_id, date ]`. 54 | * `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `date`. 55 | * `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `date`. 56 | * `filter_lt` (object): If set, return records where the specified field is less than the supplied value. Valid fields are `date`. 57 | * `filter_lteq` (object): If set, return records where the specified field is less than or equal the supplied value. Valid fields are `date`. 58 | -------------------------------------------------------------------------------- /docs/models/UsageSnapshot.md: -------------------------------------------------------------------------------- 1 | # UsageSnapshot 2 | 3 | ## Example UsageSnapshot Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "start_at": "2000-01-01T01:00:00Z", 9 | "end_at": "2000-01-01T01:00:00Z", 10 | "high_water_user_count": 1, 11 | "current_storage": 1.0, 12 | "high_water_storage": 1.0, 13 | "root_storage": 1.0, 14 | "deleted_files_counted_in_minimum": 1.0, 15 | "deleted_files_storage": 1.0, 16 | "total_billable_usage": 1.0, 17 | "total_billable_transfer_usage": 1.0, 18 | "bytes_sent": 1.0, 19 | "sync_bytes_received": 1.0, 20 | "sync_bytes_sent": 1.0, 21 | "usage_by_top_level_dir": [ 22 | { 23 | "dir": "dir", 24 | "size": 100, 25 | "count": 10 26 | } 27 | ] 28 | } 29 | ``` 30 | 31 | * `id` (int64): Usage snapshot ID 32 | * `start_at` (date-time): Usage snapshot start date/time 33 | * `end_at` (date-time): Usage snapshot end date/time 34 | * `high_water_user_count` (int64): Highest user count number in time period 35 | * `current_storage` (double): Current total Storage Usage GB as of end date (not necessarily high water mark, which is used for billing) 36 | * `high_water_storage` (double): Highest Storage Usage GB recorded in time period (used for billing) 37 | * `root_storage` (double): Storage Usage for root folder as of end date (not necessarily high water mark, which is used for billing) 38 | * `deleted_files_counted_in_minimum` (double): Storage Usage for files that are deleted but uploaded within last 30 days as of end date (not necessarily high water mark, which is used for billing) 39 | * `deleted_files_storage` (double): Storage Usage for files that are deleted but retained as backups as of end date (not necessarily high water mark, which is used for billing) 40 | * `total_billable_usage` (double): Storage + Transfer Usage - Total Billable amount 41 | * `total_billable_transfer_usage` (double): Transfer usage for period - Total Billable amount 42 | * `bytes_sent` (double): Transfer Usage for period - Outbound GB from Files Native Storage 43 | * `sync_bytes_received` (double): Transfer Usage for period - Inbound GB to Remote Servers (Sync/Mount) 44 | * `sync_bytes_sent` (double): Transfer Usage for period - Outbound GB from Remote Servers (Sync/Mount) 45 | * `usage_by_top_level_dir` (array(object)): Storage Usage - map of root folders to their usage as of end date (not necessarily high water mark, which is used for billing) 46 | 47 | --- 48 | 49 | ## List Usage Snapshots 50 | 51 | ``` 52 | await UsageSnapshot.list 53 | ``` 54 | 55 | 56 | ### Parameters 57 | 58 | * `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. 59 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 60 | -------------------------------------------------------------------------------- /docs/models/UserCipherUse.md: -------------------------------------------------------------------------------- 1 | # UserCipherUse 2 | 3 | ## Example UserCipherUse Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "protocol_cipher": "TLSv1.2; ECDHE-RSA-AES256-GCM-SHA384", 9 | "created_at": "2000-01-01T01:00:00Z", 10 | "insecure": true, 11 | "interface": "restapi", 12 | "updated_at": "2000-01-01T01:00:00Z", 13 | "user_id": 1 14 | } 15 | ``` 16 | 17 | * `id` (int64): UserCipherUse ID 18 | * `protocol_cipher` (string): The protocol and cipher employed 19 | * `created_at` (date-time): The earliest recorded use of this combination of interface and protocol and cipher (for this user) 20 | * `insecure` (boolean): Is this cipher considered insecure? 21 | * `interface` (string): The interface accessed 22 | * `updated_at` (date-time): The most recent use of this combination of interface and protocol and cipher (for this user) 23 | * `user_id` (int64): ID of the user who performed this access 24 | 25 | --- 26 | 27 | ## List User Cipher Uses 28 | 29 | ``` 30 | await UserCipherUse.list({ 31 | 'user_id': 1, 32 | }) 33 | ``` 34 | 35 | 36 | ### Parameters 37 | 38 | * `user_id` (int64): User ID. If provided, will return uses for this user. 39 | * `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. 40 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 41 | -------------------------------------------------------------------------------- /docs/models/UserRequest.md: -------------------------------------------------------------------------------- 1 | # UserRequest 2 | 3 | ## Example UserRequest Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "name": "John Doe", 9 | "email": "john.doe@files.com", 10 | "details": "Changed Departments", 11 | "company": "Acme Inc." 12 | } 13 | ``` 14 | 15 | * `id` (int64): ID 16 | * `name` (string): User's full name 17 | * `email` (email): User email address 18 | * `details` (string): Details of the user's request 19 | * `company` (string): User's company name 20 | 21 | --- 22 | 23 | ## List User Requests 24 | 25 | ``` 26 | await UserRequest.list 27 | ``` 28 | 29 | 30 | ### Parameters 31 | 32 | * `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. 33 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 34 | 35 | --- 36 | 37 | ## Show User Request 38 | 39 | ``` 40 | await UserRequest.find(id) 41 | ``` 42 | 43 | 44 | ### Parameters 45 | 46 | * `id` (int64): Required - User Request ID. 47 | 48 | --- 49 | 50 | ## Create User Request 51 | 52 | ``` 53 | await UserRequest.create({ 54 | 'name': "name", 55 | 'email': "email", 56 | 'details': "details", 57 | 'company': "Acme Inc.", 58 | }) 59 | ``` 60 | 61 | 62 | ### Parameters 63 | 64 | * `name` (string): Required - Name of user requested 65 | * `email` (string): Required - Email of user requested 66 | * `details` (string): Required - Details of the user request 67 | * `company` (string): Company of the user requested 68 | 69 | --- 70 | 71 | ## Delete User Request 72 | 73 | ``` 74 | const user_request = await UserRequest.find(id) 75 | 76 | await user_request.delete() 77 | ``` 78 | 79 | ### Parameters 80 | 81 | * `id` (int64): Required - User Request ID. 82 | 83 | -------------------------------------------------------------------------------- /docs/models/UserSftpClientUse.md: -------------------------------------------------------------------------------- 1 | # UserSftpClientUse 2 | 3 | ## Example UserSftpClientUse Object 4 | 5 | ``` 6 | { 7 | "id": 1, 8 | "sftp_client": "example", 9 | "created_at": "2000-01-01T01:00:00Z", 10 | "updated_at": "2000-01-01T01:00:00Z", 11 | "user_id": 1 12 | } 13 | ``` 14 | 15 | * `id` (int64): UserSftpClientUse ID 16 | * `sftp_client` (string): The SFTP client used 17 | * `created_at` (date-time): The earliest recorded use of this SFTP client (for this user) 18 | * `updated_at` (date-time): The most recent use of this SFTP client (for this user) 19 | * `user_id` (int64): ID of the user who performed this access 20 | 21 | --- 22 | 23 | ## List User SFTP Client Uses 24 | 25 | ``` 26 | await UserSftpClientUse.list({ 27 | 'user_id': 1, 28 | }) 29 | ``` 30 | 31 | 32 | ### Parameters 33 | 34 | * `user_id` (int64): User ID. If provided, will return uses for this user. 35 | * `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. 36 | * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 37 | -------------------------------------------------------------------------------- /docs/models/WebhookTest.md: -------------------------------------------------------------------------------- 1 | # WebhookTest 2 | 3 | ## Example WebhookTest Object 4 | 5 | ``` 6 | { 7 | "code": 200, 8 | "message": "", 9 | "status": "", 10 | "data": "example", 11 | "success": true 12 | } 13 | ``` 14 | 15 | * `code` (int64): Status HTTP code 16 | * `message` (string): Error message 17 | * `status` (string): Status message 18 | * `data` (Auto): Additional data 19 | * `success` (boolean): The success status of the webhook test 20 | * `url` (string): URL for testing the webhook. 21 | * `method` (string): HTTP method(GET or POST). 22 | * `encoding` (string): HTTP encoding method. Can be JSON, XML, or RAW (form data). 23 | * `headers` (object): Additional request headers. 24 | * `body` (object): Additional body parameters. 25 | * `raw_body` (string): raw body text 26 | * `file_as_body` (boolean): Send the file data as the request body? 27 | * `file_form_field` (string): Send the file data as a named parameter in the request POST body 28 | * `action` (string): action for test body 29 | * `use_dedicated_ips` (boolean): Use dedicated IPs for sending the webhook? 30 | 31 | --- 32 | 33 | ## Create Webhook Test 34 | 35 | ``` 36 | await WebhookTest.create({ 37 | 'url': "https://www.site.com/...", 38 | 'method': "GET", 39 | 'encoding': "RAW", 40 | 'headers': {"x-test-header":"testvalue"}, 41 | 'body': {"test-param":"testvalue"}, 42 | 'raw_body': "test body", 43 | 'file_as_body': false, 44 | 'file_form_field': "upload_file_data", 45 | 'use_dedicated_ips': false, 46 | }) 47 | ``` 48 | 49 | 50 | ### Parameters 51 | 52 | * `url` (string): Required - URL for testing the webhook. 53 | * `method` (string): HTTP method(GET or POST). 54 | * `encoding` (string): HTTP encoding method. Can be JSON, XML, or RAW (form data). 55 | * `headers` (object): Additional request headers. 56 | * `body` (object): Additional body parameters. 57 | * `raw_body` (string): raw body text 58 | * `file_as_body` (boolean): Send the file data as the request body? 59 | * `file_form_field` (string): Send the file data as a named parameter in the request POST body 60 | * `action` (string): action for test body 61 | * `use_dedicated_ips` (boolean): Use dedicated IPs for sending the webhook? 62 | -------------------------------------------------------------------------------- /files.com-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Files-com/files-sdk-javascript/92da3bcfe0fa46f831cfd79c03ed7a6c9ccc14f2/files.com-logo.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | exports.Files = require('./lib/Files') 2 | exports.Logger = require('./lib/Logger') 3 | -------------------------------------------------------------------------------- /lib/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | exports.__esModule = true; 5 | var _Files = _interopRequireDefault(require("./Files")); 6 | exports.Files = _Files.default; 7 | var _Logger = _interopRequireDefault(require("./Logger")); 8 | exports.Logger = _Logger.default; -------------------------------------------------------------------------------- /lib/models/Auto.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | var _typeof = require("@babel/runtime/helpers/typeof"); 5 | exports.__esModule = true; 6 | exports.default = void 0; 7 | var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); 8 | var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); 9 | var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); 10 | var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); 11 | var _Api = _interopRequireDefault(require("../Api")); 12 | var errors = _interopRequireWildcard(require("../Errors")); 13 | var _utils = require("../utils"); 14 | function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } 15 | function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 16 | function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable no-unused-vars */ 17 | /* eslint-enable no-unused-vars */ 18 | /** 19 | * Class Auto 20 | */ 21 | var Auto = /*#__PURE__*/(0, _createClass2.default)(function Auto() { 22 | var _this = this; 23 | var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 24 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 25 | (0, _classCallCheck2.default)(this, Auto); 26 | (0, _defineProperty2.default)(this, "attributes", {}); 27 | (0, _defineProperty2.default)(this, "options", {}); 28 | (0, _defineProperty2.default)(this, "isLoaded", function () { 29 | return !!_this.attributes.id; 30 | }); 31 | // object 32 | (0, _defineProperty2.default)(this, "getDynamic", function () { 33 | return _this.attributes.dynamic; 34 | }); 35 | Object.entries(attributes).forEach(function (_ref) { 36 | var _ref2 = (0, _slicedToArray2.default)(_ref, 2), 37 | key = _ref2[0], 38 | value = _ref2[1]; 39 | var normalizedKey = key.replace('?', ''); 40 | _this.attributes[normalizedKey] = value; 41 | Object.defineProperty(_this, normalizedKey, { 42 | value: value, 43 | writable: false 44 | }); 45 | }); 46 | this.options = _objectSpread({}, options); 47 | }); 48 | var _default = exports.default = Auto; 49 | module.exports = Auto; 50 | module.exports.default = Auto; -------------------------------------------------------------------------------- /lib/models/Errors.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | var _typeof = require("@babel/runtime/helpers/typeof"); 5 | exports.__esModule = true; 6 | exports.default = void 0; 7 | var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); 8 | var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); 9 | var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); 10 | var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); 11 | var _Api = _interopRequireDefault(require("../Api")); 12 | var errors = _interopRequireWildcard(require("../Errors")); 13 | var _utils = require("../utils"); 14 | function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } 15 | function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 16 | function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable no-unused-vars */ 17 | /* eslint-enable no-unused-vars */ 18 | /** 19 | * Class Errors 20 | */ 21 | var Errors = /*#__PURE__*/(0, _createClass2.default)(function Errors() { 22 | var _this = this; 23 | var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 24 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 25 | (0, _classCallCheck2.default)(this, Errors); 26 | (0, _defineProperty2.default)(this, "attributes", {}); 27 | (0, _defineProperty2.default)(this, "options", {}); 28 | (0, _defineProperty2.default)(this, "isLoaded", function () { 29 | return !!_this.attributes.id; 30 | }); 31 | // array(string) # A list of fields where errors occur 32 | (0, _defineProperty2.default)(this, "getFields", function () { 33 | return _this.attributes.fields; 34 | }); 35 | // array(string) # A list of error messages 36 | (0, _defineProperty2.default)(this, "getMessages", function () { 37 | return _this.attributes.messages; 38 | }); 39 | Object.entries(attributes).forEach(function (_ref) { 40 | var _ref2 = (0, _slicedToArray2.default)(_ref, 2), 41 | key = _ref2[0], 42 | value = _ref2[1]; 43 | var normalizedKey = key.replace('?', ''); 44 | _this.attributes[normalizedKey] = value; 45 | Object.defineProperty(_this, normalizedKey, { 46 | value: value, 47 | writable: false 48 | }); 49 | }); 50 | this.options = _objectSpread({}, options); 51 | }); 52 | var _default = exports.default = Errors; 53 | module.exports = Errors; 54 | module.exports.default = Errors; -------------------------------------------------------------------------------- /lib/models/FileAction.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | var _typeof = require("@babel/runtime/helpers/typeof"); 5 | exports.__esModule = true; 6 | exports.default = void 0; 7 | var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); 8 | var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); 9 | var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); 10 | var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); 11 | var _Api = _interopRequireDefault(require("../Api")); 12 | var errors = _interopRequireWildcard(require("../Errors")); 13 | var _utils = require("../utils"); 14 | function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } 15 | function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 16 | function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable no-unused-vars */ 17 | /* eslint-enable no-unused-vars */ 18 | /** 19 | * Class FileAction 20 | */ 21 | var FileAction = /*#__PURE__*/(0, _createClass2.default)(function FileAction() { 22 | var _this = this; 23 | var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 24 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 25 | (0, _classCallCheck2.default)(this, FileAction); 26 | (0, _defineProperty2.default)(this, "attributes", {}); 27 | (0, _defineProperty2.default)(this, "options", {}); 28 | (0, _defineProperty2.default)(this, "isLoaded", function () { 29 | return !!_this.attributes.path; 30 | }); 31 | // string # Status of file operation. 32 | (0, _defineProperty2.default)(this, "getStatus", function () { 33 | return _this.attributes.status; 34 | }); 35 | // int64 # If status is pending, this is the id of the File Migration to check for status updates. 36 | (0, _defineProperty2.default)(this, "getFileMigrationId", function () { 37 | return _this.attributes.file_migration_id; 38 | }); 39 | Object.entries(attributes).forEach(function (_ref) { 40 | var _ref2 = (0, _slicedToArray2.default)(_ref, 2), 41 | key = _ref2[0], 42 | value = _ref2[1]; 43 | var normalizedKey = key.replace('?', ''); 44 | _this.attributes[normalizedKey] = value; 45 | Object.defineProperty(_this, normalizedKey, { 46 | value: value, 47 | writable: false 48 | }); 49 | }); 50 | this.options = _objectSpread({}, options); 51 | }); 52 | var _default = exports.default = FileAction; 53 | module.exports = FileAction; 54 | module.exports.default = FileAction; -------------------------------------------------------------------------------- /lib/models/Image.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | var _typeof = require("@babel/runtime/helpers/typeof"); 5 | exports.__esModule = true; 6 | exports.default = void 0; 7 | var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); 8 | var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); 9 | var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); 10 | var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); 11 | var _Api = _interopRequireDefault(require("../Api")); 12 | var errors = _interopRequireWildcard(require("../Errors")); 13 | var _utils = require("../utils"); 14 | function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); } 15 | function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } 16 | function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable no-unused-vars */ 17 | /* eslint-enable no-unused-vars */ 18 | /** 19 | * Class Image 20 | */ 21 | var Image = /*#__PURE__*/(0, _createClass2.default)(function Image() { 22 | var _this = this; 23 | var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 24 | var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 25 | (0, _classCallCheck2.default)(this, Image); 26 | (0, _defineProperty2.default)(this, "attributes", {}); 27 | (0, _defineProperty2.default)(this, "options", {}); 28 | (0, _defineProperty2.default)(this, "isLoaded", function () { 29 | return !!_this.attributes.id; 30 | }); 31 | // string # Image name 32 | (0, _defineProperty2.default)(this, "getName", function () { 33 | return _this.attributes.name; 34 | }); 35 | // string # Image URI 36 | (0, _defineProperty2.default)(this, "getUri", function () { 37 | return _this.attributes.uri; 38 | }); 39 | Object.entries(attributes).forEach(function (_ref) { 40 | var _ref2 = (0, _slicedToArray2.default)(_ref, 2), 41 | key = _ref2[0], 42 | value = _ref2[1]; 43 | var normalizedKey = key.replace('?', ''); 44 | _this.attributes[normalizedKey] = value; 45 | Object.defineProperty(_this, normalizedKey, { 46 | value: value, 47 | writable: false 48 | }); 49 | }); 50 | this.options = _objectSpread({}, options); 51 | }); 52 | var _default = exports.default = Image; 53 | module.exports = Image; 54 | module.exports.default = Image; -------------------------------------------------------------------------------- /lib/utils.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); 4 | exports.__esModule = true; 5 | exports.isString = exports.isObject = exports.isInt = exports.isEmpty = exports.isBrowser = exports.isArray = exports.getType = void 0; 6 | var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); 7 | var _pathNormalizer = _interopRequireDefault(require("./utils/pathNormalizer")); 8 | exports.pathNormalizer = _pathNormalizer.default; 9 | var isArray = exports.isArray = function isArray(value) { 10 | return Array.isArray(value); 11 | }; 12 | var isInt = exports.isInt = function isInt(value) { 13 | return typeof value === 'number'; 14 | }; 15 | var isObject = exports.isObject = function isObject(value) { 16 | return value && (0, _typeof2.default)(value) === 'object' && !Array.isArray(value); 17 | }; 18 | var isString = exports.isString = function isString(value) { 19 | return typeof value === 'string'; 20 | }; 21 | var isEmpty = exports.isEmpty = function isEmpty(value) { 22 | return !value || isArray(value) && value.length === 0 || isObject(value) && Object.keys(value).length === 0; 23 | }; 24 | var getType = exports.getType = function getType(value) { 25 | return isArray(value) ? 'array' : (0, _typeof2.default)(value); 26 | }; 27 | 28 | // eslint-disable-next-line no-restricted-globals 29 | var isBrowser = exports.isBrowser = function isBrowser() { 30 | return typeof self !== 'undefined' && typeof self.document !== 'undefined'; 31 | }; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "files.com", 3 | "version": "1.2.257", 4 | "description": "Files.com SDK for JavaScript", 5 | "keywords": [ 6 | "files.com", 7 | "cloud storage", 8 | "api" 9 | ], 10 | "homepage": "https://www.files.com/", 11 | "author": "Files.com (https://www.files.com/)", 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/Files-com/files-sdk-javascript.git" 15 | }, 16 | "contributors": [], 17 | "engines": { 18 | "node": "^6 || ^8.1 || >=10.*" 19 | }, 20 | "main": "lib/Files.js", 21 | "module": "src/Files.js", 22 | "dependencies": { 23 | "@babel/runtime": "^7.10.3", 24 | "cross-fetch": "^4.0.0", 25 | "readable-stream": "^4.4.0", 26 | "safe-buffer": "^5.2.1" 27 | }, 28 | "license": "MIT", 29 | "devDependencies": { 30 | "@babel/cli": "^7.10.3", 31 | "@babel/core": "^7.10.3", 32 | "@babel/eslint-parser": "^7.22.15", 33 | "@babel/plugin-proposal-class-properties": "^7.10.1", 34 | "@babel/plugin-transform-modules-commonjs": "^7.10.1", 35 | "@babel/plugin-transform-runtime": "^7.10.3", 36 | "@babel/preset-env": "^7.10.3", 37 | "eslint": "^8.51.0", 38 | "eslint-config-airbnb": "^19.0.4", 39 | "eslint-plugin-import": "^2.28.1", 40 | "eslint-plugin-jest": "^27.4.2", 41 | "eslint-plugin-jsx-a11y": "^6.8.0", 42 | "eslint-plugin-react": "^7.33.2", 43 | "eslint-plugin-react-hooks": "^4.6.0", 44 | "jest": "^29.7.0", 45 | "nock": "^13.4.0" 46 | }, 47 | "scripts": { 48 | "build": "./node_modules/.bin/babel src -d lib", 49 | "test": "jest", 50 | "lint": "eslint --fix src/", 51 | "watch": "jest --watch" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /shared/header_test_data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "headers": {}, 4 | "result": null 5 | }, 6 | { 7 | "headers": { 8 | "Retry-After": ["aaaaaa"] 9 | }, 10 | "result": null 11 | }, 12 | { 13 | "headers": { 14 | "Retry-After": ["5"] 15 | }, 16 | "result": 5 17 | }, 18 | { 19 | "headers": { 20 | "Retry-After": ["60"] 21 | }, 22 | "result": null 23 | }, 24 | { 25 | "headers": { 26 | "Retry-After": ["5", "10"] 27 | }, 28 | "result": 5 29 | }, 30 | { 31 | "headers": { 32 | "Retry-After": ["5", "aaaaaa"] 33 | }, 34 | "result": 5 35 | }, 36 | { 37 | "headers": { 38 | "Retry-After": ["%s"] 39 | }, 40 | "result": 8 41 | } 42 | ] -------------------------------------------------------------------------------- /shared/normalization_for_comparison_test_data.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ "filename.txt", "filename.txt" ], 3 | [ "FiLeNaMe.TxT", "filename.txt" ], 4 | [ "FILENAME.TXT", "filename.txt" ], 5 | [ "FÎŁĘÑÂMÉ.TXT", "filename.txt" ], 6 | [ "Fïłèńämê.Txt", "filename.txt" ], 7 | [ "a/b/c.txt", "a/b/c.txt" ], 8 | [ "A\\B\\C.TXT", "a/b/c.txt" ], 9 | [ "A/B\\C.TXT", "a/b/c.txt" ], 10 | [ "//a/b//c.txt", "a/b/c.txt" ], 11 | [ "a/b/c.txt ", "a/b/c.txt" ], 12 | [ "a/b/c.txt\t", "a/b/c.txt" ], 13 | [ "a/b/c.txt\n", "a/b/c.txt" ], 14 | [ "a/b/c.txt\r", "a/b/c.txt" ], 15 | [ " space_at_beginning", " space_at_beginning"], 16 | [ "space_at_end ", "space_at_end"], 17 | [ "tab\tseparated", "tab\tseparated"], 18 | [ "hello</hello>", "<title>hello</hello>"], 19 | [ "안녕하세요", "안녕하세요" ], 20 | [ "こんにちは", "こんにちは" ], 21 | [ "今日は", "今日は" ], 22 | [ "longest_unicode_character_﷽", "longest_unicode_character_﷽"], 23 | [ "invalid_null_byte_before\u0000after", "invalid_null_byte_beforeafter" ], 24 | [ "a/b/c/../../hello", "a/b/c/hello" ], 25 | [ "a/b/c/././hello", "a/b/c/hello" ], 26 | [ "one_code_point_ą", "one_code_point_a" ], 27 | [ "two_code_points_ą", "two_code_points_a" ], 28 | [ "one_code_point_훯", "one_code_point_훯"], 29 | [ "three_code_points_훯", "three_code_points_훯" ], 30 | [ "ÞþŊŋŦŧ", "þþŋŋŧŧ" ], 31 | [ "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ", "aaaaaaaeceeeeiiiidnoooooouuuuyssaaaaaaaeceeeeiiiidnoooooouuuuyy" ], 32 | [ "ĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİIJij", "aaaaaaccccccccddddeeeeeeeeeegggggggghhhhiiiiiiiiiijij" ], 33 | [ "ĴĵĶķĹĺĻļĽľŁłŃńŅņŇňʼnŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤť", "jjkkllllllllnnnnnnʼnoooooooeoerrrrrrsssssssstttt" ], 34 | [ "ŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽž", "uuuuuuuuuuuuwwyyyzzzzzz" ], 35 | [ "😂❤️😍🤣😊🙏💕😭😘👍😅👏😁♥️🔥💔💖💙😢🤔😆🙄💪😉☺️👌🤗", "😂❤️😍🤣😊🙏💕😭😘👍😅👏😁♥️🔥💔💖💙😢🤔😆🙄💪😉☺️👌🤗" ], 36 | [ "💜😔😎😇🌹🤦🎉💞✌️✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣️", "💜😔😎😇🌹🤦🎉💞✌️✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣️" ], 37 | [ "emoji_‼️", "emoji_!!️" ], 38 | [ "<title>hello<:hello>.txt", "<title>hello<:hello>.txt" ], 39 | [ "twodotfile..txt", "twodotfile..txt" ], 40 | [ "three/.../dots_path", "three/.../dots_path" ], 41 | [ ".", "" ], 42 | [ "..", ""], 43 | [ "./..", "" ], 44 | [ "../..", ""], 45 | [ "./.", "" ], 46 | [ "../.", ""], 47 | [ "./../.", "" ], 48 | [ ".././..", ""] 49 | ] -------------------------------------------------------------------------------- /shared/url_test_data.json: -------------------------------------------------------------------------------- 1 | { 2 | "substitute_urls": [ 3 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=%s&X-Goog-Expires=%s&X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-SignedHeaders=host", 4 | "https://s3.amazonaws.com/test.example.com/metadata/1234/00000000-0000-0000-0001-00000000?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=%s&X-Amz-Expires=%s", 5 | "https://filescomtests.blob.core.windows.net/testazureremote/ntie3buw/file-to-download.txt?sp=se=%s" 6 | ], 7 | "error_urls": [ 8 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=20220101T120000Z", 9 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=20220101T120000Z&X-Goog-Date=20220202T120000Z", 10 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Expires=900&X-Goog-Expires=600", 11 | "https://filescomtests.blob.core.windows.net/testazureremote/ntie3buw/file-to-download.txt?sp=se=20220101T120000Z&sp=se=20220202T120000Z", 12 | "https://filescomtests.blob.core.windows.net/testazureremote/ntie3buw/file-to-download.txt?sp=20220101T120000Z", 13 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=20220101&X-Goog-Expires=900", 14 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=asdf&X-Goog-Expires=900", 15 | "https://storage.googleapis.com/example-bucket/cat.jpeg?X-Goog-Date=20220101T120000Z&&X-Goog-Expires=900", 16 | "https://s3.amazonaws.com/test.example.com/metadata/1234/00000000-0000-0000-0001-00000000?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=asdf&X-Amz-Expires=900" 17 | ] 18 | } -------------------------------------------------------------------------------- /src/Files.js: -------------------------------------------------------------------------------- 1 | import { LogLevel } from './Logger' 2 | 3 | const endpointPrefix = '/api/rest/v1' 4 | 5 | let apiKey 6 | let baseUrl = 'https://app.files.com' 7 | let sessionId = null 8 | let language = null 9 | const version = '1.2.257' 10 | let userAgent = `Files.com JavaScript SDK v${version}` 11 | 12 | let logLevel = LogLevel.INFO 13 | let debugRequest = false 14 | let debugResponseHeaders = false 15 | 16 | let maxNetworkRetries = 3 17 | let minNetworkRetryDelay = 0.5 18 | let maxNetworkRetryDelay = 1.5 19 | let networkTimeout = 60.0 20 | let autoPaginate = true 21 | 22 | class Files { 23 | static setUserAgent = value => { userAgent = value } 24 | 25 | static getUserAgent = () => userAgent 26 | 27 | static setApiKey = value => { apiKey = value } 28 | 29 | static getApiKey = () => apiKey 30 | 31 | static setBaseUrl = value => { baseUrl = value } 32 | 33 | static getBaseUrl = () => baseUrl 34 | 35 | static setSessionId = value => { sessionId = value } 36 | 37 | static getSessionId = () => sessionId 38 | 39 | static getLanguage = () => language 40 | 41 | static setLanguage = value => { language = value } 42 | 43 | static getEndpointPrefix = () => endpointPrefix 44 | 45 | static setLogLevel = value => { logLevel = value } 46 | 47 | static getLogLevel = () => logLevel 48 | 49 | static configureDebugging = options => { 50 | if (typeof options.debugRequest !== 'undefined') { 51 | debugRequest = options.debugRequest 52 | } 53 | 54 | if (typeof options.debugResponseHeaders !== 'undefined') { 55 | debugResponseHeaders = options.debugResponseHeaders 56 | } 57 | } 58 | 59 | static shouldDebugRequest = () => debugRequest 60 | 61 | static shouldDebugResponseHeaders = () => debugResponseHeaders 62 | 63 | static configureNetwork = options => { 64 | if (typeof options.maxNetworkRetries !== 'undefined') { 65 | maxNetworkRetries = options.maxNetworkRetries 66 | } 67 | 68 | if (typeof options.minNetworkRetryDelay !== 'undefined') { 69 | minNetworkRetryDelay = options.minNetworkRetryDelay 70 | } 71 | 72 | if (typeof options.maxNetworkRetryDelay !== 'undefined') { 73 | maxNetworkRetryDelay = options.maxNetworkRetryDelay 74 | } 75 | 76 | if (typeof options.networkTimeout !== 'undefined') { 77 | networkTimeout = options.networkTimeout 78 | } 79 | 80 | if (typeof options.autoPaginate !== 'undefined') { 81 | autoPaginate = options.autoPaginate 82 | } 83 | } 84 | 85 | static getMaxNetworkRetries = () => maxNetworkRetries 86 | 87 | static getMinNetworkRetryDelay = () => minNetworkRetryDelay 88 | 89 | static getMaxNetworkRetryDelay = () => maxNetworkRetryDelay 90 | 91 | static getNetworkTimeout = () => networkTimeout 92 | 93 | static getAutoPaginate = () => autoPaginate 94 | } 95 | 96 | export default Files 97 | 98 | module.exports = Files 99 | module.exports.default = Files 100 | -------------------------------------------------------------------------------- /src/Logger.js: -------------------------------------------------------------------------------- 1 | class Logger { 2 | /* eslint-disable sort-keys */ 3 | static LogLevel = { 4 | NONE: 0, 5 | ERROR: 1, 6 | WARN: 2, 7 | INFO: 3, 8 | DEBUG: 4, 9 | } 10 | /* eslint-enable sort-keys */ 11 | 12 | static getLogLevelMethod = level => { 13 | switch (level) { 14 | case Logger.LogLevel.ERROR: return 'error' 15 | case Logger.LogLevel.WARN: return 'warn' 16 | case Logger.LogLevel.INFO: return 'info' 17 | case Logger.LogLevel.DEBUG: return 'log' 18 | default: return 'log' 19 | } 20 | } 21 | 22 | static isPaused = false 23 | 24 | static getLogLevelName = level => { 25 | switch (level) { 26 | case Logger.LogLevel.ERROR: return 'error' 27 | case Logger.LogLevel.WARN: return 'warn' 28 | case Logger.LogLevel.INFO: return 'info' 29 | case Logger.LogLevel.DEBUG: return 'debug' 30 | default: return level 31 | } 32 | } 33 | 34 | static error = (...messages) => { 35 | Logger.log(Logger.LogLevel.ERROR, ...messages) 36 | } 37 | 38 | static warn = (...messages) => { 39 | Logger.log(Logger.LogLevel.WARN, ...messages) 40 | } 41 | 42 | static info = (...messages) => { 43 | Logger.log(Logger.LogLevel.INFO, ...messages) 44 | } 45 | 46 | static debug = (...messages) => { 47 | Logger.log(Logger.LogLevel.DEBUG, ...messages) 48 | } 49 | 50 | static log = (level = Logger.LogLevel.INFO, ...messages) => { 51 | if (Logger.isPaused || messages.length === 0) { 52 | return 53 | } 54 | 55 | const Files = require('./Files').default 56 | 57 | if (Files.getLogLevel() < level) { 58 | return 59 | } 60 | 61 | const prefix = `[${Logger.getLogLevelName(level)}]: ` 62 | const method = Logger.getLogLevelMethod(level) 63 | console[method](prefix, ...messages) // eslint-disable-line no-console 64 | } 65 | 66 | static pause = () => { 67 | Logger.isPaused = true 68 | } 69 | 70 | static unpause = () => { 71 | Logger.isPaused = false 72 | } 73 | } 74 | 75 | export const { LogLevel } = Logger 76 | 77 | export default Logger 78 | 79 | module.exports = Logger 80 | module.exports.default = Logger 81 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import Files from './Files' 2 | import Logger from './Logger' 3 | 4 | export { 5 | Files, 6 | Logger, 7 | } 8 | -------------------------------------------------------------------------------- /src/isomorphic/File.node.js: -------------------------------------------------------------------------------- 1 | const openDiskFileReadStream = sourceFilePath => { 2 | const fs = require('fs') 3 | return fs.createReadStream(sourceFilePath) 4 | } 5 | 6 | const openDiskFileWriteStream = destination => { 7 | const fs = require('fs') 8 | return fs.createWriteStream(destination) 9 | } 10 | 11 | const saveUrlToStream = async (url, stream) => new Promise((resolve, reject) => { 12 | const https = require('https') 13 | 14 | https.get(url, response => { 15 | response.pipe(stream) 16 | 17 | stream.on('finish', () => { 18 | stream.close() 19 | resolve() 20 | }) 21 | }) 22 | .on('error', error => { 23 | stream.close() 24 | reject(error) 25 | }) 26 | }) 27 | 28 | const saveUrlToString = async url => new Promise((resolve, reject) => { 29 | const https = require('https') 30 | 31 | https.get(url, response => { 32 | const chunks = [] 33 | response.on('data', chunk => chunks.push(Buffer.from(chunk))) 34 | response.on('end', () => resolve(Buffer.concat(chunks).toString('utf8'))) 35 | }) 36 | .on('error', error => { 37 | reject(error) 38 | }) 39 | }) 40 | 41 | const saveUrlToFile = async (url, destinationPath) => { 42 | const stream = openDiskFileWriteStream(destinationPath) 43 | await saveUrlToStream(url, stream) 44 | } 45 | 46 | export { 47 | openDiskFileReadStream, 48 | openDiskFileWriteStream, 49 | saveUrlToFile, 50 | saveUrlToStream, 51 | saveUrlToString, 52 | } 53 | -------------------------------------------------------------------------------- /src/models/AccountLineItem.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class AccountLineItem 11 | */ 12 | class AccountLineItem { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // int64 # Line item Id 32 | getId = () => this.attributes.id 33 | 34 | // double # Line item amount 35 | getAmount = () => this.attributes.amount 36 | 37 | // double # Line item balance 38 | getBalance = () => this.attributes.balance 39 | 40 | // date-time # Line item created at 41 | getCreatedAt = () => this.attributes.created_at 42 | 43 | // string # Line item currency 44 | getCurrency = () => this.attributes.currency 45 | 46 | // string # Line item download uri 47 | getDownloadUri = () => this.attributes.download_uri 48 | 49 | // array(object) # Associated invoice line items 50 | getInvoiceLineItems = () => this.attributes.invoice_line_items 51 | 52 | // string # Line item payment method 53 | getMethod = () => this.attributes.method 54 | 55 | // array(object) # Associated payment line items 56 | getPaymentLineItems = () => this.attributes.payment_line_items 57 | 58 | // date-time # Date/time payment was reversed if applicable 59 | getPaymentReversedAt = () => this.attributes.payment_reversed_at 60 | 61 | // string # Type of payment if applicable 62 | getPaymentType = () => this.attributes.payment_type 63 | 64 | // string # Site name this line item is for 65 | getSiteName = () => this.attributes.site_name 66 | 67 | // string # Type of line item, either payment or invoice 68 | getType = () => this.attributes.type 69 | } 70 | 71 | export default AccountLineItem 72 | 73 | module.exports = AccountLineItem 74 | module.exports.default = AccountLineItem 75 | -------------------------------------------------------------------------------- /src/models/Action.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class Action 11 | */ 12 | class Action { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // int64 # Action ID 32 | getId = () => this.attributes.id 33 | 34 | // string # Path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 35 | getPath = () => this.attributes.path 36 | 37 | // date-time # Action occurrence date/time 38 | getWhen = () => this.attributes.when 39 | 40 | // string # The destination path for this action, if applicable 41 | getDestination = () => this.attributes.destination 42 | 43 | // string # Friendly displayed output 44 | getDisplay = () => this.attributes.display 45 | 46 | // string # IP Address that performed this action 47 | getIp = () => this.attributes.ip 48 | 49 | // string # The source path for this action, if applicable 50 | getSource = () => this.attributes.source 51 | 52 | // object # Targets 53 | getTargets = () => this.attributes.targets 54 | 55 | // int64 # User ID 56 | getUserId = () => this.attributes.user_id 57 | 58 | // string # Username 59 | getUsername = () => this.attributes.username 60 | 61 | // boolean # true if this change was performed by a user on a parent site. 62 | getUserIsFromParentSite = () => this.attributes.user_is_from_parent_site 63 | 64 | // string # Type of action 65 | getAction = () => this.attributes.action 66 | 67 | // string # Failure type. If action was a user login or session failure, why did it fail? 68 | getFailureType = () => this.attributes.failure_type 69 | 70 | // string # Interface on which this action occurred. 71 | getInterface = () => this.attributes.interface 72 | } 73 | 74 | export default Action 75 | 76 | module.exports = Action 77 | module.exports.default = Action 78 | -------------------------------------------------------------------------------- /src/models/Auto.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class Auto 11 | */ 12 | class Auto { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // object 32 | getDynamic = () => this.attributes.dynamic 33 | } 34 | 35 | export default Auto 36 | 37 | module.exports = Auto 38 | module.exports.default = Auto 39 | -------------------------------------------------------------------------------- /src/models/BundlePath.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class BundlePath 11 | */ 12 | class BundlePath { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // boolean # Allow access to subfolders content? 32 | getRecursive = () => this.attributes.recursive 33 | 34 | // string # The path to the resource relative to filesystem. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 35 | getPath = () => this.attributes.path 36 | } 37 | 38 | export default BundlePath 39 | 40 | module.exports = BundlePath 41 | module.exports.default = BundlePath 42 | -------------------------------------------------------------------------------- /src/models/DnsRecord.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class DnsRecord 11 | */ 12 | class DnsRecord { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // string # Unique label for DNS record; used by Zapier and other integrations. 32 | getId = () => this.attributes.id 33 | 34 | // string # DNS record domain name 35 | getDomain = () => this.attributes.domain 36 | 37 | // string # DNS record type 38 | getRrtype = () => this.attributes.rrtype 39 | 40 | // string # DNS record value 41 | getValue = () => this.attributes.value 42 | 43 | // Parameters: 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. 45 | // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 46 | static list = async (params = {}, options = {}) => { 47 | if (params.cursor && !isString(params.cursor)) { 48 | throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`) 49 | } 50 | 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)}`) 53 | } 54 | 55 | const response = await Api.sendRequest('/dns_records', 'GET', params, options) 56 | 57 | return response?.data?.map(obj => new DnsRecord(obj, options)) || [] 58 | } 59 | 60 | static all = (params = {}, options = {}) => 61 | DnsRecord.list(params, options) 62 | } 63 | 64 | export default DnsRecord 65 | 66 | module.exports = DnsRecord 67 | module.exports.default = DnsRecord 68 | -------------------------------------------------------------------------------- /src/models/EmailLog.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class EmailLog 11 | */ 12 | class EmailLog { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // date-time # Start Time of Action 32 | getTimestamp = () => this.attributes.timestamp 33 | 34 | // string # Log Message 35 | getMessage = () => this.attributes.message 36 | 37 | // string # Status of E-Mail delivery 38 | getStatus = () => this.attributes.status 39 | 40 | // string # Subject line of E-Mail 41 | getSubject = () => this.attributes.subject 42 | 43 | // string # To field of E-Mail 44 | getTo = () => this.attributes.to 45 | 46 | // string # CC field of E-Mail 47 | getCc = () => this.attributes.cc 48 | 49 | // string # How was the email delivered? `customer_smtp` or `files.com` 50 | getDeliveryMethod = () => this.attributes.delivery_method 51 | 52 | // string # Customer SMTP Hostname used. 53 | getSmtpHostname = () => this.attributes.smtp_hostname 54 | 55 | // string # Customer SMTP IP address as resolved for use (useful for troubleshooting DNS issues with customer SMTP). 56 | getSmtpIp = () => this.attributes.smtp_ip 57 | 58 | // Parameters: 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. 60 | // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 61 | // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `start_date`, `end_date` or `status`. Valid field combinations are `[ start_date ]`, `[ end_date ]`, `[ status ]`, `[ start_date, end_date ]`, `[ start_date, status ]` or `[ end_date, status ]`. 62 | // filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `status`. Valid field combinations are `[ start_date ]`, `[ end_date ]`, `[ status ]`, `[ start_date, end_date ]`, `[ start_date, status ]` or `[ end_date, status ]`. 63 | static list = async (params = {}, options = {}) => { 64 | if (params.cursor && !isString(params.cursor)) { 65 | throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`) 66 | } 67 | 68 | if (params.per_page && !isInt(params.per_page)) { 69 | throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`) 70 | } 71 | 72 | const response = await Api.sendRequest('/email_logs', 'GET', params, options) 73 | 74 | return response?.data?.map(obj => new EmailLog(obj, options)) || [] 75 | } 76 | 77 | static all = (params = {}, options = {}) => 78 | EmailLog.list(params, options) 79 | } 80 | 81 | export default EmailLog 82 | 83 | module.exports = EmailLog 84 | module.exports.default = EmailLog 85 | -------------------------------------------------------------------------------- /src/models/Errors.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class Errors 11 | */ 12 | class Errors { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // array(string) # A list of fields where errors occur 32 | getFields = () => this.attributes.fields 33 | 34 | // array(string) # A list of error messages 35 | getMessages = () => this.attributes.messages 36 | } 37 | 38 | export default Errors 39 | 40 | module.exports = Errors 41 | module.exports.default = Errors 42 | -------------------------------------------------------------------------------- /src/models/FileAction.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class FileAction 11 | */ 12 | class FileAction { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.path 30 | 31 | // string # Status of file operation. 32 | getStatus = () => this.attributes.status 33 | 34 | // int64 # If status is pending, this is the id of the File Migration to check for status updates. 35 | getFileMigrationId = () => this.attributes.file_migration_id 36 | } 37 | 38 | export default FileAction 39 | 40 | module.exports = FileAction 41 | module.exports.default = FileAction 42 | -------------------------------------------------------------------------------- /src/models/FileMigration.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class FileMigration 11 | */ 12 | class FileMigration { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // int64 # File migration ID 32 | getId = () => this.attributes.id 33 | 34 | // string # Source path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 35 | getPath = () => this.attributes.path 36 | 37 | // string # Destination path 38 | getDestPath = () => this.attributes.dest_path 39 | 40 | // int64 # Number of files processed 41 | getFilesMoved = () => this.attributes.files_moved 42 | 43 | // int64 44 | getFilesTotal = () => this.attributes.files_total 45 | 46 | // string # The type of operation 47 | getOperation = () => this.attributes.operation 48 | 49 | // string # Region 50 | getRegion = () => this.attributes.region 51 | 52 | // string # Status 53 | getStatus = () => this.attributes.status 54 | 55 | // string # Link to download the log file for this migration. 56 | getLogUrl = () => this.attributes.log_url 57 | 58 | // Parameters: 59 | // id (required) - int64 - File Migration ID. 60 | static find = async (id, params = {}, options = {}) => { 61 | if (!isObject(params)) { 62 | throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`) 63 | } 64 | 65 | params.id = id 66 | 67 | if (!params.id) { 68 | throw new errors.MissingParameterError('Parameter missing: id') 69 | } 70 | 71 | if (params.id && !isInt(params.id)) { 72 | throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params.id)}`) 73 | } 74 | 75 | const response = await Api.sendRequest(`/file_migrations/${encodeURIComponent(params.id)}`, 'GET', params, options) 76 | 77 | return new FileMigration(response?.data, options) 78 | } 79 | 80 | static get = (id, params = {}, options = {}) => 81 | FileMigration.find(id, params, options) 82 | } 83 | 84 | export default FileMigration 85 | 86 | module.exports = FileMigration 87 | module.exports.default = FileMigration 88 | -------------------------------------------------------------------------------- /src/models/FileUploadPart.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class FileUploadPart 11 | */ 12 | class FileUploadPart { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // object # Content-Type and File to send 32 | getSend = () => this.attributes.send 33 | 34 | // string # Type of upload 35 | getAction = () => this.attributes.action 36 | 37 | // boolean # If `true`, this file exists and you may wish to ask the user for overwrite confirmation 38 | getAskAboutOverwrites = () => this.attributes.ask_about_overwrites 39 | 40 | // int64 # Number of parts in the upload 41 | getAvailableParts = () => this.attributes.available_parts 42 | 43 | // string # Date/time of when this Upload part expires and the URL cannot be used any more 44 | getExpires = () => this.attributes.expires 45 | 46 | // object # Additional upload headers to provide as part of the upload 47 | getHeaders = () => this.attributes.headers 48 | 49 | // string # HTTP Method to use for uploading the part, usually `PUT` 50 | getHttpMethod = () => this.attributes.http_method 51 | 52 | // int64 # Size in bytes for this part 53 | getNextPartsize = () => this.attributes.next_partsize 54 | 55 | // boolean # If `true`, multiple parts may be uploaded in parallel. If `false`, be sure to only upload one part at a time, in order. 56 | getParallelParts = () => this.attributes.parallel_parts 57 | 58 | // boolean # If `true`, parts may be retried. If `false`, a part cannot be retried and the upload should be restarted. 59 | getRetryParts = () => this.attributes.retry_parts 60 | 61 | // object # Additional HTTP parameters to send with the upload 62 | getParameters = () => this.attributes.parameters 63 | 64 | // int64 # Number of this upload part 65 | getPartNumber = () => this.attributes.part_number 66 | 67 | // int64 # Size in bytes for the next upload part 68 | getPartsize = () => this.attributes.partsize 69 | 70 | // string # New file path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 71 | getPath = () => this.attributes.path 72 | 73 | // string # Reference name for this upload part 74 | getRef = () => this.attributes.ref 75 | 76 | // string # URI to upload this part to 77 | getUploadUri = () => this.attributes.upload_uri 78 | } 79 | 80 | export default FileUploadPart 81 | 82 | module.exports = FileUploadPart 83 | module.exports.default = FileUploadPart 84 | -------------------------------------------------------------------------------- /src/models/FormField.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class FormField 11 | */ 12 | class FormField { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // int64 # Form field id 32 | getId = () => this.attributes.id 33 | 34 | // string # Label to be displayed 35 | getLabel = () => this.attributes.label 36 | 37 | // boolean # Is this a required field? 38 | getRequired = () => this.attributes.required 39 | 40 | // string # Help text to be displayed 41 | getHelpText = () => this.attributes.help_text 42 | 43 | // string # Type of Field 44 | getFieldType = () => this.attributes.field_type 45 | 46 | // array(string) # Options to display for radio and dropdown 47 | getOptionsForSelect = () => this.attributes.options_for_select 48 | 49 | // string # Default option for radio and dropdown 50 | getDefaultOption = () => this.attributes.default_option 51 | 52 | // int64 # Form field set id 53 | getFormFieldSetId = () => this.attributes.form_field_set_id 54 | } 55 | 56 | export default FormField 57 | 58 | module.exports = FormField 59 | module.exports.default = FormField 60 | -------------------------------------------------------------------------------- /src/models/Image.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class Image 11 | */ 12 | class Image { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // string # Image name 32 | getName = () => this.attributes.name 33 | 34 | // string # Image URI 35 | getUri = () => this.attributes.uri 36 | } 37 | 38 | export default Image 39 | 40 | module.exports = Image 41 | module.exports.default = Image 42 | -------------------------------------------------------------------------------- /src/models/InboxUpload.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class InboxUpload 11 | */ 12 | class InboxUpload { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // InboxRegistration 32 | getInboxRegistration = () => this.attributes.inbox_registration 33 | 34 | // string # Upload path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 35 | getPath = () => this.attributes.path 36 | 37 | // date-time # Upload date/time 38 | getCreatedAt = () => this.attributes.created_at 39 | 40 | // Parameters: 41 | // 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 | // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 43 | // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`. 44 | // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `folder_behavior_id` or `inbox_registration_id`. Valid field combinations are `[ folder_behavior_id, created_at ]`, `[ inbox_registration_id, created_at ]`, `[ folder_behavior_id, inbox_registration_id ]` or `[ folder_behavior_id, inbox_registration_id, created_at ]`. 45 | // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at`. 46 | // filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at`. 47 | // filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `created_at`. 48 | // filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `created_at`. 49 | static list = async (params = {}, options = {}) => { 50 | if (params.cursor && !isString(params.cursor)) { 51 | throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`) 52 | } 53 | 54 | if (params.per_page && !isInt(params.per_page)) { 55 | throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`) 56 | } 57 | 58 | const response = await Api.sendRequest('/inbox_uploads', 'GET', params, options) 59 | 60 | return response?.data?.map(obj => new InboxUpload(obj, options)) || [] 61 | } 62 | 63 | static all = (params = {}, options = {}) => 64 | InboxUpload.list(params, options) 65 | } 66 | 67 | export default InboxUpload 68 | 69 | module.exports = InboxUpload 70 | module.exports.default = InboxUpload 71 | -------------------------------------------------------------------------------- /src/models/InvoiceLineItem.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class InvoiceLineItem 11 | */ 12 | class InvoiceLineItem { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // double # Invoice line item amount 32 | getAmount = () => this.attributes.amount 33 | 34 | // date-time # Invoice line item created at date/time 35 | getCreatedAt = () => this.attributes.created_at 36 | 37 | // string # Invoice line item description 38 | getDescription = () => this.attributes.description 39 | 40 | // string # Invoice line item type 41 | getType = () => this.attributes.type 42 | 43 | // date-time # Invoice line item service end date/time 44 | getServiceEndAt = () => this.attributes.service_end_at 45 | 46 | // date-time # Invoice line item service start date/time 47 | getServiceStartAt = () => this.attributes.service_start_at 48 | 49 | // string # Plan name 50 | getPlan = () => this.attributes.plan 51 | 52 | // string # Site name 53 | getSite = () => this.attributes.site 54 | } 55 | 56 | export default InvoiceLineItem 57 | 58 | module.exports = InvoiceLineItem 59 | module.exports.default = InvoiceLineItem 60 | -------------------------------------------------------------------------------- /src/models/PaymentLineItem.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class PaymentLineItem 11 | */ 12 | class PaymentLineItem { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // double # Payment line item amount 32 | getAmount = () => this.attributes.amount 33 | 34 | // date-time # Payment line item created at date/time 35 | getCreatedAt = () => this.attributes.created_at 36 | 37 | // int64 # Invoice ID 38 | getInvoiceId = () => this.attributes.invoice_id 39 | 40 | // int64 # Payment ID 41 | getPaymentId = () => this.attributes.payment_id 42 | } 43 | 44 | export default PaymentLineItem 45 | 46 | module.exports = PaymentLineItem 47 | module.exports.default = PaymentLineItem 48 | -------------------------------------------------------------------------------- /src/models/Preview.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class Preview 11 | */ 12 | class Preview { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // int64 # Preview ID 32 | getId = () => this.attributes.id 33 | 34 | // string # Preview status. Can be invalid, not_generated, generating, complete, or file_too_large 35 | getStatus = () => this.attributes.status 36 | 37 | // string # Link to download preview 38 | getDownloadUri = () => this.attributes.download_uri 39 | 40 | // string # Preview type. Can be image, pdf, pdf_native, video, or audio 41 | getType = () => this.attributes.type 42 | 43 | // string # Preview size 44 | getSize = () => this.attributes.size 45 | } 46 | 47 | export default Preview 48 | 49 | module.exports = Preview 50 | module.exports.default = Preview 51 | -------------------------------------------------------------------------------- /src/models/Priority.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class Priority 11 | */ 12 | class Priority { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.path 30 | 31 | // string # The path corresponding to the priority color. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters. 32 | getPath = () => this.attributes.path 33 | 34 | // string # The priority color 35 | getColor = () => this.attributes.color 36 | 37 | // Parameters: 38 | // 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. 39 | // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 40 | // path (required) - string - The path to query for priorities 41 | static list = async (path, params = {}, options = {}) => { 42 | if (!isObject(params)) { 43 | throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`) 44 | } 45 | 46 | params.path = path 47 | 48 | if (!params.path) { 49 | throw new errors.MissingParameterError('Parameter missing: path') 50 | } 51 | 52 | if (params.cursor && !isString(params.cursor)) { 53 | throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`) 54 | } 55 | 56 | if (params.per_page && !isInt(params.per_page)) { 57 | throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`) 58 | } 59 | 60 | if (params.path && !isString(params.path)) { 61 | throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params.path)}`) 62 | } 63 | 64 | const response = await Api.sendRequest('/priorities', 'GET', params, options) 65 | 66 | return response?.data?.map(obj => new Priority(obj, options)) || [] 67 | } 68 | 69 | static all = (path, params = {}, options = {}) => 70 | Priority.list(path, params, options) 71 | } 72 | 73 | export default Priority 74 | 75 | module.exports = Priority 76 | module.exports.default = Priority 77 | -------------------------------------------------------------------------------- /src/models/PublicIpAddress.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class PublicIpAddress 11 | */ 12 | class PublicIpAddress { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // string # The public IP address. 32 | getIpAddress = () => this.attributes.ip_address 33 | 34 | // string # The name of the frontend server. 35 | getServerName = () => this.attributes.server_name 36 | 37 | // boolean 38 | getFtpEnabled = () => this.attributes.ftp_enabled 39 | 40 | // boolean 41 | getSftpEnabled = () => this.attributes.sftp_enabled 42 | } 43 | 44 | export default PublicIpAddress 45 | 46 | module.exports = PublicIpAddress 47 | module.exports.default = PublicIpAddress 48 | -------------------------------------------------------------------------------- /src/models/RemoteBandwidthSnapshot.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class RemoteBandwidthSnapshot 11 | */ 12 | class RemoteBandwidthSnapshot { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // int64 # Site bandwidth ID 32 | getId = () => this.attributes.id 33 | 34 | // double # Site sync bandwidth report bytes received 35 | getSyncBytesReceived = () => this.attributes.sync_bytes_received 36 | 37 | // double # Site sync bandwidth report bytes sent 38 | getSyncBytesSent = () => this.attributes.sync_bytes_sent 39 | 40 | // date-time # Time the site bandwidth report was logged 41 | getLoggedAt = () => this.attributes.logged_at 42 | 43 | // int64 # ID of related Remote Server 44 | getRemoteServerId = () => this.attributes.remote_server_id 45 | 46 | // Parameters: 47 | // 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. 48 | // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 49 | // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `logged_at`. 50 | // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `logged_at`. 51 | // filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `logged_at`. 52 | // filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `logged_at`. 53 | // filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `logged_at`. 54 | // filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `logged_at`. 55 | static list = async (params = {}, options = {}) => { 56 | if (params.cursor && !isString(params.cursor)) { 57 | throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`) 58 | } 59 | 60 | if (params.per_page && !isInt(params.per_page)) { 61 | throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`) 62 | } 63 | 64 | const response = await Api.sendRequest('/remote_bandwidth_snapshots', 'GET', params, options) 65 | 66 | return response?.data?.map(obj => new RemoteBandwidthSnapshot(obj, options)) || [] 67 | } 68 | 69 | static all = (params = {}, options = {}) => 70 | RemoteBandwidthSnapshot.list(params, options) 71 | } 72 | 73 | export default RemoteBandwidthSnapshot 74 | 75 | module.exports = RemoteBandwidthSnapshot 76 | module.exports.default = RemoteBandwidthSnapshot 77 | -------------------------------------------------------------------------------- /src/models/SettingsChange.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class SettingsChange 11 | */ 12 | class SettingsChange { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // int64 # The API key id responsible for this change. 32 | getApiKeyId = () => this.attributes.api_key_id 33 | 34 | // array(string) # Markdown-formatted change messages. 35 | getChanges = () => this.attributes.changes 36 | 37 | // date-time # The time this change was made. 38 | getCreatedAt = () => this.attributes.created_at 39 | 40 | // int64 # The user id responsible for this change. 41 | getUserId = () => this.attributes.user_id 42 | 43 | // boolean # true if this change was performed by Files.com support. 44 | getUserIsFilesSupport = () => this.attributes.user_is_files_support 45 | 46 | // boolean # true if this change was performed by a user on a parent site. 47 | getUserIsFromParentSite = () => this.attributes.user_is_from_parent_site 48 | 49 | // string # The username of the user responsible for this change. 50 | getUsername = () => this.attributes.username 51 | 52 | // Parameters: 53 | // 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. 54 | // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 55 | // sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`, `api_key_id` or `user_id`. 56 | // filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `api_key_id` and `user_id`. 57 | static list = async (params = {}, options = {}) => { 58 | if (params.cursor && !isString(params.cursor)) { 59 | throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`) 60 | } 61 | 62 | if (params.per_page && !isInt(params.per_page)) { 63 | throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`) 64 | } 65 | 66 | const response = await Api.sendRequest('/settings_changes', 'GET', params, options) 67 | 68 | return response?.data?.map(obj => new SettingsChange(obj, options)) || [] 69 | } 70 | 71 | static all = (params = {}, options = {}) => 72 | SettingsChange.list(params, options) 73 | } 74 | 75 | export default SettingsChange 76 | 77 | module.exports = SettingsChange 78 | module.exports.default = SettingsChange 79 | -------------------------------------------------------------------------------- /src/models/ShareGroupMember.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class ShareGroupMember 11 | */ 12 | class ShareGroupMember { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // string # Name of the share group member 32 | getName = () => this.attributes.name 33 | 34 | // string # Company of the share group member 35 | getCompany = () => this.attributes.company 36 | 37 | // string # Email of the share group member 38 | getEmail = () => this.attributes.email 39 | } 40 | 41 | export default ShareGroupMember 42 | 43 | module.exports = ShareGroupMember 44 | module.exports.default = ShareGroupMember 45 | -------------------------------------------------------------------------------- /src/models/Status.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class Status 11 | */ 12 | class Status { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // int64 # Status HTTP code 32 | getCode = () => this.attributes.code 33 | 34 | // string # Error message 35 | getMessage = () => this.attributes.message 36 | 37 | // string # Status message 38 | getStatus = () => this.attributes.status 39 | 40 | // Auto # Additional data 41 | getData = () => this.attributes.data 42 | 43 | // array(object) # A list of api errors 44 | getErrors = () => this.attributes.errors 45 | 46 | // int64 # Required Clickwrap id 47 | getClickwrapId = () => this.attributes.clickwrap_id 48 | 49 | // string # Required Clickwrap body 50 | getClickwrapBody = () => this.attributes.clickwrap_body 51 | } 52 | 53 | export default Status 54 | 55 | module.exports = Status 56 | module.exports.default = Status 57 | -------------------------------------------------------------------------------- /src/models/UsageByTopLevelDir.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class UsageByTopLevelDir 11 | */ 12 | class UsageByTopLevelDir { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // string # Directory name 32 | getDir = () => this.attributes.dir 33 | 34 | // int64 # Usage 35 | getSize = () => this.attributes.size 36 | 37 | // int64 # File count 38 | getCount = () => this.attributes.count 39 | } 40 | 41 | export default UsageByTopLevelDir 42 | 43 | module.exports = UsageByTopLevelDir 44 | module.exports.default = UsageByTopLevelDir 45 | -------------------------------------------------------------------------------- /src/models/UserCipherUse.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class UserCipherUse 11 | */ 12 | class UserCipherUse { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // int64 # UserCipherUse ID 32 | getId = () => this.attributes.id 33 | 34 | // string # The protocol and cipher employed 35 | getProtocolCipher = () => this.attributes.protocol_cipher 36 | 37 | // date-time # The earliest recorded use of this combination of interface and protocol and cipher (for this user) 38 | getCreatedAt = () => this.attributes.created_at 39 | 40 | // boolean # Is this cipher considered insecure? 41 | getInsecure = () => this.attributes.insecure 42 | 43 | // string # The interface accessed 44 | getInterface = () => this.attributes.interface 45 | 46 | // date-time # The most recent use of this combination of interface and protocol and cipher (for this user) 47 | getUpdatedAt = () => this.attributes.updated_at 48 | 49 | // int64 # ID of the user who performed this access 50 | getUserId = () => this.attributes.user_id 51 | 52 | // Parameters: 53 | // user_id - int64 - User ID. If provided, will return uses for this user. 54 | // 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. 55 | // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 56 | static list = async (params = {}, options = {}) => { 57 | if (params.user_id && !isInt(params.user_id)) { 58 | throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params.user_id)}`) 59 | } 60 | 61 | if (params.cursor && !isString(params.cursor)) { 62 | throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`) 63 | } 64 | 65 | if (params.per_page && !isInt(params.per_page)) { 66 | throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`) 67 | } 68 | 69 | const response = await Api.sendRequest('/user_cipher_uses', 'GET', params, options) 70 | 71 | return response?.data?.map(obj => new UserCipherUse(obj, options)) || [] 72 | } 73 | 74 | static all = (params = {}, options = {}) => 75 | UserCipherUse.list(params, options) 76 | } 77 | 78 | export default UserCipherUse 79 | 80 | module.exports = UserCipherUse 81 | module.exports.default = UserCipherUse 82 | -------------------------------------------------------------------------------- /src/models/UserSftpClientUse.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import Api from '../Api' 3 | import * as errors from '../Errors' 4 | import { 5 | getType, isArray, isInt, isObject, isString, 6 | } from '../utils' 7 | /* eslint-enable no-unused-vars */ 8 | 9 | /** 10 | * Class UserSftpClientUse 11 | */ 12 | class UserSftpClientUse { 13 | attributes = {} 14 | 15 | options = {} 16 | 17 | constructor(attributes = {}, options = {}) { 18 | Object.entries(attributes).forEach(([key, value]) => { 19 | const normalizedKey = key.replace('?', '') 20 | 21 | this.attributes[normalizedKey] = value 22 | 23 | Object.defineProperty(this, normalizedKey, { value, writable: false }) 24 | }) 25 | 26 | this.options = { ...options } 27 | } 28 | 29 | isLoaded = () => !!this.attributes.id 30 | 31 | // int64 # UserSftpClientUse ID 32 | getId = () => this.attributes.id 33 | 34 | // string # The SFTP client used 35 | getSftpClient = () => this.attributes.sftp_client 36 | 37 | // date-time # The earliest recorded use of this SFTP client (for this user) 38 | getCreatedAt = () => this.attributes.created_at 39 | 40 | // date-time # The most recent use of this SFTP client (for this user) 41 | getUpdatedAt = () => this.attributes.updated_at 42 | 43 | // int64 # ID of the user who performed this access 44 | getUserId = () => this.attributes.user_id 45 | 46 | // Parameters: 47 | // user_id - int64 - User ID. If provided, will return uses for this user. 48 | // 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. 49 | // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended). 50 | static list = async (params = {}, options = {}) => { 51 | if (params.user_id && !isInt(params.user_id)) { 52 | throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params.user_id)}`) 53 | } 54 | 55 | if (params.cursor && !isString(params.cursor)) { 56 | throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`) 57 | } 58 | 59 | if (params.per_page && !isInt(params.per_page)) { 60 | throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`) 61 | } 62 | 63 | const response = await Api.sendRequest('/user_sftp_client_uses', 'GET', params, options) 64 | 65 | return response?.data?.map(obj => new UserSftpClientUse(obj, options)) || [] 66 | } 67 | 68 | static all = (params = {}, options = {}) => 69 | UserSftpClientUse.list(params, options) 70 | } 71 | 72 | export default UserSftpClientUse 73 | 74 | module.exports = UserSftpClientUse 75 | module.exports.default = UserSftpClientUse 76 | -------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- 1 | import pathNormalizer from './utils/pathNormalizer' 2 | 3 | const isArray = value => Array.isArray(value) 4 | 5 | const isInt = value => typeof value === 'number' 6 | 7 | const isObject = value => value && typeof value === 'object' && !Array.isArray(value) 8 | 9 | const isString = value => typeof value === 'string' 10 | 11 | const isEmpty = value => !value 12 | || (isArray(value) && value.length === 0) 13 | || (isObject(value) && Object.keys(value).length === 0) 14 | 15 | const getType = value => 16 | (isArray(value) 17 | ? 'array' 18 | : typeof value) 19 | 20 | // eslint-disable-next-line no-restricted-globals 21 | const isBrowser = () => typeof self !== 'undefined' && typeof self.document !== 'undefined' 22 | 23 | export { 24 | getType, 25 | isArray, 26 | isBrowser, 27 | isEmpty, 28 | isInt, 29 | isObject, 30 | isString, 31 | pathNormalizer, 32 | } 33 | -------------------------------------------------------------------------------- /src/utils/pathNormalizer.test.js: -------------------------------------------------------------------------------- 1 | import pathNormalizer from './pathNormalizer' 2 | 3 | import normalizationForComparisonTestData from '../../shared/normalization_for_comparison_test_data.json' 4 | 5 | describe('pathNormalizer', () => { 6 | it('normalizes paths for comparison', () => { 7 | normalizationForComparisonTestData.forEach(([input, expected]) => { 8 | expect(pathNormalizer.same(input, expected)).toBe(true) 9 | 10 | const startOfExpected = expected.substring(0, 3) 11 | expect(pathNormalizer.startsWith(input, startOfExpected)).toBe(true) 12 | }) 13 | }) 14 | 15 | it('handles non-string params', () => { 16 | expect(pathNormalizer.normalize([])).toBe('') 17 | expect(pathNormalizer.normalize({})).toBe('') 18 | expect(pathNormalizer.normalize(null)).toBe('') 19 | expect(pathNormalizer.normalize(undefined)).toBe('') 20 | 21 | expect(pathNormalizer.same([], '')).toBe(false) 22 | expect(pathNormalizer.same(null, '')).toBe(false) 23 | expect(pathNormalizer.same([], null)).toBe(false) 24 | expect(pathNormalizer.same(undefined, undefined)).toBe(false) 25 | 26 | expect(pathNormalizer.startsWith(null, '')).toBe(false) 27 | expect(pathNormalizer.startsWith(null, [])).toBe(false) 28 | expect(pathNormalizer.startsWith([], null)).toBe(false) 29 | expect(pathNormalizer.startsWith(undefined, undefined)).toBe(false) 30 | 31 | expect(pathNormalizer.keyLookup(null, '')).toBe(undefined) 32 | expect(pathNormalizer.keyLookup(null, [])).toBe(undefined) 33 | expect(pathNormalizer.keyLookup([], null)).toBe(undefined) 34 | expect(pathNormalizer.keyLookup(undefined, undefined)).toBe(undefined) 35 | }) 36 | 37 | it('looks up keys in a map', () => { 38 | const map = { 39 | '': { list: true }, 40 | foo: { readonly: true }, 41 | 'foo/bar': { read: false, write: true }, 42 | } 43 | 44 | expect(pathNormalizer.keyLookup(map, 'foo/bar')).toEqual({ read: false, write: true }) 45 | expect(pathNormalizer.keyLookup(map, '/foo/bar')).toEqual({ read: false, write: true }) 46 | expect(pathNormalizer.keyLookup(map, '.')).toEqual({ list: true }) 47 | expect(pathNormalizer.keyLookup(map, './..')).toEqual({ list: true }) 48 | expect(pathNormalizer.keyLookup(map, '')).toEqual({ list: true }) 49 | expect(pathNormalizer.keyLookup(map, '/')).toEqual({ list: true }) 50 | expect(pathNormalizer.keyLookup(map, '/ ')).toEqual({ list: true }) 51 | expect(pathNormalizer.keyLookup(map, '// ')).toEqual({ list: true }) 52 | expect(pathNormalizer.keyLookup(map, '////')).toEqual({ list: true }) 53 | expect(pathNormalizer.keyLookup(map, '/foo')).toEqual({ readonly: true }) 54 | expect(pathNormalizer.keyLookup(map, '/////foo')).toEqual({ readonly: true }) 55 | expect(pathNormalizer.keyLookup(map, '/////foo/')).toEqual({ readonly: true }) 56 | }) 57 | }) 58 | -------------------------------------------------------------------------------- /test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | rm -f ~/.npmrc && rm -f ~/.yarnrc 4 | 5 | # Execute running tests from same directory as current script 6 | cd "$(dirname "$0")" 7 | 8 | # Install dependencies 9 | npm install 10 | npm run lint && \ 11 | npm run build && \ 12 | npm run test -------------------------------------------------------------------------------- /test/integration/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "@babel/preset-env", 5 | { 6 | "targets": { 7 | "ie": "11" 8 | } 9 | } 10 | ] 11 | ], 12 | "plugins": [ 13 | "@babel/plugin-proposal-class-properties", 14 | ["@babel/plugin-transform-modules-commonjs", { 15 | "loose": true 16 | }], 17 | "@babel/plugin-transform-runtime" 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /test/integration/index.js: -------------------------------------------------------------------------------- 1 | var testSuite = require('./lib/index.js').default 2 | testSuite() 3 | -------------------------------------------------------------------------------- /test/integration/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "files.com-test", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "author": "", 7 | "license": "ISC", 8 | "dependencies": { 9 | "@babel/runtime": "^7.10.3", 10 | "files.com": "file:../../", 11 | "readable-stream": "^3.6.0", 12 | "tiny-invariant": "^1.3.1" 13 | }, 14 | "devDependencies": { 15 | "@babel/cli": "^7.10.3", 16 | "@babel/core": "^7.10.3", 17 | "@babel/plugin-proposal-class-properties": "^7.10.1", 18 | "@babel/plugin-transform-modules-commonjs": "^7.10.1", 19 | "@babel/plugin-transform-runtime": "^7.10.3", 20 | "@babel/preset-env": "^7.10.3" 21 | }, 22 | "scripts": { 23 | "build": "./node_modules/.bin/babel src -d lib", 24 | "test": "node index.js" 25 | } 26 | } 27 | --------------------------------------------------------------------------------