files.com 1.0.267 → 1.0.269

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.0.267
1
+ 1.0.269
@@ -17,7 +17,7 @@
17
17
  ```
18
18
 
19
19
  * `id` (int64): Folder behavior ID
20
- * `path` (string): Folder path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
20
+ * `path` (string): Folder path. Note that Behavior paths cannot be updated once initially set. You will need to remove and re-create the behavior on the new path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
21
21
  * `attachment_url` (string): URL for attached file
22
22
  * `behavior` (string): Behavior type.
23
23
  * `name` (string): Name for this behavior.
@@ -70,7 +70,7 @@ await Folder.listFor(path, {
70
70
  * `cursor` (string): Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
71
71
  * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
72
72
  * `path` (string): Required - Path to operate on.
73
- * `filter` (string): If specified, will filter folders/files list by this string. Wildcards of `*` and `?` are acceptable here.
73
+ * `filter` (string): If specified, will filter folders/files list by name. Ignores text before last `/`. Wildcards of `*` and `?` are acceptable here.
74
74
  * `preview_size` (string): Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
75
75
  * `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"}`.
76
76
  * `search` (string): If `search_all` is `true`, provide the search string here. Otherwise, this parameter acts like an alias of `filter`.
@@ -1,5 +1,22 @@
1
1
  # Snapshot
2
2
 
3
+ ## Example Snapshot Object
4
+
5
+ ```
6
+ {
7
+ "expires_at": "2000-01-01T01:00:00Z",
8
+ "finalized_at": "2000-01-01T01:00:00Z",
9
+ "name": "My Snapshot",
10
+ "user_id": 1,
11
+ "bundle_id": 1
12
+ }
13
+ ```
14
+
15
+ * `expires_at` (date-time): When the snapshot expires.
16
+ * `finalized_at` (date-time): When the snapshot was finalized.
17
+ * `name` (string): A name for the snapshot.
18
+ * `user_id` (int64): The user that created this snapshot, if applicable.
19
+ * `bundle_id` (int64): The bundle using this snapshot, if applicable.
3
20
  * `id` (int64): Snapshot ID.
4
21
 
5
22
  ---
@@ -54,6 +71,17 @@ await snapshot.update()
54
71
 
55
72
  * `id` (int64): Required - Snapshot ID.
56
73
 
74
+ ### Example Response
75
+
76
+ ```json
77
+ {
78
+ "expires_at": "2000-01-01T01:00:00Z",
79
+ "finalized_at": "2000-01-01T01:00:00Z",
80
+ "name": "My Snapshot",
81
+ "user_id": 1,
82
+ "bundle_id": 1
83
+ }
84
+ ```
57
85
 
58
86
  ---
59
87
 
@@ -38,7 +38,7 @@ var Behavior = /*#__PURE__*/(0, _createClass2.default)(function Behavior() {
38
38
  (0, _defineProperty2.default)(this, "setId", function (value) {
39
39
  _this.attributes.id = value;
40
40
  });
41
- // string # Folder path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
41
+ // string # Folder path. Note that Behavior paths cannot be updated once initially set. You will need to remove and re-create the behavior on the new path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
42
42
  (0, _defineProperty2.default)(this, "getPath", function () {
43
43
  return _this.attributes.path;
44
44
  });
@@ -184,7 +184,7 @@ var Folder = /*#__PURE__*/(0, _createClass2.default)(function Folder() {
184
184
  // cursor - string - Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
185
185
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
186
186
  // path (required) - string - Path to operate on.
187
- // filter - string - If specified, will filter folders/files list by this string. Wildcards of `*` and `?` are acceptable here.
187
+ // filter - string - If specified, will filter folders/files list by name. Ignores text before last `/`. Wildcards of `*` and `?` are acceptable here.
188
188
  // preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
189
189
  // 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"}`.
190
190
  // search - string - If `search_all` is `true`, provide the search string here. Otherwise, this parameter acts like an alias of `filter`.
@@ -31,6 +31,41 @@ var Snapshot = /*#__PURE__*/(0, _createClass2.default)(function Snapshot() {
31
31
  (0, _defineProperty2.default)(this, "isLoaded", function () {
32
32
  return !!_this.attributes.id;
33
33
  });
34
+ // date-time # When the snapshot expires.
35
+ (0, _defineProperty2.default)(this, "getExpiresAt", function () {
36
+ return _this.attributes.expires_at;
37
+ });
38
+ (0, _defineProperty2.default)(this, "setExpiresAt", function (value) {
39
+ _this.attributes.expires_at = value;
40
+ });
41
+ // date-time # When the snapshot was finalized.
42
+ (0, _defineProperty2.default)(this, "getFinalizedAt", function () {
43
+ return _this.attributes.finalized_at;
44
+ });
45
+ (0, _defineProperty2.default)(this, "setFinalizedAt", function (value) {
46
+ _this.attributes.finalized_at = value;
47
+ });
48
+ // string # A name for the snapshot.
49
+ (0, _defineProperty2.default)(this, "getName", function () {
50
+ return _this.attributes.name;
51
+ });
52
+ (0, _defineProperty2.default)(this, "setName", function (value) {
53
+ _this.attributes.name = value;
54
+ });
55
+ // int64 # The user that created this snapshot, if applicable.
56
+ (0, _defineProperty2.default)(this, "getUserId", function () {
57
+ return _this.attributes.user_id;
58
+ });
59
+ (0, _defineProperty2.default)(this, "setUserId", function (value) {
60
+ _this.attributes.user_id = value;
61
+ });
62
+ // int64 # The bundle using this snapshot, if applicable.
63
+ (0, _defineProperty2.default)(this, "getBundleId", function () {
64
+ return _this.attributes.bundle_id;
65
+ });
66
+ (0, _defineProperty2.default)(this, "setBundleId", function (value) {
67
+ _this.attributes.bundle_id = value;
68
+ });
34
69
  // int64 # Snapshot ID.
35
70
  (0, _defineProperty2.default)(this, "getId", function () {
36
71
  return _this.attributes.id;
@@ -83,7 +118,7 @@ var Snapshot = /*#__PURE__*/(0, _createClass2.default)(function Snapshot() {
83
118
  return _Api.default.sendRequest("/snapshots/".concat(encodeURIComponent(params['id'])), 'PATCH', params, _this.options);
84
119
  case 16:
85
120
  response = _context.sent;
86
- return _context.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
121
+ return _context.abrupt("return", new Snapshot(response === null || response === void 0 ? void 0 : response.data, _this.options));
87
122
  case 18:
88
123
  case "end":
89
124
  return _context.stop();
@@ -172,6 +207,7 @@ var Snapshot = /*#__PURE__*/(0, _createClass2.default)(function Snapshot() {
172
207
  // 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.
173
208
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
174
209
  (0, _defineProperty2.default)(Snapshot, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
210
+ var _response$data;
175
211
  var params,
176
212
  options,
177
213
  response,
@@ -197,7 +233,9 @@ var Snapshot = /*#__PURE__*/(0, _createClass2.default)(function Snapshot() {
197
233
  return _Api.default.sendRequest("/snapshots", 'GET', params, options);
198
234
  case 8:
199
235
  response = _context3.sent;
200
- return _context3.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
236
+ return _context3.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
237
+ return new Snapshot(obj, options);
238
+ })) || []);
201
239
  case 10:
202
240
  case "end":
203
241
  return _context3.stop();
@@ -245,7 +283,7 @@ var Snapshot = /*#__PURE__*/(0, _createClass2.default)(function Snapshot() {
245
283
  return _Api.default.sendRequest("/snapshots/".concat(encodeURIComponent(params['id'])), 'GET', params, options);
246
284
  case 11:
247
285
  response = _context4.sent;
248
- return _context4.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
286
+ return _context4.abrupt("return", new Snapshot(response === null || response === void 0 ? void 0 : response.data, options));
249
287
  case 13:
250
288
  case "end":
251
289
  return _context4.stop();
@@ -273,7 +311,7 @@ var Snapshot = /*#__PURE__*/(0, _createClass2.default)(function Snapshot() {
273
311
  return _Api.default.sendRequest("/snapshots", 'POST', {}, options);
274
312
  case 3:
275
313
  response = _context5.sent;
276
- return _context5.abrupt("return", response === null || response === void 0 ? void 0 : response.data);
314
+ return _context5.abrupt("return", new Snapshot(response === null || response === void 0 ? void 0 : response.data, options));
277
315
  case 5:
278
316
  case "end":
279
317
  return _context5.stop();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.267",
3
+ "version": "1.0.269",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -30,7 +30,7 @@ class Behavior {
30
30
  this.attributes.id = value
31
31
  }
32
32
 
33
- // string # Folder path This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
33
+ // string # Folder path. Note that Behavior paths cannot be updated once initially set. You will need to remove and re-create the behavior on the new path. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
34
34
  getPath = () => this.attributes.path
35
35
 
36
36
  setPath = value => {
@@ -164,7 +164,7 @@ class Folder {
164
164
  // cursor - string - Send cursor to resume an existing list from the point at which you left off. Get a cursor from an existing list via the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
165
165
  // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
166
166
  // path (required) - string - Path to operate on.
167
- // filter - string - If specified, will filter folders/files list by this string. Wildcards of `*` and `?` are acceptable here.
167
+ // filter - string - If specified, will filter folders/files list by name. Ignores text before last `/`. Wildcards of `*` and `?` are acceptable here.
168
168
  // preview_size - string - Request a preview size. Can be `small` (default), `large`, `xlarge`, or `pdf`.
169
169
  // 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"}`.
170
170
  // search - string - If `search_all` is `true`, provide the search string here. Otherwise, this parameter acts like an alias of `filter`.
@@ -23,6 +23,41 @@ class Snapshot {
23
23
  }
24
24
 
25
25
  isLoaded = () => !!this.attributes.id
26
+ // date-time # When the snapshot expires.
27
+ getExpiresAt = () => this.attributes.expires_at
28
+
29
+ setExpiresAt = value => {
30
+ this.attributes.expires_at = value
31
+ }
32
+
33
+ // date-time # When the snapshot was finalized.
34
+ getFinalizedAt = () => this.attributes.finalized_at
35
+
36
+ setFinalizedAt = value => {
37
+ this.attributes.finalized_at = value
38
+ }
39
+
40
+ // string # A name for the snapshot.
41
+ getName = () => this.attributes.name
42
+
43
+ setName = value => {
44
+ this.attributes.name = value
45
+ }
46
+
47
+ // int64 # The user that created this snapshot, if applicable.
48
+ getUserId = () => this.attributes.user_id
49
+
50
+ setUserId = value => {
51
+ this.attributes.user_id = value
52
+ }
53
+
54
+ // int64 # The bundle using this snapshot, if applicable.
55
+ getBundleId = () => this.attributes.bundle_id
56
+
57
+ setBundleId = value => {
58
+ this.attributes.bundle_id = value
59
+ }
60
+
26
61
  // int64 # Snapshot ID.
27
62
  getId = () => this.attributes.id
28
63
 
@@ -55,7 +90,7 @@ class Snapshot {
55
90
 
56
91
  const response = await Api.sendRequest(`/snapshots/${encodeURIComponent(params['id'])}`, 'PATCH', params, this.options)
57
92
 
58
- return response?.data
93
+ return new Snapshot(response?.data, this.options)
59
94
  }
60
95
 
61
96
  delete = async (params = {}) => {
@@ -112,7 +147,7 @@ class Snapshot {
112
147
 
113
148
  const response = await Api.sendRequest(`/snapshots`, 'GET', params, options)
114
149
 
115
- return response?.data
150
+ return response?.data?.map(obj => new Snapshot(obj, options)) || []
116
151
  }
117
152
 
118
153
  static all = (params = {}, options = {}) =>
@@ -137,7 +172,7 @@ class Snapshot {
137
172
 
138
173
  const response = await Api.sendRequest(`/snapshots/${encodeURIComponent(params['id'])}`, 'GET', params, options)
139
174
 
140
- return response?.data
175
+ return new Snapshot(response?.data, options)
141
176
  }
142
177
 
143
178
  static get = (id, params = {}, options = {}) =>
@@ -146,7 +181,7 @@ class Snapshot {
146
181
  static create = async (options = {}) => {
147
182
  const response = await Api.sendRequest(`/snapshots`, 'POST', {}, options)
148
183
 
149
- return response?.data
184
+ return new Snapshot(response?.data, options)
150
185
  }
151
186
  }
152
187