-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ts
62 lines (54 loc) · 1.18 KB
/
config.ts
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
import { z } from "zod"
const gooogleLanguages = [
"lang_ar",
"lang_bg",
"lang_ca",
"lang_cs",
"lang_da",
"lang_de",
"lang_el",
"lang_en",
"lang_es",
"lang_et",
"lang_fi",
"lang_fr",
"lang_hr",
"lang_hu",
"lang_id",
"lang_is",
"lang_it",
"lang_iw",
"lang_ja",
"lang_ko",
"lang_lt",
"lang_lv",
"lang_nl",
"lang_no",
"lang_pl",
"lang_pt",
"lang_ro",
"lang_ru",
"lang_sk",
"lang_sl",
"lang_sr",
"lang_sv",
"lang_tr",
"lang_zh-CN",
"lang_zh-TW",
] as const
const ConfigSchema = z.object({
ANYLIST_EMAIL: z.string(),
ANYLIST_PASSWORD: z.string(),
ANYLIST_NEW_ITEMS_LIST: z.string(),
ANYLIST_NEW_UNKNOWN_ITEM_NAME: z.string(),
OPEN_FOOD_FACTS_LANGUAGE: z.string(),
SCANNER_DELIMITER: z.union([z.literal("\r"), z.literal("\n"), z.literal("\r\n")]),
GOOGLE_API_KEY: z.string().optional(),
GOOGLE_CX: z.string().optional(),
GOOGLE_LANGUAGE: z.enum(gooogleLanguages).optional(),
// if you need a reverse proxy to fiugre out whats going on
ANYLIST_ENDPOINT: z.string().optional(),
// comma separated list of EANs for testing
TEST_EANS: z.string().optional(),
})
export const config = ConfigSchema.parse(process.env)