Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Commit

Permalink
dyanamic test urls
Browse files Browse the repository at this point in the history
  • Loading branch information
pierce-h committed Oct 2, 2020
1 parent f5fa3bf commit 13d2fb6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/publish-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { green, red } from "chalk";
import parseDeploymentErrors from './utils/parse-deployment-errors';
import Table from 'cli-table';
import { ConnectApp } from './types'
import { info } from 'console';

class AppFailedToPackageError extends Error {
code: string;
Expand Down Expand Up @@ -150,12 +151,14 @@ const createOrFindTestAccount = async (client: APIClient, platformApp: ConnectAp
cli.action.stop(`${logSymbols.success}`);
}

const productInfo = platformApp.productInfos.find((info) => info.product === "ShipStation")
const testUrl = productInfo && productInfo.loginUrl;
const table = new Table();

table.push(
{ 'Email': [email] },
{ 'Password': [platformApp.id] },
{ 'Test URL': ["https://ss-devss127.sslocal.com/"] }
{ 'Test URL': [testUrl] }
);
console.log("Test your app with the account below:");
console.log(table.toString());
Expand Down
6 changes: 6 additions & 0 deletions src/core/types/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ export type SdkApp = CarrierApp | OrderApp;

export type SdkAppTypes = AppType.Carrier | AppType.Order;

export interface ProductInfo {
product: "ShipStation",
loginUrl: string;
}

export interface ConnectApp {
id: string;
name: string;
type: "carrier";
productInfos: ProductInfo[];
}

0 comments on commit 13d2fb6

Please sign in to comment.