Skip to content

Commit

Permalink
feat: narrow the typesafe of constants
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarosabu committed Oct 9, 2024
1 parent 54df30e commit 7e448ae
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
export const commands: Record<string, string> = {
export const commands = {
LOGIN: 'login',
LOGOUT: 'logout',
}
} as const

export const regions: Record<string, string> = {
export const regions = {
EU: 'eu',
US: 'us',
CN: 'cn',
CA: 'ca',
AP: 'ap',
}
} as const

export const regionsDomain: Record<string, string> = {
export const regionsDomain = {
eu: 'api.storyblok.com',
us: 'api-us.storyblok.com',
cn: 'app.storyblokchina.cn',
ca: 'api-ca.storyblok.com',
ap: 'api-ap.storyblok.com',
}
} as const

export const managementApiRegions: Record<string, string> = {
export const managementApiRegions = {
eu: 'mapi.storyblok.com',
us: 'mapi-us.storyblok.com',
cn: 'mapi.storyblokchina.cn',
ca: 'mapi-ca.storyblok.com',
ap: 'mapi-ap.storyblok.com',
}
} as const

export const regionNames: Record<string, string> = {
export const regionNames = {
eu: 'Europe',
us: 'United States',
cn: 'China',
ca: 'Canada',
ap: 'Australia',
}
} as const

export const DEFAULT_AGENT: Record<string, string> = {
export const DEFAULT_AGENT = {
SB_Agent: 'SB-CLI',
SB_Agent_Version: process.env.npm_package_version || '4.x',
}
} as const

0 comments on commit 7e448ae

Please sign in to comment.