54365436 return base.PubNubFile;
54375437 },
54385438 get version() {
5439- return '9.10 .0';
5439+ return '9.11 .0';
54405440 },
54415441 getVersion() {
54425442 return this.version;
1142011420 * Whether state associated with `uuid` should be included in response or not.
1142111421 */
1142211422 const INCLUDE_STATE = false;
11423+ /**
11424+ * Maximum number of participants which can be returned with single response.
11425+ */
11426+ const MAXIMUM_COUNT = 1000;
1142311427 // endregion
1142411428 /**
1142511429 * Channel presence request.
@@ -11428,14 +11432,19 @@
1142811432 */
1142911433 class HereNowRequest extends AbstractRequest {
1143011434 constructor(parameters) {
11431- var _a, _b, _c;
11432- var _d, _e, _f;
11435+ var _a, _b, _c, _d ;
11436+ var _e, _f, _g, _h ;
1143311437 super();
1143411438 this.parameters = parameters;
1143511439 // Apply defaults.
11436- (_a = (_d = this.parameters).queryParameters) !== null && _a !== void 0 ? _a : (_d.queryParameters = {});
11437- (_b = (_e = this.parameters).includeUUIDs) !== null && _b !== void 0 ? _b : (_e.includeUUIDs = INCLUDE_UUID$1);
11438- (_c = (_f = this.parameters).includeState) !== null && _c !== void 0 ? _c : (_f.includeState = INCLUDE_STATE);
11440+ (_a = (_e = this.parameters).queryParameters) !== null && _a !== void 0 ? _a : (_e.queryParameters = {});
11441+ (_b = (_f = this.parameters).includeUUIDs) !== null && _b !== void 0 ? _b : (_f.includeUUIDs = INCLUDE_UUID$1);
11442+ (_c = (_g = this.parameters).includeState) !== null && _c !== void 0 ? _c : (_g.includeState = INCLUDE_STATE);
11443+ if (this.parameters.limit)
11444+ this.parameters.limit = Math.min(this.parameters.limit, MAXIMUM_COUNT);
11445+ else
11446+ this.parameters.limit = MAXIMUM_COUNT;
11447+ (_d = (_h = this.parameters).offset) !== null && _d !== void 0 ? _d : (_h.offset = 0);
1143911448 }
1144011449 operation() {
1144111450 const { channels = [], channelGroups = [] } = this.parameters;
1148011489 return {
1148111490 totalChannels,
1148211491 totalOccupancy,
11492+ next: 0,
1148311493 channels: channelsPresence,
1148411494 };
1148511495 });
1149211502 return path;
1149311503 }
1149411504 get queryParameters() {
11495- const { channelGroups, includeUUIDs, includeState, queryParameters } = this.parameters;
11496- return Object.assign(Object.assign(Object.assign(Object.assign({} , (!includeUUIDs ? { disable_uuids: '1' } : {})), ((includeState !== null && includeState !== void 0 ? includeState : false) ? { state: '1' } : {})), (channelGroups && channelGroups.length > 0 ? { 'channel-group': channelGroups.join(',') } : {})), queryParameters);
11505+ const { channelGroups, includeUUIDs, includeState, limit, offset, queryParameters } = this.parameters;
11506+ return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (this.operation() === RequestOperation$1.PNHereNowOperation ? { limit } : {})), (this.operation() === RequestOperation$1.PNHereNowOperation && offset > 0 ? { offset } : {})) , (!includeUUIDs ? { disable_uuids: '1' } : {})), ((includeState !== null && includeState !== void 0 ? includeState : false) ? { state: '1' } : {})), (channelGroups && channelGroups.length > 0 ? { 'channel-group': channelGroups.join(',') } : {})), queryParameters);
1149711507 }
1149811508 }
1149911509
@@ -16768,10 +16778,16 @@
1676816778 };
1676916779 if (callback)
1677016780 return this.sendRequest(request, (status, response) => {
16781+ var _a;
16782+ if (response && response.totalOccupancy === parameters.limit)
16783+ response.next = ((_a = parameters.offset) !== null && _a !== void 0 ? _a : 0) + 1;
1677116784 logResponse(response);
1677216785 callback(status, response);
1677316786 });
1677416787 return this.sendRequest(request).then((response) => {
16788+ var _a;
16789+ if (response && response.totalOccupancy === parameters.limit)
16790+ response.next = ((_a = parameters.offset) !== null && _a !== void 0 ? _a : 0) + 1;
1677516791 logResponse(response);
1677616792 return response;
1677716793 });
0 commit comments