files.com 1.2.313 → 1.2.314
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/ScimLog.md +40 -0
- package/lib/Files.js +1 -1
- package/lib/models/ScimLog.js +128 -0
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/ScimLog.js +80 -0
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.314
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# ScimLog
|
|
2
|
+
|
|
3
|
+
## Example ScimLog Object
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
{
|
|
7
|
+
"id": 1,
|
|
8
|
+
"created_at": "2023-01-01T12:00:00Z",
|
|
9
|
+
"request_path": "/api/scim/Users",
|
|
10
|
+
"request_method": "POST",
|
|
11
|
+
"http_response_code": "200",
|
|
12
|
+
"user_agent": "Okta",
|
|
13
|
+
"request_json": "example",
|
|
14
|
+
"response_json": "example"
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
* `id` (int64): The unique ID of this SCIM request.
|
|
19
|
+
* `created_at` (string): The date and time when this SCIM request occurred.
|
|
20
|
+
* `request_path` (string): The path portion of the URL requested.
|
|
21
|
+
* `request_method` (string): The HTTP method used for this request.
|
|
22
|
+
* `http_response_code` (string): The HTTP response code returned for this request.
|
|
23
|
+
* `user_agent` (string): The User-Agent header sent with the request.
|
|
24
|
+
* `request_json` (string): The JSON payload sent with the request.
|
|
25
|
+
* `response_json` (string): The JSON payload returned in the response.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## List Scim Logs
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
await ScimLog.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`.
|
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.314';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
|
@@ -0,0 +1,128 @@
|
|
|
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 _ScimLog;
|
|
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 ScimLog
|
|
24
|
+
*/
|
|
25
|
+
var ScimLog = /*#__PURE__*/(0, _createClass2.default)(function ScimLog() {
|
|
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, ScimLog);
|
|
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 # The unique ID of this SCIM request.
|
|
36
|
+
(0, _defineProperty2.default)(this, "getId", function () {
|
|
37
|
+
return _this.attributes.id;
|
|
38
|
+
});
|
|
39
|
+
// string # The date and time when this SCIM request occurred.
|
|
40
|
+
(0, _defineProperty2.default)(this, "getCreatedAt", function () {
|
|
41
|
+
return _this.attributes.created_at;
|
|
42
|
+
});
|
|
43
|
+
// string # The path portion of the URL requested.
|
|
44
|
+
(0, _defineProperty2.default)(this, "getRequestPath", function () {
|
|
45
|
+
return _this.attributes.request_path;
|
|
46
|
+
});
|
|
47
|
+
// string # The HTTP method used for this request.
|
|
48
|
+
(0, _defineProperty2.default)(this, "getRequestMethod", function () {
|
|
49
|
+
return _this.attributes.request_method;
|
|
50
|
+
});
|
|
51
|
+
// string # The HTTP response code returned for this request.
|
|
52
|
+
(0, _defineProperty2.default)(this, "getHttpResponseCode", function () {
|
|
53
|
+
return _this.attributes.http_response_code;
|
|
54
|
+
});
|
|
55
|
+
// string # The User-Agent header sent with the request.
|
|
56
|
+
(0, _defineProperty2.default)(this, "getUserAgent", function () {
|
|
57
|
+
return _this.attributes.user_agent;
|
|
58
|
+
});
|
|
59
|
+
// string # The JSON payload sent with the request.
|
|
60
|
+
(0, _defineProperty2.default)(this, "getRequestJson", function () {
|
|
61
|
+
return _this.attributes.request_json;
|
|
62
|
+
});
|
|
63
|
+
// string # The JSON payload returned in the response.
|
|
64
|
+
(0, _defineProperty2.default)(this, "getResponseJson", function () {
|
|
65
|
+
return _this.attributes.response_json;
|
|
66
|
+
});
|
|
67
|
+
Object.entries(attributes).forEach(function (_ref) {
|
|
68
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
69
|
+
key = _ref2[0],
|
|
70
|
+
value = _ref2[1];
|
|
71
|
+
var normalizedKey = key.replace('?', '');
|
|
72
|
+
_this.attributes[normalizedKey] = value;
|
|
73
|
+
Object.defineProperty(_this, normalizedKey, {
|
|
74
|
+
value: value,
|
|
75
|
+
writable: false
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
this.options = _objectSpread({}, options);
|
|
79
|
+
});
|
|
80
|
+
_ScimLog = ScimLog;
|
|
81
|
+
// Parameters:
|
|
82
|
+
// 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.
|
|
83
|
+
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
84
|
+
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
|
|
85
|
+
(0, _defineProperty2.default)(ScimLog, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
86
|
+
var _response$data;
|
|
87
|
+
var params,
|
|
88
|
+
options,
|
|
89
|
+
response,
|
|
90
|
+
_args = arguments;
|
|
91
|
+
return _regenerator.default.wrap(function (_context) {
|
|
92
|
+
while (1) switch (_context.prev = _context.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
95
|
+
options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
|
|
96
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
97
|
+
_context.next = 1;
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
101
|
+
case 1:
|
|
102
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
103
|
+
_context.next = 2;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
107
|
+
case 2:
|
|
108
|
+
_context.next = 3;
|
|
109
|
+
return _Api.default.sendRequest('/scim_logs', 'GET', params, options);
|
|
110
|
+
case 3:
|
|
111
|
+
response = _context.sent;
|
|
112
|
+
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) {
|
|
113
|
+
return new _ScimLog(obj, options);
|
|
114
|
+
})) || []);
|
|
115
|
+
case 4:
|
|
116
|
+
case "end":
|
|
117
|
+
return _context.stop();
|
|
118
|
+
}
|
|
119
|
+
}, _callee);
|
|
120
|
+
})));
|
|
121
|
+
(0, _defineProperty2.default)(ScimLog, "all", function () {
|
|
122
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
123
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
124
|
+
return _ScimLog.list(params, options);
|
|
125
|
+
});
|
|
126
|
+
var _default = exports.default = ScimLog;
|
|
127
|
+
module.exports = ScimLog;
|
|
128
|
+
module.exports.default = ScimLog;
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
|
@@ -0,0 +1,80 @@
|
|
|
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 ScimLog
|
|
11
|
+
*/
|
|
12
|
+
class ScimLog {
|
|
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 unique ID of this SCIM request.
|
|
32
|
+
getId = () => this.attributes.id
|
|
33
|
+
|
|
34
|
+
// string # The date and time when this SCIM request occurred.
|
|
35
|
+
getCreatedAt = () => this.attributes.created_at
|
|
36
|
+
|
|
37
|
+
// string # The path portion of the URL requested.
|
|
38
|
+
getRequestPath = () => this.attributes.request_path
|
|
39
|
+
|
|
40
|
+
// string # The HTTP method used for this request.
|
|
41
|
+
getRequestMethod = () => this.attributes.request_method
|
|
42
|
+
|
|
43
|
+
// string # The HTTP response code returned for this request.
|
|
44
|
+
getHttpResponseCode = () => this.attributes.http_response_code
|
|
45
|
+
|
|
46
|
+
// string # The User-Agent header sent with the request.
|
|
47
|
+
getUserAgent = () => this.attributes.user_agent
|
|
48
|
+
|
|
49
|
+
// string # The JSON payload sent with the request.
|
|
50
|
+
getRequestJson = () => this.attributes.request_json
|
|
51
|
+
|
|
52
|
+
// string # The JSON payload returned in the response.
|
|
53
|
+
getResponseJson = () => this.attributes.response_json
|
|
54
|
+
|
|
55
|
+
// Parameters:
|
|
56
|
+
// 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.
|
|
57
|
+
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
58
|
+
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `created_at`.
|
|
59
|
+
static list = async (params = {}, options = {}) => {
|
|
60
|
+
if (params.cursor && !isString(params.cursor)) {
|
|
61
|
+
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (params.per_page && !isInt(params.per_page)) {
|
|
65
|
+
throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const response = await Api.sendRequest('/scim_logs', 'GET', params, options)
|
|
69
|
+
|
|
70
|
+
return response?.data?.map(obj => new ScimLog(obj, options)) || []
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static all = (params = {}, options = {}) =>
|
|
74
|
+
ScimLog.list(params, options)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export default ScimLog
|
|
78
|
+
|
|
79
|
+
module.exports = ScimLog
|
|
80
|
+
module.exports.default = ScimLog
|