files.com 1.2.243 → 1.2.244
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/BundleNotification.md +7 -1
- package/docs/models/BundleRecipient.md +5 -0
- package/lib/Files.js +1 -1
- package/lib/models/BundleNotification.js +35 -14
- package/lib/models/BundleRecipient.js +43 -22
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/BundleNotification.js +17 -0
- package/src/models/BundleRecipient.js +17 -0
package/_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.2.
|
|
1
|
+
1.2.244
|
|
@@ -17,18 +17,22 @@
|
|
|
17
17
|
* `notify_on_registration` (boolean): Triggers bundle notification when a registration action occurs for it.
|
|
18
18
|
* `notify_on_upload` (boolean): Triggers bundle notification when a upload action occurs for it.
|
|
19
19
|
* `notify_user_id` (int64): The id of the user to notify.
|
|
20
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
|
20
21
|
|
|
21
22
|
---
|
|
22
23
|
|
|
23
24
|
## List Bundle Notifications
|
|
24
25
|
|
|
25
26
|
```
|
|
26
|
-
await BundleNotification.list
|
|
27
|
+
await BundleNotification.list({
|
|
28
|
+
'user_id': 1,
|
|
29
|
+
})
|
|
27
30
|
```
|
|
28
31
|
|
|
29
32
|
|
|
30
33
|
### Parameters
|
|
31
34
|
|
|
35
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
|
32
36
|
* `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.
|
|
33
37
|
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
34
38
|
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id`.
|
|
@@ -53,6 +57,7 @@ await BundleNotification.find(id)
|
|
|
53
57
|
|
|
54
58
|
```
|
|
55
59
|
await BundleNotification.create({
|
|
60
|
+
'user_id': 1,
|
|
56
61
|
'bundle_id': 1,
|
|
57
62
|
'notify_user_id': 1,
|
|
58
63
|
'notify_on_registration': true,
|
|
@@ -63,6 +68,7 @@ await BundleNotification.create({
|
|
|
63
68
|
|
|
64
69
|
### Parameters
|
|
65
70
|
|
|
71
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
|
66
72
|
* `bundle_id` (int64): Required - Bundle ID to notify on
|
|
67
73
|
* `notify_user_id` (int64): The id of the user to notify.
|
|
68
74
|
* `notify_on_registration` (boolean): Triggers bundle notification when a registration action occurs for it.
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* `note` (string): A note sent to the recipient with the bundle.
|
|
18
18
|
* `recipient` (string): The recipient's email address.
|
|
19
19
|
* `sent_at` (date-time): When the Bundle was shared with this recipient.
|
|
20
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
|
20
21
|
* `bundle_id` (int64): Bundle to share.
|
|
21
22
|
* `share_after_create` (boolean): Set to true to share the link with the recipient upon creation.
|
|
22
23
|
|
|
@@ -26,6 +27,7 @@
|
|
|
26
27
|
|
|
27
28
|
```
|
|
28
29
|
await BundleRecipient.list({
|
|
30
|
+
'user_id': 1,
|
|
29
31
|
'bundle_id': 1,
|
|
30
32
|
})
|
|
31
33
|
```
|
|
@@ -33,6 +35,7 @@ await BundleRecipient.list({
|
|
|
33
35
|
|
|
34
36
|
### Parameters
|
|
35
37
|
|
|
38
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
|
36
39
|
* `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.
|
|
37
40
|
* `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
38
41
|
* `sort_by` (object): If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
|
|
@@ -45,6 +48,7 @@ await BundleRecipient.list({
|
|
|
45
48
|
|
|
46
49
|
```
|
|
47
50
|
await BundleRecipient.create({
|
|
51
|
+
'user_id': 1,
|
|
48
52
|
'bundle_id': 1,
|
|
49
53
|
'recipient': "johndoe@gmail.com",
|
|
50
54
|
'name': "John Smith",
|
|
@@ -57,6 +61,7 @@ await BundleRecipient.create({
|
|
|
57
61
|
|
|
58
62
|
### Parameters
|
|
59
63
|
|
|
64
|
+
* `user_id` (int64): User ID. Provide a value of `0` to operate the current session's user.
|
|
60
65
|
* `bundle_id` (int64): Required - Bundle to share.
|
|
61
66
|
* `recipient` (string): Required - Email addresses to share this bundle with.
|
|
62
67
|
* `name` (string): Name of recipient.
|
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.244';
|
|
16
16
|
var userAgent = "Files.com JavaScript SDK v".concat(version);
|
|
17
17
|
var logLevel = _Logger.LogLevel.INFO;
|
|
18
18
|
var debugRequest = false;
|
|
@@ -67,6 +67,13 @@ var BundleNotification = /*#__PURE__*/(0, _createClass2.default)(function Bundle
|
|
|
67
67
|
(0, _defineProperty2.default)(this, "setNotifyUserId", function (value) {
|
|
68
68
|
_this.attributes.notify_user_id = value;
|
|
69
69
|
});
|
|
70
|
+
// int64 # User ID. Provide a value of `0` to operate the current session's user.
|
|
71
|
+
(0, _defineProperty2.default)(this, "getUserId", function () {
|
|
72
|
+
return _this.attributes.user_id;
|
|
73
|
+
});
|
|
74
|
+
(0, _defineProperty2.default)(this, "setUserId", function (value) {
|
|
75
|
+
_this.attributes.user_id = value;
|
|
76
|
+
});
|
|
70
77
|
// Parameters:
|
|
71
78
|
// notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
|
|
72
79
|
// notify_on_upload - boolean - Triggers bundle notification when a upload action occurs for it.
|
|
@@ -217,6 +224,7 @@ var BundleNotification = /*#__PURE__*/(0, _createClass2.default)(function Bundle
|
|
|
217
224
|
});
|
|
218
225
|
_BundleNotification = BundleNotification;
|
|
219
226
|
// Parameters:
|
|
227
|
+
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
220
228
|
// 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.
|
|
221
229
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
222
230
|
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id`.
|
|
@@ -232,26 +240,32 @@ _BundleNotification = BundleNotification;
|
|
|
232
240
|
case 0:
|
|
233
241
|
params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {};
|
|
234
242
|
options = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {};
|
|
235
|
-
if (!(params.
|
|
243
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
236
244
|
_context4.next = 4;
|
|
237
245
|
break;
|
|
238
246
|
}
|
|
239
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
247
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
240
248
|
case 4:
|
|
241
|
-
if (!(params.
|
|
249
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
242
250
|
_context4.next = 6;
|
|
243
251
|
break;
|
|
244
252
|
}
|
|
245
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
253
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
246
254
|
case 6:
|
|
247
|
-
|
|
248
|
-
|
|
255
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
256
|
+
_context4.next = 8;
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
249
260
|
case 8:
|
|
261
|
+
_context4.next = 10;
|
|
262
|
+
return _Api.default.sendRequest('/bundle_notifications', 'GET', params, options);
|
|
263
|
+
case 10:
|
|
250
264
|
response = _context4.sent;
|
|
251
265
|
return _context4.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
|
|
252
266
|
return new _BundleNotification(obj, options);
|
|
253
267
|
})) || []);
|
|
254
|
-
case
|
|
268
|
+
case 12:
|
|
255
269
|
case "end":
|
|
256
270
|
return _context4.stop();
|
|
257
271
|
}
|
|
@@ -315,6 +329,7 @@ _BundleNotification = BundleNotification;
|
|
|
315
329
|
return _BundleNotification.find(id, params, options);
|
|
316
330
|
});
|
|
317
331
|
// Parameters:
|
|
332
|
+
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
318
333
|
// bundle_id (required) - int64 - Bundle ID to notify on
|
|
319
334
|
// notify_user_id - int64 - The id of the user to notify.
|
|
320
335
|
// notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
|
|
@@ -335,24 +350,30 @@ _BundleNotification = BundleNotification;
|
|
|
335
350
|
}
|
|
336
351
|
throw new errors.MissingParameterError('Parameter missing: bundle_id');
|
|
337
352
|
case 4:
|
|
338
|
-
if (!(params.
|
|
353
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
339
354
|
_context6.next = 6;
|
|
340
355
|
break;
|
|
341
356
|
}
|
|
342
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
357
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
343
358
|
case 6:
|
|
344
|
-
if (!(params.
|
|
359
|
+
if (!(params.bundle_id && !(0, _utils.isInt)(params.bundle_id))) {
|
|
345
360
|
_context6.next = 8;
|
|
346
361
|
break;
|
|
347
362
|
}
|
|
348
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
363
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_id must be of type Int, received ".concat((0, _utils.getType)(params.bundle_id)));
|
|
349
364
|
case 8:
|
|
350
|
-
|
|
351
|
-
|
|
365
|
+
if (!(params.notify_user_id && !(0, _utils.isInt)(params.notify_user_id))) {
|
|
366
|
+
_context6.next = 10;
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
throw new errors.InvalidParameterError("Bad parameter: notify_user_id must be of type Int, received ".concat((0, _utils.getType)(params.notify_user_id)));
|
|
352
370
|
case 10:
|
|
371
|
+
_context6.next = 12;
|
|
372
|
+
return _Api.default.sendRequest('/bundle_notifications', 'POST', params, options);
|
|
373
|
+
case 12:
|
|
353
374
|
response = _context6.sent;
|
|
354
375
|
return _context6.abrupt("return", new _BundleNotification(response === null || response === void 0 ? void 0 : response.data, options));
|
|
355
|
-
case
|
|
376
|
+
case 14:
|
|
356
377
|
case "end":
|
|
357
378
|
return _context6.stop();
|
|
358
379
|
}
|
|
@@ -67,6 +67,13 @@ var BundleRecipient = /*#__PURE__*/(0, _createClass2.default)(function BundleRec
|
|
|
67
67
|
(0, _defineProperty2.default)(this, "setSentAt", function (value) {
|
|
68
68
|
_this.attributes.sent_at = value;
|
|
69
69
|
});
|
|
70
|
+
// int64 # User ID. Provide a value of `0` to operate the current session's user.
|
|
71
|
+
(0, _defineProperty2.default)(this, "getUserId", function () {
|
|
72
|
+
return _this.attributes.user_id;
|
|
73
|
+
});
|
|
74
|
+
(0, _defineProperty2.default)(this, "setUserId", function (value) {
|
|
75
|
+
_this.attributes.user_id = value;
|
|
76
|
+
});
|
|
70
77
|
// int64 # Bundle to share.
|
|
71
78
|
(0, _defineProperty2.default)(this, "getBundleId", function () {
|
|
72
79
|
return _this.attributes.bundle_id;
|
|
@@ -119,6 +126,7 @@ var BundleRecipient = /*#__PURE__*/(0, _createClass2.default)(function BundleRec
|
|
|
119
126
|
});
|
|
120
127
|
_BundleRecipient = BundleRecipient;
|
|
121
128
|
// Parameters:
|
|
129
|
+
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
122
130
|
// 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.
|
|
123
131
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
124
132
|
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
|
|
@@ -141,32 +149,38 @@ _BundleRecipient = BundleRecipient;
|
|
|
141
149
|
}
|
|
142
150
|
throw new errors.MissingParameterError('Parameter missing: bundle_id');
|
|
143
151
|
case 4:
|
|
144
|
-
if (!(params.
|
|
152
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
145
153
|
_context2.next = 6;
|
|
146
154
|
break;
|
|
147
155
|
}
|
|
148
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
156
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
149
157
|
case 6:
|
|
150
|
-
if (!(params.
|
|
158
|
+
if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
|
|
151
159
|
_context2.next = 8;
|
|
152
160
|
break;
|
|
153
161
|
}
|
|
154
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
162
|
+
throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
|
|
155
163
|
case 8:
|
|
156
|
-
if (!(params.
|
|
164
|
+
if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
|
|
157
165
|
_context2.next = 10;
|
|
158
166
|
break;
|
|
159
167
|
}
|
|
160
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
168
|
+
throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
|
|
161
169
|
case 10:
|
|
162
|
-
|
|
163
|
-
|
|
170
|
+
if (!(params.bundle_id && !(0, _utils.isInt)(params.bundle_id))) {
|
|
171
|
+
_context2.next = 12;
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_id must be of type Int, received ".concat((0, _utils.getType)(params.bundle_id)));
|
|
164
175
|
case 12:
|
|
176
|
+
_context2.next = 14;
|
|
177
|
+
return _Api.default.sendRequest('/bundle_recipients', 'GET', params, options);
|
|
178
|
+
case 14:
|
|
165
179
|
response = _context2.sent;
|
|
166
180
|
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) {
|
|
167
181
|
return new _BundleRecipient(obj, options);
|
|
168
182
|
})) || []);
|
|
169
|
-
case
|
|
183
|
+
case 16:
|
|
170
184
|
case "end":
|
|
171
185
|
return _context2.stop();
|
|
172
186
|
}
|
|
@@ -178,6 +192,7 @@ _BundleRecipient = BundleRecipient;
|
|
|
178
192
|
return _BundleRecipient.list(params, options);
|
|
179
193
|
});
|
|
180
194
|
// Parameters:
|
|
195
|
+
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
181
196
|
// bundle_id (required) - int64 - Bundle to share.
|
|
182
197
|
// recipient (required) - string - Email addresses to share this bundle with.
|
|
183
198
|
// name - string - Name of recipient.
|
|
@@ -206,42 +221,48 @@ _BundleRecipient = BundleRecipient;
|
|
|
206
221
|
}
|
|
207
222
|
throw new errors.MissingParameterError('Parameter missing: recipient');
|
|
208
223
|
case 6:
|
|
209
|
-
if (!(params.
|
|
224
|
+
if (!(params.user_id && !(0, _utils.isInt)(params.user_id))) {
|
|
210
225
|
_context3.next = 8;
|
|
211
226
|
break;
|
|
212
227
|
}
|
|
213
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
228
|
+
throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params.user_id)));
|
|
214
229
|
case 8:
|
|
215
|
-
if (!(params.
|
|
230
|
+
if (!(params.bundle_id && !(0, _utils.isInt)(params.bundle_id))) {
|
|
216
231
|
_context3.next = 10;
|
|
217
232
|
break;
|
|
218
233
|
}
|
|
219
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
234
|
+
throw new errors.InvalidParameterError("Bad parameter: bundle_id must be of type Int, received ".concat((0, _utils.getType)(params.bundle_id)));
|
|
220
235
|
case 10:
|
|
221
|
-
if (!(params.
|
|
236
|
+
if (!(params.recipient && !(0, _utils.isString)(params.recipient))) {
|
|
222
237
|
_context3.next = 12;
|
|
223
238
|
break;
|
|
224
239
|
}
|
|
225
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
240
|
+
throw new errors.InvalidParameterError("Bad parameter: recipient must be of type String, received ".concat((0, _utils.getType)(params.recipient)));
|
|
226
241
|
case 12:
|
|
227
|
-
if (!(params.
|
|
242
|
+
if (!(params.name && !(0, _utils.isString)(params.name))) {
|
|
228
243
|
_context3.next = 14;
|
|
229
244
|
break;
|
|
230
245
|
}
|
|
231
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
246
|
+
throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params.name)));
|
|
232
247
|
case 14:
|
|
233
|
-
if (!(params.
|
|
248
|
+
if (!(params.company && !(0, _utils.isString)(params.company))) {
|
|
234
249
|
_context3.next = 16;
|
|
235
250
|
break;
|
|
236
251
|
}
|
|
237
|
-
throw new errors.InvalidParameterError("Bad parameter:
|
|
252
|
+
throw new errors.InvalidParameterError("Bad parameter: company must be of type String, received ".concat((0, _utils.getType)(params.company)));
|
|
238
253
|
case 16:
|
|
239
|
-
|
|
240
|
-
|
|
254
|
+
if (!(params.note && !(0, _utils.isString)(params.note))) {
|
|
255
|
+
_context3.next = 18;
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
throw new errors.InvalidParameterError("Bad parameter: note must be of type String, received ".concat((0, _utils.getType)(params.note)));
|
|
241
259
|
case 18:
|
|
260
|
+
_context3.next = 20;
|
|
261
|
+
return _Api.default.sendRequest('/bundle_recipients', 'POST', params, options);
|
|
262
|
+
case 20:
|
|
242
263
|
response = _context3.sent;
|
|
243
264
|
return _context3.abrupt("return", new _BundleRecipient(response === null || response === void 0 ? void 0 : response.data, options));
|
|
244
|
-
case
|
|
265
|
+
case 22:
|
|
245
266
|
case "end":
|
|
246
267
|
return _context3.stop();
|
|
247
268
|
}
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
|
@@ -63,6 +63,13 @@ class BundleNotification {
|
|
|
63
63
|
this.attributes.notify_user_id = value
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
// int64 # User ID. Provide a value of `0` to operate the current session's user.
|
|
67
|
+
getUserId = () => this.attributes.user_id
|
|
68
|
+
|
|
69
|
+
setUserId = value => {
|
|
70
|
+
this.attributes.user_id = value
|
|
71
|
+
}
|
|
72
|
+
|
|
66
73
|
// Parameters:
|
|
67
74
|
// notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
|
|
68
75
|
// notify_on_upload - boolean - Triggers bundle notification when a upload action occurs for it.
|
|
@@ -134,11 +141,16 @@ class BundleNotification {
|
|
|
134
141
|
}
|
|
135
142
|
|
|
136
143
|
// Parameters:
|
|
144
|
+
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
137
145
|
// 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.
|
|
138
146
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
139
147
|
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `bundle_id`.
|
|
140
148
|
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `bundle_id`.
|
|
141
149
|
static list = async (params = {}, options = {}) => {
|
|
150
|
+
if (params.user_id && !isInt(params.user_id)) {
|
|
151
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params.user_id)}`)
|
|
152
|
+
}
|
|
153
|
+
|
|
142
154
|
if (params.cursor && !isString(params.cursor)) {
|
|
143
155
|
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|
|
144
156
|
}
|
|
@@ -181,6 +193,7 @@ class BundleNotification {
|
|
|
181
193
|
BundleNotification.find(id, params, options)
|
|
182
194
|
|
|
183
195
|
// Parameters:
|
|
196
|
+
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
184
197
|
// bundle_id (required) - int64 - Bundle ID to notify on
|
|
185
198
|
// notify_user_id - int64 - The id of the user to notify.
|
|
186
199
|
// notify_on_registration - boolean - Triggers bundle notification when a registration action occurs for it.
|
|
@@ -190,6 +203,10 @@ class BundleNotification {
|
|
|
190
203
|
throw new errors.MissingParameterError('Parameter missing: bundle_id')
|
|
191
204
|
}
|
|
192
205
|
|
|
206
|
+
if (params.user_id && !isInt(params.user_id)) {
|
|
207
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params.user_id)}`)
|
|
208
|
+
}
|
|
209
|
+
|
|
193
210
|
if (params.bundle_id && !isInt(params.bundle_id)) {
|
|
194
211
|
throw new errors.InvalidParameterError(`Bad parameter: bundle_id must be of type Int, received ${getType(params.bundle_id)}`)
|
|
195
212
|
}
|
|
@@ -63,6 +63,13 @@ class BundleRecipient {
|
|
|
63
63
|
this.attributes.sent_at = value
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
// int64 # User ID. Provide a value of `0` to operate the current session's user.
|
|
67
|
+
getUserId = () => this.attributes.user_id
|
|
68
|
+
|
|
69
|
+
setUserId = value => {
|
|
70
|
+
this.attributes.user_id = value
|
|
71
|
+
}
|
|
72
|
+
|
|
66
73
|
// int64 # Bundle to share.
|
|
67
74
|
getBundleId = () => this.attributes.bundle_id
|
|
68
75
|
|
|
@@ -88,6 +95,7 @@ class BundleRecipient {
|
|
|
88
95
|
}
|
|
89
96
|
|
|
90
97
|
// Parameters:
|
|
98
|
+
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
91
99
|
// 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.
|
|
92
100
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
93
101
|
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are .
|
|
@@ -98,6 +106,10 @@ class BundleRecipient {
|
|
|
98
106
|
throw new errors.MissingParameterError('Parameter missing: bundle_id')
|
|
99
107
|
}
|
|
100
108
|
|
|
109
|
+
if (params.user_id && !isInt(params.user_id)) {
|
|
110
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params.user_id)}`)
|
|
111
|
+
}
|
|
112
|
+
|
|
101
113
|
if (params.cursor && !isString(params.cursor)) {
|
|
102
114
|
throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
|
|
103
115
|
}
|
|
@@ -119,6 +131,7 @@ class BundleRecipient {
|
|
|
119
131
|
BundleRecipient.list(params, options)
|
|
120
132
|
|
|
121
133
|
// Parameters:
|
|
134
|
+
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
|
|
122
135
|
// bundle_id (required) - int64 - Bundle to share.
|
|
123
136
|
// recipient (required) - string - Email addresses to share this bundle with.
|
|
124
137
|
// name - string - Name of recipient.
|
|
@@ -134,6 +147,10 @@ class BundleRecipient {
|
|
|
134
147
|
throw new errors.MissingParameterError('Parameter missing: recipient')
|
|
135
148
|
}
|
|
136
149
|
|
|
150
|
+
if (params.user_id && !isInt(params.user_id)) {
|
|
151
|
+
throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params.user_id)}`)
|
|
152
|
+
}
|
|
153
|
+
|
|
137
154
|
if (params.bundle_id && !isInt(params.bundle_id)) {
|
|
138
155
|
throw new errors.InvalidParameterError(`Bad parameter: bundle_id must be of type Int, received ${getType(params.bundle_id)}`)
|
|
139
156
|
}
|