-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathurls.ts
More file actions
97 lines (84 loc) · 3.94 KB
/
Copy pathurls.ts
File metadata and controls
97 lines (84 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
export const AUTH_URLS = {
FORGOT_PASSWORD: '/forgot-password',
SIGN_IN: '/sign-in',
SIGN_UP: '/sign-up',
CLI: '/auth/cli',
}
export const PROTECTED_URLS = {
DASHBOARD: '/dashboard',
ACCOUNT_SETTINGS: '/dashboard/account',
RESET_PASSWORD: '/dashboard/account',
NEW_TEAM: '/dashboard/teams/new',
TEAMS: '/dashboard/teams',
RESOLVED_ACCOUNT_SETTINGS: (teamSlug: string) =>
`/dashboard/${teamSlug}/account`,
GENERAL: (teamSlug: string) => `/dashboard/${teamSlug}/general`,
KEYS: (teamSlug: string) => `/dashboard/${teamSlug}/keys`,
MEMBERS: (teamSlug: string) => `/dashboard/${teamSlug}/members`,
TERMINAL: (teamSlug: string) => `/dashboard/${teamSlug}/terminal`,
SANDBOXES: (teamSlug: string) =>
`/dashboard/${teamSlug}/sandboxes/monitoring`,
SANDBOXES_MONITORING: (teamSlug: string) =>
`/dashboard/${teamSlug}/sandboxes/monitoring`,
SANDBOXES_LIST: (teamSlug: string) => `/dashboard/${teamSlug}/sandboxes/list`,
SANDBOX: (teamSlug: string, sandboxId: string) =>
`/dashboard/${teamSlug}/sandboxes/${sandboxId}/monitoring`,
SANDBOX_MONITORING: (teamSlug: string, sandboxId: string) =>
`/dashboard/${teamSlug}/sandboxes/${sandboxId}/monitoring`,
SANDBOX_EVENTS: (teamSlug: string, sandboxId: string) =>
`/dashboard/${teamSlug}/sandboxes/${sandboxId}/events`,
SANDBOX_LOGS: (teamSlug: string, sandboxId: string) =>
`/dashboard/${teamSlug}/sandboxes/${sandboxId}/logs`,
SANDBOX_TERMINAL: (teamSlug: string, sandboxId: string) =>
`/dashboard/${teamSlug}/sandboxes/${sandboxId}/terminal`,
SANDBOX_FILESYSTEM: (teamSlug: string, sandboxId: string) =>
`/dashboard/${teamSlug}/sandboxes/${sandboxId}/filesystem`,
WEBHOOKS: (teamSlug: string) => `/dashboard/${teamSlug}/webhooks`,
TEMPLATES: (teamSlug: string) => `/dashboard/${teamSlug}/templates/list`,
TEMPLATES_LIST: (teamSlug: string) => `/dashboard/${teamSlug}/templates/list`,
TEMPLATES_BUILDS: (teamSlug: string) =>
`/dashboard/${teamSlug}/templates/builds`,
TEMPLATE_OVERVIEW: (teamSlug: string, templateId: string) =>
`/dashboard/${teamSlug}/templates/${templateId}/overview`,
TEMPLATE_DETAIL_BUILDS: (teamSlug: string, templateId: string) =>
`/dashboard/${teamSlug}/templates/${templateId}/builds`,
TEMPLATE_TAGS: (teamSlug: string, templateId: string) =>
`/dashboard/${teamSlug}/templates/${templateId}/tags`,
TEMPLATE_TAG_HISTORY: (teamSlug: string, templateId: string, tag: string) =>
`/dashboard/${teamSlug}/templates/${templateId}/tags/${encodeURIComponent(tag)}`,
TEMPLATE_BUILD: (teamSlug: string, templateId: string, buildId: string) =>
`/dashboard/${teamSlug}/templates/${templateId}/builds/${buildId}`,
USAGE: (teamSlug: string) => `/dashboard/${teamSlug}/usage`,
BILLING: (teamSlug: string) => `/dashboard/${teamSlug}/billing`,
BILLING_PLAN: (teamSlug: string) => `/dashboard/${teamSlug}/billing/plan`,
BILLING_PLAN_SELECT: (teamSlug: string) =>
`/dashboard/${teamSlug}/billing/plan/select`,
LIMITS: (teamSlug: string) => `/dashboard/${teamSlug}/limits`,
}
export const RESOLVER_URLS = {
INSPECT_SANDBOX: (sandboxId: string) =>
`/dashboard/inspect/sandbox/${sandboxId}`,
}
/**
* Route segments (after teamIdOrSlug) that contain team-specific
* resource IDs in their sub-paths. When switching teams, paths
* deeper than the segment root will be truncated to avoid 404s.
*
* e.g. /dashboard/{team}/sandboxes/{sandboxId}/monitoring
* → /dashboard/{newTeam}/sandboxes
*/
export const TEAM_SPECIFIC_RESOURCE_SEGMENTS: readonly string[] = [
'sandboxes',
'templates',
]
export const HELP_URLS = {
BUILD_TEMPLATE:
'https://e2b.dev/docs/sandbox-template#4-build-your-sandbox-template',
START_COMMAND: 'https://e2b.dev/docs/sandbox-template/start-cmd',
}
export const BASE_URL = process.env.VERCEL_ENV
? process.env.VERCEL_ENV === 'production'
? 'https://e2b.dev'
: `https://${process.env.VERCEL_BRANCH_URL}`
: 'http://localhost:3000'
export const GITHUB_URL = 'https://github.com/e2b-dev'