files.com 1.2.546 → 1.2.548
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_VERSION +1 -1
- package/docs/models/AccountLineItem.md +2 -2
- package/docs/models/Bundle.md +1 -1
- package/docs/models/Invoice.md +2 -2
- package/docs/models/InvoiceLineItem.md +1 -1
- package/docs/models/Payment.md +2 -2
- package/docs/models/PaymentLineItem.md +1 -1
- package/docs/models/RemoteMountBackend.md +2 -2
- package/docs/models/Site.md +1 -1
- package/lib/Files.js +1 -1
- package/lib/models/AccountLineItem.js +2 -2
- package/lib/models/Bundle.js +1 -1
- package/lib/models/Invoice.js +2 -2
- package/lib/models/InvoiceLineItem.js +1 -1
- package/lib/models/Payment.js +2 -2
- package/lib/models/PaymentLineItem.js +1 -1
- package/lib/models/RemoteMountBackend.js +2 -2
- package/lib/models/Site.js +1 -1
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/AccountLineItem.js +2 -2
- package/src/models/Bundle.js +1 -1
- package/src/models/Invoice.js +2 -2
- package/src/models/InvoiceLineItem.js +1 -1
- package/src/models/Payment.js +2 -2
- package/src/models/PaymentLineItem.js +1 -1
- package/src/models/RemoteMountBackend.js +2 -2
- package/src/models/Site.js +1 -1
- package/test/DecimalContract.test.js +21 -0
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.548
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
* `id` (int64): Line item Id
|
|
47
|
-
* `amount` (
|
|
48
|
-
* `balance` (
|
|
47
|
+
* `amount` (decimal): Line item amount
|
|
48
|
+
* `balance` (decimal): Line item balance
|
|
49
49
|
* `created_at` (date-time): Line item created at
|
|
50
50
|
* `currency` (string): Line item currency
|
|
51
51
|
* `download_uri` (string): Line item download uri
|
package/docs/models/Bundle.md
CHANGED
|
@@ -154,7 +154,7 @@ await Bundle.list({
|
|
|
154
154
|
* `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.
|
|
155
155
|
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
156
156
|
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `expires_at`.
|
|
157
|
-
* `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id, expires_at ]`.
|
|
157
|
+
* `filter` (object): If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id, created_at ]` and `[ user_id, expires_at ]`.
|
|
158
158
|
* `filter_gt` (object): If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at` and `expires_at`.
|
|
159
159
|
* `filter_gteq` (object): If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at` and `expires_at`.
|
|
160
160
|
* `filter_prefix` (object): If set, return records where the specified field is prefixed by the supplied value. Valid fields are `code`.
|
package/docs/models/Invoice.md
CHANGED
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
* `id` (int64): Line item Id
|
|
47
|
-
* `amount` (
|
|
48
|
-
* `balance` (
|
|
47
|
+
* `amount` (decimal): Line item amount
|
|
48
|
+
* `balance` (decimal): Line item balance
|
|
49
49
|
* `created_at` (date-time): Line item created at
|
|
50
50
|
* `currency` (string): Line item currency
|
|
51
51
|
* `download_uri` (string): Line item download uri
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
* `id` (int64): Invoice Line item Id
|
|
24
|
-
* `amount` (
|
|
24
|
+
* `amount` (decimal): Invoice line item amount
|
|
25
25
|
* `created_at` (date-time): Invoice line item created at date/time
|
|
26
26
|
* `description` (string): Invoice line item description
|
|
27
27
|
* `type` (string): Invoice line item type
|
package/docs/models/Payment.md
CHANGED
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
* `id` (int64): Line item Id
|
|
47
|
-
* `amount` (
|
|
48
|
-
* `balance` (
|
|
47
|
+
* `amount` (decimal): Line item amount
|
|
48
|
+
* `balance` (decimal): Line item balance
|
|
49
49
|
* `created_at` (date-time): Line item created at
|
|
50
50
|
* `currency` (string): Line item currency
|
|
51
51
|
* `download_uri` (string): Line item download uri
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
* `health_check_type` (string): Type of health check to perform.
|
|
44
44
|
* `id` (int64): Unique identifier for this backend.
|
|
45
45
|
* `interval` (int64): Interval in seconds between health checks.
|
|
46
|
-
* `min_free_cpu` (
|
|
47
|
-
* `min_free_mem` (
|
|
46
|
+
* `min_free_cpu` (decimal): Minimum free CPU percentage required for this backend to be considered healthy.
|
|
47
|
+
* `min_free_mem` (decimal): Minimum free memory percentage required for this backend to be considered healthy.
|
|
48
48
|
* `priority` (int64): Priority of this backend.
|
|
49
49
|
* `remote_path` (string): Path on the remote server to treat as the root of this mount.
|
|
50
50
|
* `remote_server_id` (int64): The remote server that this backend is associated with.
|
package/docs/models/Site.md
CHANGED
|
@@ -418,7 +418,7 @@
|
|
|
418
418
|
* `motd_text` (string): A message to show users when they connect via FTP or SFTP.
|
|
419
419
|
* `motd_use_for_ftp` (boolean): Show message to users connecting via FTP
|
|
420
420
|
* `motd_use_for_sftp` (boolean): Show message to users connecting via SFTP
|
|
421
|
-
* `next_billing_amount` (
|
|
421
|
+
* `next_billing_amount` (decimal): Next billing amount
|
|
422
422
|
* `next_billing_date` (string): Next billing date
|
|
423
423
|
* `office_integration_available` (boolean): If true, allows users to use a document editing integration.
|
|
424
424
|
* `office_integration_type` (string): Which document editing integration to support. Files.com Editor or Microsoft Office for the Web.
|
package/lib/Files.js
CHANGED
|
@@ -12,7 +12,7 @@ var apiKey;
|
|
|
12
12
|
var baseUrl = 'https://app.files.com';
|
|
13
13
|
var sessionId = null;
|
|
14
14
|
var language = null;
|
|
15
|
-
var version = '1.2.
|
|
15
|
+
var version = '1.2.548';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
|
@@ -32,11 +32,11 @@ var AccountLineItem = /*#__PURE__*/(0, _createClass2.default)(function AccountLi
|
|
|
32
32
|
(0, _defineProperty2.default)(this, "getId", function () {
|
|
33
33
|
return _this.attributes.id;
|
|
34
34
|
});
|
|
35
|
-
//
|
|
35
|
+
// decimal # Line item amount
|
|
36
36
|
(0, _defineProperty2.default)(this, "getAmount", function () {
|
|
37
37
|
return _this.attributes.amount;
|
|
38
38
|
});
|
|
39
|
-
//
|
|
39
|
+
// decimal # Line item balance
|
|
40
40
|
(0, _defineProperty2.default)(this, "getBalance", function () {
|
|
41
41
|
return _this.attributes.balance;
|
|
42
42
|
});
|
package/lib/models/Bundle.js
CHANGED
|
@@ -699,7 +699,7 @@ _Bundle = Bundle;
|
|
|
699
699
|
// 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.
|
|
700
700
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
701
701
|
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `expires_at`.
|
|
702
|
-
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id, expires_at ]`.
|
|
702
|
+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id, created_at ]` and `[ user_id, expires_at ]`.
|
|
703
703
|
// filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at` and `expires_at`.
|
|
704
704
|
// filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at` and `expires_at`.
|
|
705
705
|
// filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `code`.
|
package/lib/models/Invoice.js
CHANGED
|
@@ -36,11 +36,11 @@ var Invoice = /*#__PURE__*/(0, _createClass2.default)(function Invoice() {
|
|
|
36
36
|
(0, _defineProperty2.default)(this, "getId", function () {
|
|
37
37
|
return _this.attributes.id;
|
|
38
38
|
});
|
|
39
|
-
//
|
|
39
|
+
// decimal # Line item amount
|
|
40
40
|
(0, _defineProperty2.default)(this, "getAmount", function () {
|
|
41
41
|
return _this.attributes.amount;
|
|
42
42
|
});
|
|
43
|
-
//
|
|
43
|
+
// decimal # Line item balance
|
|
44
44
|
(0, _defineProperty2.default)(this, "getBalance", function () {
|
|
45
45
|
return _this.attributes.balance;
|
|
46
46
|
});
|
|
@@ -32,7 +32,7 @@ var InvoiceLineItem = /*#__PURE__*/(0, _createClass2.default)(function InvoiceLi
|
|
|
32
32
|
(0, _defineProperty2.default)(this, "getId", function () {
|
|
33
33
|
return _this.attributes.id;
|
|
34
34
|
});
|
|
35
|
-
//
|
|
35
|
+
// decimal # Invoice line item amount
|
|
36
36
|
(0, _defineProperty2.default)(this, "getAmount", function () {
|
|
37
37
|
return _this.attributes.amount;
|
|
38
38
|
});
|
package/lib/models/Payment.js
CHANGED
|
@@ -36,11 +36,11 @@ var Payment = /*#__PURE__*/(0, _createClass2.default)(function Payment() {
|
|
|
36
36
|
(0, _defineProperty2.default)(this, "getId", function () {
|
|
37
37
|
return _this.attributes.id;
|
|
38
38
|
});
|
|
39
|
-
//
|
|
39
|
+
// decimal # Line item amount
|
|
40
40
|
(0, _defineProperty2.default)(this, "getAmount", function () {
|
|
41
41
|
return _this.attributes.amount;
|
|
42
42
|
});
|
|
43
|
-
//
|
|
43
|
+
// decimal # Line item balance
|
|
44
44
|
(0, _defineProperty2.default)(this, "getBalance", function () {
|
|
45
45
|
return _this.attributes.balance;
|
|
46
46
|
});
|
|
@@ -28,7 +28,7 @@ var PaymentLineItem = /*#__PURE__*/(0, _createClass2.default)(function PaymentLi
|
|
|
28
28
|
(0, _defineProperty2.default)(this, "isLoaded", function () {
|
|
29
29
|
return !!_this.attributes.id;
|
|
30
30
|
});
|
|
31
|
-
//
|
|
31
|
+
// decimal # Payment line item amount
|
|
32
32
|
(0, _defineProperty2.default)(this, "getAmount", function () {
|
|
33
33
|
return _this.attributes.amount;
|
|
34
34
|
});
|
|
@@ -88,14 +88,14 @@ var RemoteMountBackend = /*#__PURE__*/(0, _createClass2.default)(function Remote
|
|
|
88
88
|
(0, _defineProperty2.default)(this, "setInterval", function (value) {
|
|
89
89
|
_this.attributes.interval = value;
|
|
90
90
|
});
|
|
91
|
-
//
|
|
91
|
+
// decimal # Minimum free CPU percentage required for this backend to be considered healthy.
|
|
92
92
|
(0, _defineProperty2.default)(this, "getMinFreeCpu", function () {
|
|
93
93
|
return _this.attributes.min_free_cpu;
|
|
94
94
|
});
|
|
95
95
|
(0, _defineProperty2.default)(this, "setMinFreeCpu", function (value) {
|
|
96
96
|
_this.attributes.min_free_cpu = value;
|
|
97
97
|
});
|
|
98
|
-
//
|
|
98
|
+
// decimal # Minimum free memory percentage required for this backend to be considered healthy.
|
|
99
99
|
(0, _defineProperty2.default)(this, "getMinFreeMem", function () {
|
|
100
100
|
return _this.attributes.min_free_mem;
|
|
101
101
|
});
|
package/lib/models/Site.js
CHANGED
|
@@ -448,7 +448,7 @@ var Site = /*#__PURE__*/(0, _createClass2.default)(function Site() {
|
|
|
448
448
|
(0, _defineProperty2.default)(this, "getMotdUseForSftp", function () {
|
|
449
449
|
return _this.attributes.motd_use_for_sftp;
|
|
450
450
|
});
|
|
451
|
-
//
|
|
451
|
+
// decimal # Next billing amount
|
|
452
452
|
(0, _defineProperty2.default)(this, "getNextBillingAmount", function () {
|
|
453
453
|
return _this.attributes.next_billing_amount;
|
|
454
454
|
});
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
|
@@ -31,10 +31,10 @@ class AccountLineItem {
|
|
|
31
31
|
// int64 # Line item Id
|
|
32
32
|
getId = () => this.attributes.id
|
|
33
33
|
|
|
34
|
-
//
|
|
34
|
+
// decimal # Line item amount
|
|
35
35
|
getAmount = () => this.attributes.amount
|
|
36
36
|
|
|
37
|
-
//
|
|
37
|
+
// decimal # Line item balance
|
|
38
38
|
getBalance = () => this.attributes.balance
|
|
39
39
|
|
|
40
40
|
// date-time # Line item created at
|
package/src/models/Bundle.js
CHANGED
|
@@ -556,7 +556,7 @@ class Bundle {
|
|
|
556
556
|
// 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.
|
|
557
557
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
558
558
|
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `expires_at`.
|
|
559
|
-
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id, expires_at ]`.
|
|
559
|
+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id, created_at ]` and `[ user_id, expires_at ]`.
|
|
560
560
|
// filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at` and `expires_at`.
|
|
561
561
|
// filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at` and `expires_at`.
|
|
562
562
|
// filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `code`.
|
package/src/models/Invoice.js
CHANGED
|
@@ -31,10 +31,10 @@ class Invoice {
|
|
|
31
31
|
// int64 # Line item Id
|
|
32
32
|
getId = () => this.attributes.id
|
|
33
33
|
|
|
34
|
-
//
|
|
34
|
+
// decimal # Line item amount
|
|
35
35
|
getAmount = () => this.attributes.amount
|
|
36
36
|
|
|
37
|
-
//
|
|
37
|
+
// decimal # Line item balance
|
|
38
38
|
getBalance = () => this.attributes.balance
|
|
39
39
|
|
|
40
40
|
// date-time # Line item created at
|
|
@@ -31,7 +31,7 @@ class InvoiceLineItem {
|
|
|
31
31
|
// int64 # Invoice Line item Id
|
|
32
32
|
getId = () => this.attributes.id
|
|
33
33
|
|
|
34
|
-
//
|
|
34
|
+
// decimal # Invoice line item amount
|
|
35
35
|
getAmount = () => this.attributes.amount
|
|
36
36
|
|
|
37
37
|
// date-time # Invoice line item created at date/time
|
package/src/models/Payment.js
CHANGED
|
@@ -31,10 +31,10 @@ class Payment {
|
|
|
31
31
|
// int64 # Line item Id
|
|
32
32
|
getId = () => this.attributes.id
|
|
33
33
|
|
|
34
|
-
//
|
|
34
|
+
// decimal # Line item amount
|
|
35
35
|
getAmount = () => this.attributes.amount
|
|
36
36
|
|
|
37
|
-
//
|
|
37
|
+
// decimal # Line item balance
|
|
38
38
|
getBalance = () => this.attributes.balance
|
|
39
39
|
|
|
40
40
|
// date-time # Line item created at
|
|
@@ -84,14 +84,14 @@ class RemoteMountBackend {
|
|
|
84
84
|
this.attributes.interval = value
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
//
|
|
87
|
+
// decimal # Minimum free CPU percentage required for this backend to be considered healthy.
|
|
88
88
|
getMinFreeCpu = () => this.attributes.min_free_cpu
|
|
89
89
|
|
|
90
90
|
setMinFreeCpu = value => {
|
|
91
91
|
this.attributes.min_free_cpu = value
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
//
|
|
94
|
+
// decimal # Minimum free memory percentage required for this backend to be considered healthy.
|
|
95
95
|
getMinFreeMem = () => this.attributes.min_free_mem
|
|
96
96
|
|
|
97
97
|
setMinFreeMem = value => {
|
package/src/models/Site.js
CHANGED
|
@@ -340,7 +340,7 @@ class Site {
|
|
|
340
340
|
// boolean # Show message to users connecting via SFTP
|
|
341
341
|
getMotdUseForSftp = () => this.attributes.motd_use_for_sftp
|
|
342
342
|
|
|
343
|
-
//
|
|
343
|
+
// decimal # Next billing amount
|
|
344
344
|
getNextBillingAmount = () => this.attributes.next_billing_amount
|
|
345
345
|
|
|
346
346
|
// string # Next billing date
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import nock from 'nock'
|
|
2
|
+
|
|
3
|
+
import Api from '../lib/Api'
|
|
4
|
+
import Files from '../lib/Files'
|
|
5
|
+
|
|
6
|
+
const API_URL = 'http://example.test'
|
|
7
|
+
Files.setBaseUrl(API_URL)
|
|
8
|
+
Files.setApiKey('test-key')
|
|
9
|
+
|
|
10
|
+
describe('Decimal contract', () => {
|
|
11
|
+
it('serializes decimal strings and double numbers in JSON bodies', async () => {
|
|
12
|
+
nock(API_URL)
|
|
13
|
+
.post('/api/rest/v1/api_keys', body => {
|
|
14
|
+
// Decimals should be passed as strings, doubles as numbers.
|
|
15
|
+
return typeof body.amount === 'string' && typeof body.ratio === 'number'
|
|
16
|
+
})
|
|
17
|
+
.reply(200, { id: 1 })
|
|
18
|
+
|
|
19
|
+
await Api.sendRequest('/api_keys', 'POST', { amount: '1.23', ratio: 1.23 })
|
|
20
|
+
})
|
|
21
|
+
})
|