-
Notifications
You must be signed in to change notification settings - Fork 5
/
enums.ts
50 lines (46 loc) · 1.29 KB
/
enums.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
export const Environments = [
"development",
"test",
"staging",
"production"
] as const;
export type Environment = (typeof Environments)[number];
export const LogLevels = ["error", "info", "data", "trace"] as const;
export type LogLevel = (typeof LogLevels)[number];
export const Scopes = ["public", "private", "default"] as const;
/**
* Artifact registration scopes
* - `public` input handlers are public (as HTTP endpoints)
* - `private` input handlers are only avilable within the service via client() ports
* - `default` command handlers are public, event handlers are private when event producers are found within the service, otherwise public
*/
export type Scope = (typeof Scopes)[number];
export const ExitCodes = ["UNIT_TEST", "ERROR"] as const;
/**
* Application exit codes
* - `UNIT_TEST` to flag unit tests, avoiding process exits on errors
* - `ERROR` exit on errors
*/
export type ExitCode = (typeof ExitCodes)[number];
export const Operators = [
"eq",
"neq",
"lt",
"gt",
"lte",
"gte",
"in",
"nin"
] as const;
/**
* Filter operators
* - `eq` equal
* - `neq` not equal
* - `lt` less than
* - `gt` greater than
* - `lte` less than or equal
* - `gte` greater than or equal
* - `in` includes
* - `nin` not includes
*/
export type Operator = (typeof Operators)[number];