diffusion
Version:
Diffusion JavaScript client
78 lines (77 loc) • 3.35 kB
JavaScript
;
/**
* @module Services.SessionFetchQuery
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SessionFetchQuerySerialiser = exports.SessionFetchQuerySerialiserClass = void 0;
var Codec = require("./../../io/codec");
var serialiser_1 = require("./../../serialisers/serialiser");
var math_1 = require("./../../util/math");
/**
* Serialiser for {@link SessionFetchQuery}
*/
var SessionFetchQuerySerialiserClass = /** @class */ (function (_super) {
__extends(SessionFetchQuerySerialiserClass, _super);
function SessionFetchQuerySerialiserClass() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Write a {@link SessionFetchQuery} to the stream
*
* @param bos the output stream
* @param value the {@link SessionFetchQuery} to be written
*/
SessionFetchQuerySerialiserClass.prototype.write = function (bos, value) {
Codec.writeString(bos, value.filter);
Codec.writeOptional(bos, value.withProperties, function (ostream, props) {
Codec.writeCollection(ostream, __spreadArray([], __read(props)), Codec.writeString);
});
Codec.writeOptional(bos, value.range.from, Codec.writeInt64);
Codec.writeOptional(bos, value.range.to, Codec.writeInt64);
Codec.writeOptional(bos, value.limit, Codec.writeInt32, function (limit) { return limit !== math_1.MAX_INT32; });
Codec.writeInt32(bos, value.maximumResultSize);
Codec.writeBoolean(bos, value.requiresStartTime);
};
return SessionFetchQuerySerialiserClass;
}(serialiser_1.AbstractSerialiser));
exports.SessionFetchQuerySerialiserClass = SessionFetchQuerySerialiserClass;
/**
* The {@link SessionFetchQuerySerialiser} singleton
*/ // eslint-disable-next-line @typescript-eslint/naming-convention
exports.SessionFetchQuerySerialiser = new SessionFetchQuerySerialiserClass();