From 7fba5e8f7c395d044af1f98f6fc85e60da1ddb20 Mon Sep 17 00:00:00 2001 From: ifielker Date: Thu, 12 Mar 2020 18:07:50 -0400 Subject: [PATCH] Firebase ML changed endpoint --- src/machine-learning/machine-learning-api-client.ts | 4 ++-- .../unit/machine-learning/machine-learning-api-client.spec.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/machine-learning/machine-learning-api-client.ts b/src/machine-learning/machine-learning-api-client.ts index 855126b206..dcf59a55ff 100644 --- a/src/machine-learning/machine-learning-api-client.ts +++ b/src/machine-learning/machine-learning-api-client.ts @@ -21,7 +21,7 @@ import * as utils from '../utils/index'; import * as validator from '../utils/validator'; import { FirebaseApp } from '../firebase-app'; -const ML_V1BETA1_API = 'https://mlkit.googleapis.com/v1beta1'; +const ML_V1BETA2_API = 'https://firebaseml.googleapis.com/v1beta2'; const FIREBASE_VERSION_HEADER = { 'X-Firebase-Client': 'fire-admin-node/', }; @@ -253,7 +253,7 @@ export class MachineLearningApiClient { private getUrl(): Promise { return this.getProjectIdPrefix() .then((projectIdPrefix) => { - return `${ML_V1BETA1_API}/${this.projectIdPrefix}`; + return `${ML_V1BETA2_API}/${this.projectIdPrefix}`; }); } diff --git a/test/unit/machine-learning/machine-learning-api-client.spec.ts b/test/unit/machine-learning/machine-learning-api-client.spec.ts index 36b7cc214d..61dec42b66 100644 --- a/test/unit/machine-learning/machine-learning-api-client.spec.ts +++ b/test/unit/machine-learning/machine-learning-api-client.spec.ts @@ -32,7 +32,7 @@ const expect = chai.expect; describe('MachineLearningApiClient', () => { - const BASE_URL = 'https://mlkit.googleapis.com/v1beta1'; + const BASE_URL = 'https://firebaseml.googleapis.com/v1beta2'; const MODEL_ID = '1234567'; const MODEL_RESPONSE = {