Skip to content

Commit

Permalink
Fixed pva publish base url bug (microsoft#4538)
Browse files Browse the repository at this point in the history
Co-authored-by: Dong Lei <[email protected]>
  • Loading branch information
tonyanziano and boydc2014 authored Oct 27, 2020
1 parent bbeb0c3 commit b6acb0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
8 changes: 4 additions & 4 deletions extensions/pvaPublish/src/node/constants.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const COMPOSER_1P_APP_ID = 'ce48853e-0605-4f77-8746-d70ac63cc6bc';
const API_VERSION = 'v1';
export const API_VERSION = 'v1';

export const AUTH_CREDENTIALS = {
INT: {
Expand All @@ -23,7 +23,7 @@ export const AUTH_CREDENTIALS = {
};

export const BASE_URLS = {
INT: `https://bots.int.customercareintelligence.net/api/botmanagement/${API_VERSION}`,
PPE: `https://bots.ppe.customercareintelligence.net/api/botmanagement/${API_VERSION}`,
PROD: `https://powerva.microsoft.com/api/botmanagement/${API_VERSION}`,
INT: `https://bots.int.customercareintelligence.net/`,
PPE: `https://bots.ppe.customercareintelligence.net/`,
PROD: `https://powerva.microsoft.com/`,
};
9 changes: 5 additions & 4 deletions extensions/pvaPublish/src/node/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
} from './types';
import { getAuthCredentials, getBaseUrl } from './utils';
import { logger } from './logger';
import { API_VERSION } from './constants';

// in-memory history that allows us to get the status of the most recent job
const publishHistory: PublishHistory = {};
Expand Down Expand Up @@ -84,7 +85,7 @@ export const publish = async (
const length = zipReadStream.readableLength;

// initiate the publish job
let url = `${base}/environments/${envId}/bots/${botId}/composer/publishoperations?deleteMissingDependencies=${deleteMissingDependencies}`;
let url = `${base}api/botmanagement/${API_VERSION}/environments/${envId}/bots/${botId}/composer/publishoperations?deleteMissingDependencies=${deleteMissingDependencies}`;
if (comment) {
url += `&comment=${encodeURIComponent(comment)}`;
}
Expand Down Expand Up @@ -160,7 +161,7 @@ export const getStatus = async (
const accessToken = await getAccessToken(creds);

// check the status for the publish job
const url = `${base}/environments/${envId}/bots/${botId}/composer/publishoperations/${operationId}`;
const url = `${base}api/botmanagement/${API_VERSION}/environments/${envId}/bots/${botId}/composer/publishoperations/${operationId}`;
const res = await fetch(url, {
method: 'GET',
headers: {
Expand Down Expand Up @@ -216,7 +217,7 @@ export const history = async (
const accessToken = await getAccessToken(creds);

// get the publish history for the bot
const url = `${base}/environments/${envId}/bots/${botId}/composer/publishoperations`;
const url = `${base}api/botmanagement/${API_VERSION}/environments/${envId}/bots/${botId}/composer/publishoperations`;
const res = await fetch(url, {
method: 'GET',
headers: getAuthHeaders(accessToken, tenantId),
Expand Down Expand Up @@ -250,7 +251,7 @@ export const pull = async (
const accessToken = await getAccessToken(creds);

// fetch zip containing bot content
const url = `${base}/environments/${envId}/bots/${botId}/composer/content`;
const url = `${base}api/botmanagement/${API_VERSION}/environments/${envId}/bots/${botId}/composer/content`;
const options: RequestInit = {
method: 'GET',
headers: getAuthHeaders(accessToken, tenantId),
Expand Down

0 comments on commit b6acb0d

Please sign in to comment.