How to use the google-protobuf/google/protobuf/timestamp_pb.js.Timestamp function in google-protobuf

To help you get started, we’ve selected a few google-protobuf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googlefonts / fontbakery-dashboard / containers / base / javascript / node / api.js View on Github external
// 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
github ArcBlock / forge-js / forge / forge-proto / lib / deposit_tether_tx_pb.js View on Github external
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;
};
github googlefonts / fontbakery-dashboard / containers / base / javascript / generated_modules / protocolbuffers / messages_pb.js View on Github external
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;
};
github lightstep / lightstep-tracer-javascript / src / imp / generated_proto / collector_pb.js View on Github external
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);
github googlefonts / fontbakery-dashboard / containers / base / javascript / node / manifestSources / _Source.js View on Github external
function timestampFromDate(date){
    var ts = new Timestamp();
    ts.fromDate(date);
    return ts;
}
/**
github lightstep / lightstep-tracer-javascript / src / imp / generated_proto / collector_pb.js View on Github external
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;
};
github ArcBlock / forge-js / forge / forge-proto / lib / exchange_tether_tx_pb.js View on Github external
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;
};
github improbable-eng / ts-protoc-gen / examples / generated / proto / examplecom / simple_service_pb.js View on Github external
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;
};
github caos / zitadel / console / src / app / proto / generated / admin_pb.js View on Github external
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:
github nelhage / crossme / v2 / src / pb / puzzle_pb.js View on Github external
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: