Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
speech: incorporate @google-cloud/common-grpc (#1951)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus authored and callmehiphop committed Jan 31, 2017
1 parent e5a8866 commit eff1b5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"speech"
],
"dependencies": {
"@google-cloud/common": "^0.11.0",
"@google-cloud/common": "^0.12.0",
"@google-cloud/common-grpc": "^0.1.1",
"events-intercept": "^2.0.0",
"extend": "^3.0.0",
"google-gax": "^0.10.2",
Expand Down
9 changes: 5 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
'use strict';

var common = require('@google-cloud/common');
var commonGrpc = require('@google-cloud/common-grpc');
var eventsIntercept = require('events-intercept');
var extend = require('extend');
var format = require('string-format-obj');
Expand Down Expand Up @@ -85,10 +86,10 @@ function Speech(options) {
packageJson: require('../package.json')
};

common.GrpcService.call(this, config, options);
commonGrpc.Service.call(this, config, options);
}

util.inherits(Speech, common.GrpcService);
util.inherits(Speech, commonGrpc.Service);

/**
* The endpointer types that the Speech API will return while processing a
Expand Down Expand Up @@ -521,7 +522,7 @@ Speech.prototype.createRecognizeStream = function(config) {

/*! Developer Documentation
*
* @returns {module:common/grpcOperation}
* @returns {module:commonGrpc/Operation}
*/
/**
* Get a reference to an existing operation.
Expand All @@ -538,7 +539,7 @@ Speech.prototype.operation = function(name) {
throw new Error('A name must be specified for an operation.');
}

return new common.GrpcOperation(this, name);
return new commonGrpc.Operation(this, name);
};

/**
Expand Down
6 changes: 4 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,12 @@ describe('Speech', function() {
before(function() {
Speech = proxyquire('../', {
'@google-cloud/common': {
GrpcOperation: FakeGrpcOperation,
GrpcService: FakeGrpcService,
util: fakeUtil
},
'@google-cloud/common-grpc': {
Operation: FakeGrpcOperation,
Service: FakeGrpcService
},
request: fakeRequest,
'./v1beta1': fakeV1Beta1
});
Expand Down

0 comments on commit eff1b5a

Please sign in to comment.