|
|
|
@ -33,10 +33,7 @@ |
|
|
|
|
|
|
|
|
|
'use strict'; |
|
|
|
|
|
|
|
|
|
var _ = require('underscore'); |
|
|
|
|
|
|
|
|
|
var capitalize = require('underscore.string/capitalize'); |
|
|
|
|
var decapitalize = require('underscore.string/decapitalize'); |
|
|
|
|
var _ = require('lodash'); |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Get a function that deserializes a specific type of protobuf. |
|
|
|
@ -81,7 +78,7 @@ function fullyQualifiedName(value) { |
|
|
|
|
} |
|
|
|
|
var name = value.name; |
|
|
|
|
if (value.className === 'Service.RPCMethod') { |
|
|
|
|
name = capitalize(name); |
|
|
|
|
name = _.capitalize(name); |
|
|
|
|
} |
|
|
|
|
if (value.hasOwnProperty('parent')) { |
|
|
|
|
var parent_name = fullyQualifiedName(value.parent); |
|
|
|
@ -118,8 +115,8 @@ function wrapIgnoreNull(func) { |
|
|
|
|
function getProtobufServiceAttrs(service) { |
|
|
|
|
var prefix = '/' + fullyQualifiedName(service) + '/'; |
|
|
|
|
return _.object(_.map(service.children, function(method) { |
|
|
|
|
return [decapitalize(method.name), { |
|
|
|
|
path: prefix + capitalize(method.name), |
|
|
|
|
return [_.camelCase(method.name), { |
|
|
|
|
path: prefix + _.capitalize(method.name), |
|
|
|
|
requestStream: method.requestStream, |
|
|
|
|
responseStream: method.responseStream, |
|
|
|
|
requestSerialize: serializeCls(method.resolvedRequestType.build()), |
|
|
|
|