Skip to content

Commit

Permalink
fix: update root url to bigquery.googleapis.com (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith authored and callmehiphop committed Sep 6, 2019
1 parent 088e1a0 commit 277940f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export interface BigQueryOptions extends common.GoogleAuthOptions {
location?: string;
/**
* The API endpoint of the service used to make requests.
* Defaults to `www.googleapis.com`.
* Defaults to `bigquery.googleapis.com`.
*/
apiEndpoint?: string;
}
Expand Down Expand Up @@ -200,7 +200,7 @@ export interface BigQueryOptions extends common.GoogleAuthOptions {
* @property {string[]} [scopes] Additional OAuth scopes to use in requests. For
* example, to access an external data source, you may need the
* `https://www.googleapis.com/auth/drive.readonly` scope.
* @property {string=} apiEndpoint The API endpoint of the service used to make requests. Defaults to `www.googleapis.com`.
* @property {string=} apiEndpoint The API endpoint of the service used to make requests. Defaults to `bigquery.googleapis.com`.
*/

/**
Expand Down Expand Up @@ -244,7 +244,7 @@ export class BigQuery extends common.Service {
getJobsStream: (options?: GetJobsOptions) => ResourceStream<Job>;

constructor(options: BigQueryOptions = {}) {
options.apiEndpoint = options.apiEndpoint || 'www.googleapis.com';
options.apiEndpoint = options.apiEndpoint || 'bigquery.googleapis.com';
const config = {
apiEndpoint: options.apiEndpoint,
baseUrl: `https://${options.apiEndpoint}/bigquery/v2`,
Expand Down
2 changes: 1 addition & 1 deletion test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ describe('BigQuery', () => {

const calledWith = bq.calledWith_[0];

const baseUrl = 'https://www.googleapis.com/bigquery/v2';
const baseUrl = 'https://bigquery.googleapis.com/bigquery/v2';
assert.strictEqual(calledWith.baseUrl, baseUrl);
assert.deepStrictEqual(calledWith.scopes, [
'https://www.googleapis.com/auth/bigquery',
Expand Down
4 changes: 2 additions & 2 deletions test/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('BigQuery/Table', () => {
job: (id: string) => {
return {id};
},
apiEndpoint: 'www.googleapis.com',
apiEndpoint: 'bigquery.googleapis.com',
request: util.noop,
},
};
Expand Down Expand Up @@ -1555,7 +1555,7 @@ describe('BigQuery/Table', () => {
options: MakeWritableStreamOptions
) => {
const uri =
'https://www.googleapis.com/upload/bigquery/v2/projects/' +
'https://bigquery.googleapis.com/upload/bigquery/v2/projects/' +
table.bigQuery.projectId +
'/jobs';
assert.strictEqual(options.request.uri, uri);
Expand Down

0 comments on commit 277940f

Please sign in to comment.