Support.constants.ts163 lines · main
1import { SupportCategories } from '@supabase/shared-types/out/constants'
2import { isFeatureEnabled } from 'common'
3
4const billingEnabled = isFeatureEnabled('billing:all')
5
6export type ExtendedSupportCategories = SupportCategories | 'Plan_upgrade' | 'Others'
7
8export const CATEGORY_OPTIONS: {
9 value: ExtendedSupportCategories
10 label: string
11 description: string
12 query?: string
13}[] = [
14 {
15 value: SupportCategories.PROBLEM,
16 label: 'APIs and client libraries',
17 description: "Issues with your project's API and client libraries",
18 query: undefined,
19 },
20 {
21 value: SupportCategories.DASHBOARD_BUG,
22 label: 'Dashboard bug',
23 description: 'Issues with the Briven dashboard',
24 query: undefined,
25 },
26 {
27 value: SupportCategories.DATABASE_UNRESPONSIVE,
28 label: 'Database unresponsive',
29 description: 'Issues with connecting to your database',
30 query: 'Unable to connect',
31 },
32 {
33 value: SupportCategories.PERFORMANCE_ISSUES,
34 label: 'Performance issues',
35 description: 'Reporting of performance issues is only available on the Pro Plan',
36 query: 'Performance',
37 },
38 {
39 value: SupportCategories.ABUSE,
40 label: 'Abuse report',
41 description: 'Report abuse of a Briven project or Briven brand',
42 query: undefined,
43 },
44 {
45 value: SupportCategories.LOGIN_ISSUES,
46 label: 'Issues with logging in',
47 description: 'Issues with logging in and MFA',
48 query: undefined,
49 },
50 ...(billingEnabled
51 ? [
52 {
53 value: SupportCategories.SALES_ENQUIRY,
54 label: 'Sales enquiry',
55 description: 'Questions about pricing, paid plans and Enterprise plans',
56 query: undefined,
57 },
58 {
59 value: SupportCategories.BILLING,
60 label: 'Billing',
61 description: 'Issues with credit card charges | invoices | overcharging',
62 query: undefined,
63 },
64 {
65 value: SupportCategories.REFUND,
66 label: 'Refund enquiry',
67 description: 'Formal enquiry form for requesting refunds',
68 query: undefined,
69 },
70 ]
71 : [
72 // [Joshen] Ideally shift this to shared-types, although not critical as API isn't validating the category
73 {
74 value: 'Plan_upgrade' as const,
75 label: 'Plan upgrade',
76 description: 'Enquire a plan upgrade for your organization',
77 query: undefined,
78 },
79 ]),
80]
81
82export const SEVERITY_OPTIONS = [
83 {
84 value: 'Low',
85 label: 'Low',
86 description: 'General guidance',
87 },
88 {
89 value: 'Normal',
90 label: 'Normal',
91 description: 'System impaired',
92 },
93 {
94 value: 'High',
95 label: 'High',
96 description: 'Production system impaired',
97 },
98 {
99 value: 'Urgent',
100 label: 'Urgent',
101 description: 'Production system down',
102 },
103]
104
105export const SERVICE_OPTIONS = [
106 {
107 id: 1,
108 name: 'Authentication',
109 value: 'Authentication',
110 disabled: false,
111 },
112 {
113 id: 2,
114 name: 'Dashboard',
115 value: 'Dashboard',
116 disabled: false,
117 },
118 {
119 id: 3,
120 name: 'Database',
121 value: 'Database',
122 disabled: false,
123 },
124 {
125 id: 4,
126 name: 'Edge Functions',
127 value: 'Edge Functions',
128 disabled: false,
129 },
130 {
131 id: 5,
132 name: 'Realtime',
133 value: 'Realtime',
134 disabled: false,
135 },
136 {
137 id: 6,
138 name: 'Storage',
139 value: 'Storage',
140 disabled: false,
141 },
142 {
143 id: 7,
144 name: 'Others',
145 value: 'Others',
146 disabled: false,
147 },
148]
149
150export const IPV4_MIGRATION_STRINGS = [
151 'ipv4',
152 'ipv6',
153 'supavisor',
154 'pgbouncer',
155 '5432',
156 'ENETUNREACH',
157 'ECONNREFUSED',
158 'P1001',
159 'connect: no route to',
160 'network is unreac',
161 'could not translate host name',
162 'address family not supported by protocol',
163]