files.com 1.2.211 → 1.2.213

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.211
1
+ 1.2.213
@@ -94,6 +94,7 @@
94
94
  ```
95
95
  await Folder.listFor(path, {
96
96
  'search': "some-partial-filename",
97
+ 'search_custom_metadata_key': "some-metadata-key",
97
98
  'search_all': false,
98
99
  'with_previews': false,
99
100
  'with_priority_color': false,
@@ -109,6 +110,7 @@ await Folder.listFor(path, {
109
110
  * `preview_size` (string): Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
110
111
  * `sort_by` (object): Search by field and direction. Valid fields are `path`, `size`, `modified_at_datetime`, `provided_modified_at`. Valid directions are `asc` and `desc`. Defaults to `{"path":"asc"}`.
111
112
  * `search` (string): If specified, will search the folders/files list by name. Ignores text before last `/`. This is the same API used by the search bar in the web UI when running 'Search This Folder'. Search results are a best effort, not real time, and not guaranteed to perfectly match the latest folder listing. Results may be truncated if more than 1,000 possible matches exist. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
113
+ * `search_custom_metadata_key` (string): If provided, the search string in `search` will search for files where this custom metadata key matches the value sent in `search`. Set this to `*` to allow any metadata key to match the value sent in `search`.
112
114
  * `search_all` (boolean): Search entire site? If set, we will ignore the folder path provided and search the entire site. This is the same API used by the search bar in the web UI when running 'Search All Files'. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
113
115
  * `with_previews` (boolean): Include file previews?
114
116
  * `with_priority_color` (boolean): Include file priority color information?
@@ -40,7 +40,7 @@
40
40
  "provision_time_zone": "Eastern Time (US & Canada)",
41
41
  "provision_company": "ACME Corp.",
42
42
  "provision_require_2fa": "always_require",
43
- "identifier": "",
43
+ "provider_identifier": "",
44
44
  "ldap_base_dn": "example",
45
45
  "ldap_domain": "mysite.com",
46
46
  "enabled": true,
@@ -90,7 +90,7 @@
90
90
  * `provision_time_zone` (string): Default time zone for auto provisioned users.
91
91
  * `provision_company` (string): Default company for auto provisioned users.
92
92
  * `provision_require_2fa` (string): 2FA required setting for auto provisioned users.
93
- * `identifier` (string): URL-friendly, unique identifier for Azure SAML configuration
93
+ * `provider_identifier` (string): URL-friendly, unique identifier for Azure SAML configuration
94
94
  * `ldap_base_dn` (string): Base DN for looking up users in LDAP server
95
95
  * `ldap_domain` (string): Domain name that will be appended to LDAP usernames
96
96
  * `enabled` (boolean): Is strategy enabled? This may become automatically set to `false` after a high number and duration of failures.
package/lib/Files.js CHANGED
@@ -11,7 +11,7 @@ var endpointPrefix = '/api/rest/v1';
11
11
  var apiKey;
12
12
  var baseUrl = 'https://app.files.com';
13
13
  var sessionId = null;
14
- var version = '1.2.211';
14
+ var version = '1.2.213';
15
15
  var userAgent = "Files.com JavaScript SDK v".concat(version);
16
16
  var logLevel = _Logger.LogLevel.INFO;
17
17
  var debugRequest = false;
@@ -317,6 +317,7 @@ var Folder = /*#__PURE__*/(0, _createClass2.default)(function Folder() {
317
317
  // preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
318
318
  // sort_by - object - Search by field and direction. Valid fields are `path`, `size`, `modified_at_datetime`, `provided_modified_at`. Valid directions are `asc` and `desc`. Defaults to `{"path":"asc"}`.
319
319
  // search - string - If specified, will search the folders/files list by name. Ignores text before last `/`. This is the same API used by the search bar in the web UI when running 'Search This Folder'. Search results are a best effort, not real time, and not guaranteed to perfectly match the latest folder listing. Results may be truncated if more than 1,000 possible matches exist. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
320
+ // search_custom_metadata_key - string - If provided, the search string in `search` will search for files where this custom metadata key matches the value sent in `search`. Set this to `*` to allow any metadata key to match the value sent in `search`.
320
321
  // search_all - boolean - Search entire site? If set, we will ignore the folder path provided and search the entire site. This is the same API used by the search bar in the web UI when running 'Search All Files'. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
321
322
  // with_previews - boolean - Include file previews?
322
323
  // with_priority_color - boolean - Include file priority color information?
@@ -376,15 +377,21 @@ var Folder = /*#__PURE__*/(0, _createClass2.default)(function Folder() {
376
377
  }
377
378
  throw new errors.InvalidParameterError("Bad parameter: search must be of type String, received ".concat((0, _utils.getType)(params.search)));
378
379
  case 17:
379
- _context2.next = 19;
380
- return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params.path)), 'GET', params, options);
380
+ if (!(params.search_custom_metadata_key && !(0, _utils.isString)(params.search_custom_metadata_key))) {
381
+ _context2.next = 19;
382
+ break;
383
+ }
384
+ throw new errors.InvalidParameterError("Bad parameter: search_custom_metadata_key must be of type String, received ".concat((0, _utils.getType)(params.search_custom_metadata_key)));
381
385
  case 19:
386
+ _context2.next = 21;
387
+ return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params.path)), 'GET', params, options);
388
+ case 21:
382
389
  response = _context2.sent;
383
390
  File = require('./File.js').default;
384
391
  return _context2.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
385
392
  return new File(obj, options);
386
393
  })) || []);
387
- case 22:
394
+ case 24:
388
395
  case "end":
389
396
  return _context2.stop();
390
397
  }
@@ -178,8 +178,8 @@ var SsoStrategy = /*#__PURE__*/(0, _createClass2.default)(function SsoStrategy()
178
178
  return _this.attributes.provision_require_2fa;
179
179
  });
180
180
  // string # URL-friendly, unique identifier for Azure SAML configuration
181
- (0, _defineProperty2.default)(this, "getIdentifier", function () {
182
- return _this.attributes.identifier;
181
+ (0, _defineProperty2.default)(this, "getProviderIdentifier", function () {
182
+ return _this.attributes.provider_identifier;
183
183
  });
184
184
  // string # Base DN for looking up users in LDAP server
185
185
  (0, _defineProperty2.default)(this, "getLdapBaseDn", function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.211",
3
+ "version": "1.2.213",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Files.js CHANGED
@@ -5,7 +5,7 @@ const endpointPrefix = '/api/rest/v1'
5
5
  let apiKey
6
6
  let baseUrl = 'https://app.files.com'
7
7
  let sessionId = null
8
- const version = '1.2.211'
8
+ const version = '1.2.213'
9
9
  let userAgent = `Files.com JavaScript SDK v${version}`
10
10
 
11
11
  let logLevel = LogLevel.INFO
@@ -289,6 +289,7 @@ class Folder {
289
289
  // preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
290
290
  // sort_by - object - Search by field and direction. Valid fields are `path`, `size`, `modified_at_datetime`, `provided_modified_at`. Valid directions are `asc` and `desc`. Defaults to `{"path":"asc"}`.
291
291
  // search - string - If specified, will search the folders/files list by name. Ignores text before last `/`. This is the same API used by the search bar in the web UI when running 'Search This Folder'. Search results are a best effort, not real time, and not guaranteed to perfectly match the latest folder listing. Results may be truncated if more than 1,000 possible matches exist. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
292
+ // search_custom_metadata_key - string - If provided, the search string in `search` will search for files where this custom metadata key matches the value sent in `search`. Set this to `*` to allow any metadata key to match the value sent in `search`.
292
293
  // search_all - boolean - Search entire site? If set, we will ignore the folder path provided and search the entire site. This is the same API used by the search bar in the web UI when running 'Search All Files'. Search results are a best effort, not real time, and not guaranteed to match every file. This field should only be used for ad-hoc (human) searching, and not as part of an automated process.
293
294
  // with_previews - boolean - Include file previews?
294
295
  // with_priority_color - boolean - Include file priority color information?
@@ -323,6 +324,10 @@ class Folder {
323
324
  throw new errors.InvalidParameterError(`Bad parameter: search must be of type String, received ${getType(params.search)}`)
324
325
  }
325
326
 
327
+ if (params.search_custom_metadata_key && !isString(params.search_custom_metadata_key)) {
328
+ throw new errors.InvalidParameterError(`Bad parameter: search_custom_metadata_key must be of type String, received ${getType(params.search_custom_metadata_key)}`)
329
+ }
330
+
326
331
  const response = await Api.sendRequest(`/folders/${encodeURIComponent(params.path)}`, 'GET', params, options)
327
332
 
328
333
  const File = require('./File.js').default
@@ -137,7 +137,7 @@ class SsoStrategy {
137
137
  getProvisionRequire2fa = () => this.attributes.provision_require_2fa
138
138
 
139
139
  // string # URL-friendly, unique identifier for Azure SAML configuration
140
- getIdentifier = () => this.attributes.identifier
140
+ getProviderIdentifier = () => this.attributes.provider_identifier
141
141
 
142
142
  // string # Base DN for looking up users in LDAP server
143
143
  getLdapBaseDn = () => this.attributes.ldap_base_dn