files.com 1.2.511 → 1.2.513
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/Bundle.md +1 -1
- package/docs/models/PartnerSite.md +29 -0
- package/lib/Files.js +1 -1
- package/lib/models/Bundle.js +1 -1
- package/lib/models/PartnerSite.js +107 -0
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/Bundle.js +1 -1
- package/src/models/PartnerSite.js +64 -0
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.513
|
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,
|
|
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 ]`.
|
|
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`.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# PartnerSite
|
|
2
|
+
|
|
3
|
+
## Example PartnerSite Object
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
{
|
|
7
|
+
"partner_id": 1,
|
|
8
|
+
"partner_name": "Acme Corp",
|
|
9
|
+
"linked_site_id": 1
|
|
10
|
+
}
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
* `partner_id` (int64): Partner ID
|
|
14
|
+
* `partner_name` (string): Partner Name
|
|
15
|
+
* `linked_site_id` (int64): Linked Site ID
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## List Partner Sites
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
await PartnerSite.list
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Parameters
|
|
27
|
+
|
|
28
|
+
* `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.
|
|
29
|
+
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
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.513';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
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,
|
|
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 ]`.
|
|
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`.
|
|
@@ -0,0 +1,107 @@
|
|
|
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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
8
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
var _Api = _interopRequireDefault(require("../Api"));
|
|
14
|
+
var errors = _interopRequireWildcard(require("../Errors"));
|
|
15
|
+
var _utils = require("../utils");
|
|
16
|
+
var _PartnerSite;
|
|
17
|
+
/* eslint-disable no-unused-vars */
|
|
18
|
+
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); }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
/* eslint-enable no-unused-vars */
|
|
22
|
+
/**
|
|
23
|
+
* Class PartnerSite
|
|
24
|
+
*/
|
|
25
|
+
var PartnerSite = /*#__PURE__*/(0, _createClass2.default)(function PartnerSite() {
|
|
26
|
+
var _this = this;
|
|
27
|
+
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
28
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
29
|
+
(0, _classCallCheck2.default)(this, PartnerSite);
|
|
30
|
+
(0, _defineProperty2.default)(this, "attributes", {});
|
|
31
|
+
(0, _defineProperty2.default)(this, "options", {});
|
|
32
|
+
(0, _defineProperty2.default)(this, "isLoaded", function () {
|
|
33
|
+
return !!_this.attributes.id;
|
|
34
|
+
});
|
|
35
|
+
// int64 # Partner ID
|
|
36
|
+
(0, _defineProperty2.default)(this, "getPartnerId", function () {
|
|
37
|
+
return _this.attributes.partner_id;
|
|
38
|
+
});
|
|
39
|
+
// string # Partner Name
|
|
40
|
+
(0, _defineProperty2.default)(this, "getPartnerName", function () {
|
|
41
|
+
return _this.attributes.partner_name;
|
|
42
|
+
});
|
|
43
|
+
// int64 # Linked Site ID
|
|
44
|
+
(0, _defineProperty2.default)(this, "getLinkedSiteId", function () {
|
|
45
|
+
return _this.attributes.linked_site_id;
|
|
46
|
+
});
|
|
47
|
+
Object.entries(attributes).forEach(function (_ref) {
|
|
48
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
49
|
+
key = _ref2[0],
|
|
50
|
+
value = _ref2[1];
|
|
51
|
+
var normalizedKey = key.replace('?', '');
|
|
52
|
+
_this.attributes[normalizedKey] = value;
|
|
53
|
+
Object.defineProperty(_this, normalizedKey, {
|
|
54
|
+
value: value,
|
|
55
|
+
writable: false
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
this.options = _objectSpread({}, options);
|
|
59
|
+
});
|
|
60
|
+
_PartnerSite = PartnerSite;
|
|
61
|
+
// Parameters:
|
|
62
|
+
// 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.
|
|
63
|
+
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
64
|
+
(0, _defineProperty2.default)(PartnerSite, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
65
|
+
var _response$data;
|
|
66
|
+
var params,
|
|
67
|
+
options,
|
|
68
|
+
response,
|
|
69
|
+
_args = arguments;
|
|
70
|
+
return _regenerator.default.wrap(function (_context) {
|
|
71
|
+
while (1) switch (_context.prev = _context.next) {
|
|
72
|
+
case 0:
|
|
73
|
+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
74
|
+
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
75
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
76
|
+
_context.next = 1;
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
80
|
+
case 1:
|
|
81
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
82
|
+
_context.next = 2;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
86
|
+
case 2:
|
|
87
|
+
_context.next = 3;
|
|
88
|
+
return _Api.default.sendRequest('/partner_sites', 'GET', params, options);
|
|
89
|
+
case 3:
|
|
90
|
+
response = _context.sent;
|
|
91
|
+
return _context.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
|
92
|
+
return new _PartnerSite(obj, options);
|
|
93
|
+
})) || []);
|
|
94
|
+
case 4:
|
|
95
|
+
case "end":
|
|
96
|
+
return _context.stop();
|
|
97
|
+
}
|
|
98
|
+
}, _callee);
|
|
99
|
+
})));
|
|
100
|
+
(0, _defineProperty2.default)(PartnerSite, "all", function () {
|
|
101
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
102
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
103
|
+
return _PartnerSite.list(params, options);
|
|
104
|
+
});
|
|
105
|
+
var _default = exports.default = PartnerSite;
|
|
106
|
+
module.exports = PartnerSite;
|
|
107
|
+
module.exports.default = PartnerSite;
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
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,
|
|
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 ]`.
|
|
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`.
|
|
@@ -0,0 +1,64 @@
|
|
|
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 PartnerSite
|
|
11
|
+
*/
|
|
12
|
+
class PartnerSite {
|
|
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 # Partner ID
|
|
32
|
+
getPartnerId = () => this.attributes.partner_id
|
|
33
|
+
|
|
34
|
+
// string # Partner Name
|
|
35
|
+
getPartnerName = () => this.attributes.partner_name
|
|
36
|
+
|
|
37
|
+
// int64 # Linked Site ID
|
|
38
|
+
getLinkedSiteId = () => this.attributes.linked_site_id
|
|
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
|
+
static list = async (params = {}, options = {}) => {
|
|
44
|
+
if (params.cursor && !isString(params.cursor)) {
|
|
45
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (params.per_page && !isInt(params.per_page)) {
|
|
49
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const response = await Api.sendRequest('/partner_sites', 'GET', params, options)
|
|
53
|
+
|
|
54
|
+
return response?.data?.map(obj => new PartnerSite(obj, options)) || []
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static all = (params = {}, options = {}) =>
|
|
58
|
+
PartnerSite.list(params, options)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default PartnerSite
|
|
62
|
+
|
|
63
|
+
module.exports = PartnerSite
|
|
64
|
+
module.exports.default = PartnerSite
|