Skip to content

Commit

Permalink
Update Statsig API/Console subdomains
Browse files Browse the repository at this point in the history
  • Loading branch information
roim committed Jun 28, 2021
1 parent fbafc35 commit f322446
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 23 deletions.
14 changes: 9 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# Change Log

### 1.0.4
## 1.0.5

- Update Statsig API subdomains.

## 1.0.4

- Fix to only display Statsig menu items in the Statsig view.

### 1.0.3
## 1.0.3

- Minor fixes to `statsig.feelingLucky`.

### 1.0.2
## 1.0.2

- More descriptive error logging.
- Suppress error toasts in background refreshes.

### 1.0.1
## 1.0.1

- Package metadata updates.

### 1.0.0
## 1.0.0

Initial release. Features:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

This extension contributes the following settings:

- `statsig.refresh.InBackground`: enable/disable incremental background refreshes of your flags and configs (refreshes while you're not interacting with the extension, so things are always up-to-date).
- `statsig.refresh.inBackground`: enable/disable incremental background refreshes of your flags and configs (refreshes while you're not interacting with the extension, so things are always up-to-date).
- `statsig.refresh.interval`: interval in minutes between each background refresh.
- `statsig.textEditor.enableHoverTooltips`: enable/disable tooltips when hovering over strings that match flag/config names.
- `statsig.textEditor.enableCodeLens`: enable/disable CodeLens on strings that match flag/config names. Disabled by default.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "Statsig",
"publisher": "Statsig",
"description": "Build. Measure. Ship!",
"version": "1.0.4",
"version": "1.0.5",
"license": "ISC",
"homepage": "https://www.statsig.com",
"repository": {
Expand Down Expand Up @@ -41,7 +41,7 @@
"configuration": {
"title": "Statsig",
"properties": {
"statsig.refresh.InBackground": {
"statsig.refresh.inBackground": {
"type": "boolean",
"default": true,
"description": "Refresh Statsig projects in the background"
Expand Down
2 changes: 1 addition & 1 deletion src/commands/fetchConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export async function run(params?: {
let projectsResponse: AxiosResponse<ProjectsContract> | undefined = undefined;
try {
projectsResponse = await axios.post(
`https://${getTierPrefix('api')}.statsig.com/developer/v1/projects`,
`https://${getTierPrefix()}api.statsig.com/developer/v1/projects`,
{ sinceTime: sinceTime },
{ headers: { 'statsig-api-key': token } },
);
Expand Down
2 changes: 1 addition & 1 deletion src/commands/openConsole.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getTierPrefix } from '../lib/webUtils';

export default function run(): void {
void vsc.env.openExternal(
vsc.Uri.parse(`https://${getTierPrefix('console')}.statsig.com`),
vsc.Uri.parse(`https://${getTierPrefix()}console.statsig.com`),
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/commands/openTreeViewEntryInBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function run(e: StatsigConfig): void {
const type = e.data.type === 'feature_gate' ? 'gates' : 'dynamic_configs';
void vsc.env.openExternal(
vsc.Uri.parse(
`https://${getTierPrefix('console')}.statsig.com/${e.projectID}/${type}/${
`https://${getTierPrefix()}console.statsig.com/${e.projectID}/${type}/${
e.data.name
}`,
),
Expand Down
2 changes: 1 addition & 1 deletion src/lib/configUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { getTierPrefix } from './webUtils';

export function getConfigUrl(c: StatsigConfig): vsc.Uri {
return vsc.Uri.parse(
`https://${getTierPrefix('console')}.statsig.com/${c.projectID}/${
`https://${getTierPrefix()}console.statsig.com/${c.projectID}/${
c.type === 'feature_gate' ? 'gates' : 'dynamic_configs'
}/${c.data.name}`,
);
Expand Down
13 changes: 2 additions & 11 deletions src/lib/webUtils.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
import getExtensionConfig from '../state/getExtensionConfig';

export function getTierPrefix(app: 'api' | 'console'): string {
export function getTierPrefix(): string {
const tier = getExtensionConfig().web.tier;
switch (tier) {
case 'prod':
return app;

case 'latest':
return `latest.${app}`;

default:
return tier;
}
return tier === 'prod' ? '' : `${tier}.`;
}

0 comments on commit f322446

Please sign in to comment.