Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// so this is filter is not really needed but left here commented out,
// as an example, if we want to filter stuff in the future:
// Make a DATE filter:
// min value two months in the past.
// I.e. show the reports not older than min date
// let date = new Date()
// , filter = new ReportsQuery.Filter()
// ;
// date.setMonth(date.getMonth() - 2); // two month in the past
// filter.setType(ReportsQuery.Filter.Type.DATE);
// filter.setMinMaxDatesList([timestampFromDate(date)]);// just one means only min-date
// reportsQuery.getFiltersMap().set('reported', filter);
if('lastItemReported' in req.params) {
let { lastItemReported, lastItemId, previous } = req.params
, pagination = new ReportsQuery.Pagination()
, reported = new Timestamp()
;
reported.fromDate(new Date(lastItemReported));
pagination.setItemReported(reported);
pagination.setItemId(lastItemId);
pagination.setPreviousPage(previous === 'true');
reportsQuery.setPagination(pagination);
}
// that's the default, but for documentation …
reportsQuery.setIncludeData(false);
this._reports.query(reportsQuery)
//translate into json for the client
.then(reports=>reports.map(report=>{
var result = report.toObject(false);
// special service for the client:
// Do this in the client? This way, the client doesn't need
break;
case 3:
var value = new type_pb.BigUint;
reader.readMessage(value,type_pb.BigUint.deserializeBinaryFromReader);
msg.setCharge(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setTarget(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setWithdrawer(value);
break;
case 6:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setLocktime(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
break;
case 5:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setFinished(value);
break;
case 6:
var value = /** @type {string} */ (reader.readString());
msg.setData(value);
break;
case 7:
var value = /** @type {string} */ (reader.readString());
msg.setId(value);
break;
case 8:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setReported(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
case 1:
var value = new proto.lightstep.collector.SpanContext;
reader.readMessage(value,proto.lightstep.collector.SpanContext.deserializeBinaryFromReader);
msg.setSpanContext(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setOperationName(value);
break;
case 3:
var value = new proto.lightstep.collector.Reference;
reader.readMessage(value,proto.lightstep.collector.Reference.deserializeBinaryFromReader);
msg.addReferences(value);
break;
case 4:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setStartTimestamp(value);
break;
case 5:
var value = /** @type {string} */ (reader.readUint64String());
msg.setDurationMicros(value);
break;
case 6:
var value = new proto.lightstep.collector.KeyValue;
reader.readMessage(value,proto.lightstep.collector.KeyValue.deserializeBinaryFromReader);
msg.addTags(value);
break;
case 7:
var value = new proto.lightstep.collector.Log;
reader.readMessage(value,proto.lightstep.collector.Log.deserializeBinaryFromReader);
msg.addLogs(value);
function timestampFromDate(date){
var ts = new Timestamp();
ts.fromDate(date);
return ts;
}
/**
proto.lightstep.collector.Log.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setTimestamp(value);
break;
case 2:
var value = new proto.lightstep.collector.KeyValue;
reader.readMessage(value,proto.lightstep.collector.KeyValue.deserializeBinaryFromReader);
msg.addFields(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
break;
case 3:
var value = new type_pb.BigUint;
reader.readMessage(value,type_pb.BigUint.deserializeBinaryFromReader);
msg.setCharge(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setTarget(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setWithdrawer(value);
break;
case 6:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setLocktime(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
proto.examplecom.UnaryRequest.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt64());
msg.setSomeInt64(value);
break;
case 2:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setSomeTimestamp(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setId(value);
break;
case 2:
var value = /** @type {!proto.caos.zitadel.admin.api.v1.UserState} */ (reader.readEnum());
msg.setState(value);
break;
case 3:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setCreationDate(value);
break;
case 4:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setChangeDate(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setUserName(value);
break;
case 6:
var value = /** @type {string} */ (reader.readString());
msg.setFirstName(value);
break;
case 7:
var value = /** @type {string} */ (reader.readString());
msg.setLastName(value);
break;
case 8:
proto.crossme.Puzzle.Meta.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setCreated(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setSha256(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setId(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setDate(value);
break;
default: