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 CHANGED
@@ -1 +1 @@
1
- 1.2.546
1
+ 1.2.548
@@ -44,8 +44,8 @@
44
44
  ```
45
45
 
46
46
  * `id` (int64): Line item Id
47
- * `amount` (double): Line item amount
48
- * `balance` (double): Line item 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
@@ -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`.
@@ -44,8 +44,8 @@
44
44
  ```
45
45
 
46
46
  * `id` (int64): Line item Id
47
- * `amount` (double): Line item amount
48
- * `balance` (double): Line item 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` (double): Invoice line item 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
@@ -44,8 +44,8 @@
44
44
  ```
45
45
 
46
46
  * `id` (int64): Line item Id
47
- * `amount` (double): Line item amount
48
- * `balance` (double): Line item 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
@@ -11,7 +11,7 @@
11
11
  }
12
12
  ```
13
13
 
14
- * `amount` (double): Payment line item amount
14
+ * `amount` (decimal): Payment line item amount
15
15
  * `created_at` (date-time): Payment line item created at date/time
16
16
  * `invoice_id` (int64): Invoice ID
17
17
  * `payment_id` (int64): Payment ID
@@ -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` (double): Minimum free CPU percentage required for this backend to be considered healthy.
47
- * `min_free_mem` (double): Minimum free memory percentage required for this backend to be considered healthy.
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.
@@ -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` (double): 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.546';
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
- // double # Line item amount
35
+ // decimal # Line item amount
36
36
  (0, _defineProperty2.default)(this, "getAmount", function () {
37
37
  return _this.attributes.amount;
38
38
  });
39
- // double # Line item balance
39
+ // decimal # Line item balance
40
40
  (0, _defineProperty2.default)(this, "getBalance", function () {
41
41
  return _this.attributes.balance;
42
42
  });
@@ -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`.
@@ -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
- // double # Line item amount
39
+ // decimal # Line item amount
40
40
  (0, _defineProperty2.default)(this, "getAmount", function () {
41
41
  return _this.attributes.amount;
42
42
  });
43
- // double # Line item balance
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
- // double # Invoice line item amount
35
+ // decimal # Invoice line item amount
36
36
  (0, _defineProperty2.default)(this, "getAmount", function () {
37
37
  return _this.attributes.amount;
38
38
  });
@@ -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
- // double # Line item amount
39
+ // decimal # Line item amount
40
40
  (0, _defineProperty2.default)(this, "getAmount", function () {
41
41
  return _this.attributes.amount;
42
42
  });
43
- // double # Line item balance
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
- // double # Payment line item amount
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
- // double # Minimum free CPU percentage required for this backend to be considered healthy.
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
- // double # Minimum free memory percentage required for this backend to be considered healthy.
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
  });
@@ -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
- // double # Next billing amount
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.546",
3
+ "version": "1.2.548",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Files.js CHANGED
@@ -6,7 +6,7 @@ let apiKey
6
6
  let baseUrl = 'https://app.files.com'
7
7
  let sessionId = null
8
8
  let language = null
9
- const version = '1.2.546'
9
+ const version = '1.2.548'
10
10
  let userAgent = `Files.com JavaScript SDK v${version}`
11
11
 
12
12
  let logLevel = LogLevel.INFO
@@ -31,10 +31,10 @@ class AccountLineItem {
31
31
  // int64 # Line item Id
32
32
  getId = () => this.attributes.id
33
33
 
34
- // double # Line item amount
34
+ // decimal # Line item amount
35
35
  getAmount = () => this.attributes.amount
36
36
 
37
- // double # Line item balance
37
+ // decimal # Line item balance
38
38
  getBalance = () => this.attributes.balance
39
39
 
40
40
  // date-time # Line item created at
@@ -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`.
@@ -31,10 +31,10 @@ class Invoice {
31
31
  // int64 # Line item Id
32
32
  getId = () => this.attributes.id
33
33
 
34
- // double # Line item amount
34
+ // decimal # Line item amount
35
35
  getAmount = () => this.attributes.amount
36
36
 
37
- // double # Line item balance
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
- // double # Invoice line item amount
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
@@ -31,10 +31,10 @@ class Payment {
31
31
  // int64 # Line item Id
32
32
  getId = () => this.attributes.id
33
33
 
34
- // double # Line item amount
34
+ // decimal # Line item amount
35
35
  getAmount = () => this.attributes.amount
36
36
 
37
- // double # Line item balance
37
+ // decimal # Line item balance
38
38
  getBalance = () => this.attributes.balance
39
39
 
40
40
  // date-time # Line item created at
@@ -28,7 +28,7 @@ class PaymentLineItem {
28
28
 
29
29
  isLoaded = () => !!this.attributes.id
30
30
 
31
- // double # Payment line item amount
31
+ // decimal # Payment line item amount
32
32
  getAmount = () => this.attributes.amount
33
33
 
34
34
  // date-time # Payment line item created at date/time
@@ -84,14 +84,14 @@ class RemoteMountBackend {
84
84
  this.attributes.interval = value
85
85
  }
86
86
 
87
- // double # Minimum free CPU percentage required for this backend to be considered healthy.
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
- // double # Minimum free memory percentage required for this backend to be considered healthy.
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 => {
@@ -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
- // double # Next billing amount
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
+ })