How to use the google-protobuf/google/protobuf/empty_pb.js.Empty 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 / util / ManifestServer.js View on Github external
_p.getDelayed = function(call, callback) {
    var sourceId = call.request.getSourceId() // call.request is a FamilyRequest
      , familyName = call.request.getFamilyName() // call.request is a FamilyRequest
      , processCommand = call.request.getProcessCommand()
      ;
    this._log.info('[GET_DELAYED:'+sourceId+'/'+familyName+'] ...');
    if(!processCommand) {
        callback(new Error('GetDelayed requires FamilyRequest to define '
                                + 'a ProcessCommand, which it doesn\'t.'));
        return;
    }
    callback(null, new Empty());
    return this._get(sourceId, familyName)
    .then(
          null
        , err=>{
            this._log.error('[GET_DELAYED:'+sourceId+'/'+familyName+']', err);
            var familyData = new FamilyData()
              , collectionId = [this._id, sourceId].join('/')
              ;
            familyData.setStatus(FamilyData.Result.FAIL);
            familyData.setError('' + err);
            // grpc status OK is 0 and that makes sense for a default.
            // But since we know that there's an error and this is
            // expected to report similar to the `get` interface,
            // with grpc codes, UNKOWN (6) seem appropriate.
            familyData.setErrorCode(err.code || grpc.status.UNKNOWN);
            familyData.setCollectionid(collectionId);
github googlefonts / fontbakery-dashboard / containers / base / javascript / node / apiServices / GithubOAuth.js View on Github external
return promise.then((authStatus)=>{
        if(authStatus) {
            // status is AuthStatus.StatusCode.OK
            // do the same as after a full successful login.
            return this._sendClientAuthentienticationWindow(req, res, next, authStatus);
        }
        return this._ghAuthClient.initSession(new Empty())
        // probably same message type as a not initial session message,
        // maybe some fields set differenty/not.
        .then(authStatus=>{
            // assert  authStatus.getStatus() === AuthStatus.StatusCode.INITIAL
            var sessionId = authStatus.getSessionId()
              , authorizeUrl = authStatus.getAuthorizeUrl()
              ;
            res.cookie(SESSION_COOKIE_NAME, sessionId, this._cookieOptions);
            // and redirect user to authorizeUrl
            res.redirect(302, authorizeUrl);
        });
    })
    .then(null, error=>{
github googlefonts / fontbakery-dashboard / containers / base / javascript / node / GitHubOperationsServer.js View on Github external
_p.dispatchPullRequest = function(call, callback) {
    // jshint unused:vars

    this._log.debug('[gRPC:dispatchPullRequest]');
    callback(null, new Empty());
    // This branch will be overridden by each call to dispatch
    // hence, dispatch must not run async in multiple instances
    // using AsyncQueue. Since writing to git can't happen in parallel
    // as well, enforcing a concecutive order is necessary anyways.
    var localBranchName = 'dispatch_branch'
      // call.request is a protocolBuffer PullRequest
      , pullRequest = call.request
        // a protobuf SessionId message to get the github credentials
        // from grpc GitHubAuthServer
      , sessionId = pullRequest.getSessionId() // string
      , storageKey = pullRequest.getStorageKey() // string
      , targetDirectory = pullRequest.getTargetDirectory()
      , targetBranchName = this._makeRemoteBranchName(targetDirectory)
      , prMessageTitle =  pullRequest.getPRMessageTitle()
      , prMessageBody =  pullRequest.getPRMessageBody()
      , commitMessage = pullRequest.getCommitMessage()
github pulumi / pulumi / sdk / nodejs / cmd / dynamic-provider / index.ts View on Github external
async function deleteRPC(call: any, callback: any): Promise<void> {
    try {
        const req: any = call.request;
        const props: any = req.getProperties().toJavaScript();
        await getProvider(props).delete(req.getId(), props);
        callback(undefined, new emptyproto.Empty());
    } catch (e) {
        console.error(`${e}: ${e.stack}`);
        callback(e, undefined);
    }
}
github improbable-eng / ts-protoc-gen / examples / generated / proto / examplecom / simple_pb.js View on Github external
var value = new google_protobuf_api_pb.Method;
      reader.readMessage(value,google_protobuf_api_pb.Method.deserializeBinaryFromReader);
      msg.setSomeMethod(value);
      break;
    case 7:
      var value = new google_protobuf_descriptor_pb.GeneratedCodeInfo;
      reader.readMessage(value,google_protobuf_descriptor_pb.GeneratedCodeInfo.deserializeBinaryFromReader);
      msg.setSomeGeneratedCodeInfo(value);
      break;
    case 8:
      var value = new google_protobuf_duration_pb.Duration;
      reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader);
      msg.setSomeDuration(value);
      break;
    case 9:
      var value = new google_protobuf_empty_pb.Empty;
      reader.readMessage(value,google_protobuf_empty_pb.Empty.deserializeBinaryFromReader);
      msg.setSomeEmpty(value);
      break;
    case 10:
      var value = new google_protobuf_field_mask_pb.FieldMask;
      reader.readMessage(value,google_protobuf_field_mask_pb.FieldMask.deserializeBinaryFromReader);
      msg.setSomeFieldMask(value);
      break;
    case 11:
      var value = new google_protobuf_source_context_pb.SourceContext;
      reader.readMessage(value,google_protobuf_source_context_pb.SourceContext.deserializeBinaryFromReader);
      msg.setSomeSourceContext(value);
      break;
    case 12:
      var value = new google_protobuf_struct_pb.Struct;
      reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
github ovh / cds / sdk / grpcplugin / actionplugin / nodejs / sdk.js View on Github external
function workerHTTPPort(call, callback) {
  var reply = new google_protobuf_empty_pb.Empty();
  httpPort = call.request;
  callback(null, reply);
}
github improbable-eng / ts-protoc-gen / examples / generated / proto / examplecom / well_known_message_pb.js View on Github external
var value = new google_protobuf_api_pb.Method;
      reader.readMessage(value,google_protobuf_api_pb.Method.deserializeBinaryFromReader);
      msg.setMyMethod(value);
      break;
    case 4:
      var value = new google_protobuf_descriptor_pb.GeneratedCodeInfo;
      reader.readMessage(value,google_protobuf_descriptor_pb.GeneratedCodeInfo.deserializeBinaryFromReader);
      msg.setMyGeneratedCodeInfo(value);
      break;
    case 5:
      var value = new google_protobuf_duration_pb.Duration;
      reader.readMessage(value,google_protobuf_duration_pb.Duration.deserializeBinaryFromReader);
      msg.setMyDuration(value);
      break;
    case 6:
      var value = new google_protobuf_empty_pb.Empty;
      reader.readMessage(value,google_protobuf_empty_pb.Empty.deserializeBinaryFromReader);
      msg.setMyEmpty(value);
      break;
    case 7:
      var value = new google_protobuf_field_mask_pb.FieldMask;
      reader.readMessage(value,google_protobuf_field_mask_pb.FieldMask.deserializeBinaryFromReader);
      msg.setMyFieldMask(value);
      break;
    case 8:
      var value = new google_protobuf_source_context_pb.SourceContext;
      reader.readMessage(value,google_protobuf_source_context_pb.SourceContext.deserializeBinaryFromReader);
      msg.setMySourceContext(value);
      break;
    case 9:
      var value = new google_protobuf_struct_pb.Struct;
      reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
github pulumi / pulumi / sdk / nodejs / cmd / dynamic-provider / index.ts View on Github external
function configureRPC(call: any, callback: any): void {
    callback(undefined, new emptyproto.Empty());
}
github googlefonts / fontbakery-dashboard / containers / base / javascript / node / util / ProcessManagerClient.js View on Github external
return nodeCallback2Promise((callback)=>
            this._client.getInitProcessUi(new Empty()
                                    , {deadline: this.deadline}, callback))
            .then(null, error=>this._raiseUnhandledError(error));
github ovh / cds / sdk / grpcplugin / actionplugin / nodejs / sdk.js View on Github external
function stop(call, callback) {
  var reply = new google_protobuf_empty_pb.Empty();
  server.stop()
  callback(null, reply);
}

google-protobuf

Protocol Buffers for JavaScript

BSD-3-Clause
Latest version published 2 months ago

Package Health Score

89 / 100
Full package analysis